aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-07-23 15:49:56 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-07-30 18:09:13 -0400
commitf44106e2173f08ccb1c9195d85a6c22388b461c1 (patch)
treecc11631a86516803ed27a40b17f5127e74fb52c9 /fs
parentc95908e4c50d218f016e3866f5abf786055df635 (diff)
nfs: fix fl_type tests in NFSv4 code
fl_type is not a bitmap. Reported-by: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4proc.c2
-rw-r--r--fs/nfs/nfs4xdr.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5e373c30e8d4..6843e0a37de8 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4885,7 +4885,7 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request)
4885 * Don't rely on the VFS having checked the file open mode, 4885 * Don't rely on the VFS having checked the file open mode,
4886 * since it won't do this for flock() locks. 4886 * since it won't do this for flock() locks.
4887 */ 4887 */
4888 switch (request->fl_type & (F_RDLCK|F_WRLCK|F_UNLCK)) { 4888 switch (request->fl_type) {
4889 case F_RDLCK: 4889 case F_RDLCK:
4890 if (!(filp->f_mode & FMODE_READ)) 4890 if (!(filp->f_mode & FMODE_READ))
4891 return -EBADF; 4891 return -EBADF;
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 610ebccbde5d..6cbd602e26d5 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1236,7 +1236,7 @@ static void encode_link(struct xdr_stream *xdr, const struct qstr *name, struct
1236 1236
1237static inline int nfs4_lock_type(struct file_lock *fl, int block) 1237static inline int nfs4_lock_type(struct file_lock *fl, int block)
1238{ 1238{
1239 if ((fl->fl_type & (F_RDLCK|F_WRLCK|F_UNLCK)) == F_RDLCK) 1239 if (fl->fl_type == F_RDLCK)
1240 return block ? NFS4_READW_LT : NFS4_READ_LT; 1240 return block ? NFS4_READW_LT : NFS4_READ_LT;
1241 return block ? NFS4_WRITEW_LT : NFS4_WRITE_LT; 1241 return block ? NFS4_WRITEW_LT : NFS4_WRITE_LT;
1242} 1242}