提交 1544fa0f 编写于 作者: T Trond Myklebust

NFS: Fix the mode calculation in nfs_find_open_context

Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 80e60639
......@@ -623,11 +623,11 @@ struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_c
list_for_each_entry(pos, &nfsi->open_files, list) {
if (cred != NULL && pos->cred != cred)
continue;
if ((pos->mode & mode) == mode) {
if ((pos->mode & (FMODE_READ|FMODE_WRITE)) != mode)
continue;
ctx = get_nfs_open_context(pos);
break;
}
}
spin_unlock(&inode->i_lock);
return ctx;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册