open_downgrade use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm failing to think of what can trigger an open_downgrade?
I thought the following example should trigger an open downgrade:

fd0 = open(foo, RDRW)   -- should be open on the wire for "both"
fd1 = open(foo, RDONLY)  -- should be open on the wire for "read"
close(fd0) -- should trigger an open_downgrade
read(fd1)
close(fd1)

However this commit says that it's not allowed by the spec.

commit cd9288ffaea4359d5cfe2b8d264911506aed26a4
Author: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>
Date:   Thu Sep 18 11:51:32 2014 -0400

    NFSv4: Fix another bug in the close/open_downgrade code

    James Drew reports another bug whereby the NFS client is now sending
    an OPEN_DOWNGRADE in a situation where it should really have sent a
    CLOSE: the client is opening the file for O_RDWR, but then trying to
    do a downgrade to O_RDONLY, which is not allowed by the NFSv4 spec.

    Reported-by: James Drews <drews@xxxxxxxxxxxxx>
    Link: http://lkml.kernel.org/r/541AD7E5.8020409@xxxxxxxxxxxxx
    Fixes: aee7af356e15 (NFSv4: Fix problems with close in the presence...)
    Cc: stable@xxxxxxxxxxxxxxx # 2.6.33+
    Signed-off-by: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>

If RDWR to RDONLY isn't allowed then why do we have OPEN_DOWNGRADE at all?
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux