Skip to content

Commit 2d0dbc6

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
NFSv4: Fix unnecessary delegation returns in nfs4_do_open
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> Cc: stable@vger.kernel.org
1 parent 02c6752 commit 2d0dbc6

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/nfs/nfs4proc.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,6 +1902,7 @@ static struct nfs4_state *nfs4_do_open(struct inode *dir,
19021902
struct nfs4_state *res;
19031903
int status;
19041904

1905+
fmode &= FMODE_READ|FMODE_WRITE;
19051906
do {
19061907
status = _nfs4_do_open(dir, dentry, fmode, flags, sattr, cred,
19071908
&res, ctx_th);

0 commit comments

Comments
 (0)