diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-07-23 15:46:23 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-07-31 14:42:20 -0400 |
commit | ad0fcd4eb68059de02e1766948263c71b8a5b1dc (patch) | |
tree | dd3f5bfc443ded3fe4cdb7662374e7ba7198ebec /fs/nfs | |
parent | b042414feb240df5f5911b9bca39b61e6738e814 (diff) |
nfs: explicitly reject LOCK_MAND flock() requests
We have no mechanism to emulate LOCK_MAND locks on NFSv4, so explicitly
return -EINVAL if someone requests it.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/file.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 1557978ca7b3..b039a17ee941 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -834,6 +834,15 @@ int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) | |||
834 | if (!(fl->fl_flags & FL_FLOCK)) | 834 | if (!(fl->fl_flags & FL_FLOCK)) |
835 | return -ENOLCK; | 835 | return -ENOLCK; |
836 | 836 | ||
837 | /* | ||
838 | * The NFSv4 protocol doesn't support LOCK_MAND, which is not part of | ||
839 | * any standard. In principle we might be able to support LOCK_MAND | ||
840 | * on NFSv2/3 since NLMv3/4 support DOS share modes, but for now the | ||
841 | * NFS code is not set up for it. | ||
842 | */ | ||
843 | if (fl->fl_type & LOCK_MAND) | ||
844 | return -EINVAL; | ||
845 | |||
837 | if (NFS_SERVER(inode)->flags & NFS_MOUNT_LOCAL_FLOCK) | 846 | if (NFS_SERVER(inode)->flags & NFS_MOUNT_LOCAL_FLOCK) |
838 | is_local = 1; | 847 | is_local = 1; |
839 | 848 | ||