From: Trond Myklebust Date: Thu, 25 Mar 2010 17:54:49 +0000 (-0400) Subject: NFS: Fix the mode calculation in nfs_find_open_context X-Git-Tag: v2.6.34-rc5~23^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1544fa0f7a46241582abc48f07b74f3d846379e4;p=profile%2Fcommon%2Fkernel-common.git NFS: Fix the mode calculation in nfs_find_open_context Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 737128f..50a56ed 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.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) { if (cred != NULL && pos->cred != cred) continue; - if ((pos->mode & mode) == mode) { - ctx = get_nfs_open_context(pos); - break; - } + if ((pos->mode & (FMODE_READ|FMODE_WRITE)) != mode) + continue; + ctx = get_nfs_open_context(pos); + break; } spin_unlock(&inode->i_lock); return ctx;