On Mon, Dec 07, 2015 at 11:26:01AM -0500, Benjamin Coddington wrote: > We only need to check lock exclusive/shared types against open mode when > flock() is used on NFS, so move it into the flock-specific path instead of > checking it for all locks. > > Signed-off-by: Benjamin Coddington <bcodding@xxxxxxxxxx> > --- > fs/nfs/file.c | 15 +++++++++++++++ > fs/nfs/nfs4proc.c | 13 ------------- > 2 files changed, 15 insertions(+), 13 deletions(-) > > diff --git a/fs/nfs/file.c b/fs/nfs/file.c > index 93e2364..ec16abc 100644 > --- a/fs/nfs/file.c > +++ b/fs/nfs/file.c > @@ -893,6 +893,21 @@ int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) > /* We're simulating flock() locks using posix locks on the server */ > if (fl->fl_type == F_UNLCK) > return do_unlk(filp, cmd, fl, is_local); > + > + /* > + * Don't rely on the VFS having checked the file open mode, > + * since it won't do this for flock() locks. > + */ As this is only called for flock the comment doesn't make sense. And maybe it's also time to ask why the VFS doesn't do this, as I'd expect it to perform this instead of every file system. -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html