NFSv4: Fix a thinko in nfs4_try_open_cached
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 29 May 2013 19:36:40 +0000 (15:36 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 29 May 2013 20:03:23 +0000 (16:03 -0400)
We need to pass the full open mode flags to nfs_may_open() when doing
a delegated open.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@vger.kernel.org
fs/nfs/nfs4proc.c

index 4e2fe714d5c292ae7776cb070c0c21fbfffdf7d1..d7ba5616989c49fe52d396d41187a663744598f1 100644 (file)
@@ -1078,7 +1078,7 @@ static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata)
        struct nfs4_state *state = opendata->state;
        struct nfs_inode *nfsi = NFS_I(state->inode);
        struct nfs_delegation *delegation;
-       int open_mode = opendata->o_arg.open_flags & (O_EXCL|O_TRUNC);
+       int open_mode = opendata->o_arg.open_flags;
        fmode_t fmode = opendata->o_arg.fmode;
        nfs4_stateid stateid;
        int ret = -EAGAIN;