Commit 1544fa0f authored by Trond Myklebust's avatar Trond Myklebust

NFS: Fix the mode calculation in nfs_find_open_context

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 80e60639
...@@ -623,10 +623,10 @@ struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_c ...@@ -623,10 +623,10 @@ struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_c
list_for_each_entry(pos, &nfsi->open_files, list) { list_for_each_entry(pos, &nfsi->open_files, list) {
if (cred != NULL && pos->cred != cred) if (cred != NULL && pos->cred != cred)
continue; continue;
if ((pos->mode & mode) == mode) { if ((pos->mode & (FMODE_READ|FMODE_WRITE)) != mode)
ctx = get_nfs_open_context(pos); continue;
break; ctx = get_nfs_open_context(pos);
} break;
} }
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
return ctx; return ctx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment