lkml.org 
[lkml]   [2012]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[ 37/69] NFSv4: Fix unnecessary delegation returns in nfs4_do_open
    3.2-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Trond Myklebust <Trond.Myklebust@netapp.com>

    commit 2d0dbc6ae8a5194aaecb9cfffb9053f38fce8b86 upstream.

    While nfs4_do_open() expects the fmode argument to be restricted to
    combinations of FMODE_READ and FMODE_WRITE, both nfs4_atomic_open()
    and nfs4_proc_create will pass the nfs_open_context->mode,
    which contains the full fmode_t.

    This patch ensures that nfs4_do_open strips the other fmode_t bits,
    fixing a problem in which the nfs4_do_open call would result in an
    unnecessary delegation return.

    Reported-by: Fred Isaman <iisaman@netapp.com>
    Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    fs/nfs/nfs4proc.c | 1 +
    1 file changed, 1 insertion(+)

    --- a/fs/nfs/nfs4proc.c
    +++ b/fs/nfs/nfs4proc.c
    @@ -1825,6 +1825,7 @@
    struct nfs4_state *res;
    int status;

    + fmode &= FMODE_READ|FMODE_WRITE;
    do {
    status = _nfs4_do_open(dir, dentry, fmode, flags, sattr, cred, &res);
    if (status == 0)



    \
     
     \ /
      Last update: 2012-06-17 21:01    [W:4.291 / U:1.384 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site