summaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2018-03-20 23:43:13 +0300
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2018-04-10 23:06:22 +0300
commitf50862423f547f8506d69b6e4fc53be53288244c (patch)
tree9ea17ff2a8283aa5b71d5672e5ac430bee036beb /fs/nfs
parent25524288631fc5b7d33259fca1e0dc38146be5d6 (diff)
downloadlinux-f50862423f547f8506d69b6e4fc53be53288244c.tar.xz
NFSv4: Fix nfs4_return_incompatible_delegation
The 'fmode' argument can take an FMODE_EXEC value, which we want to filter out before comparing to the delegation type. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4proc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index ec68edce6cc3..71f2916f93ff 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1669,6 +1669,7 @@ static void nfs4_return_incompatible_delegation(struct inode *inode, fmode_t fmo
{
struct nfs_delegation *delegation;
+ fmode &= FMODE_READ|FMODE_WRITE;
rcu_read_lock();
delegation = rcu_dereference(NFS_I(inode)->delegation);
if (delegation == NULL || (delegation->type & fmode) == fmode) {