From 4884088542b64676d9d9b755739e47cdf858fd66 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Mon, 23 Jul 2012 15:46:23 -0400 Subject: [PATCH] --- yaml --- r: 320547 b: refs/heads/master c: ad0fcd4eb68059de02e1766948263c71b8a5b1dc h: refs/heads/master i: 320545: 9523cb9c01bf93119fedcdaa010c3ecb240cd44c 320543: 5668c9579858968fbf04c6308d60d038ce0337b2 v: v3 --- [refs] | 2 +- trunk/fs/nfs/file.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index c6e2c0982d92..2fb6a58a5cf0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b042414feb240df5f5911b9bca39b61e6738e814 +refs/heads/master: ad0fcd4eb68059de02e1766948263c71b8a5b1dc diff --git a/trunk/fs/nfs/file.c b/trunk/fs/nfs/file.c index 1557978ca7b3..b039a17ee941 100644 --- a/trunk/fs/nfs/file.c +++ b/trunk/fs/nfs/file.c @@ -834,6 +834,15 @@ int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) if (!(fl->fl_flags & FL_FLOCK)) return -ENOLCK; + /* + * The NFSv4 protocol doesn't support LOCK_MAND, which is not part of + * any standard. In principle we might be able to support LOCK_MAND + * on NFSv2/3 since NLMv3/4 support DOS share modes, but for now the + * NFS code is not set up for it. + */ + if (fl->fl_type & LOCK_MAND) + return -EINVAL; + if (NFS_SERVER(inode)->flags & NFS_MOUNT_LOCAL_FLOCK) is_local = 1;