[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170206081924.GA21703@lst.de>
Date: Mon, 6 Feb 2017 09:19:24 +0100
From: Christoph Hellwig <hch@....de>
To: Dave Jones <davej@...emonkey.org.uk>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Christoph Hellwig <hch@....de>
Subject: Re: Linux 4.10-rc7
On Mon, Feb 06, 2017 at 01:00:32AM -0500, Dave Jones wrote:
> This one smells funny to me.
Double mnt_want_write, no idea why lockdep isn't reporting that for me.
Fix below:
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index ca13236dbb1f..a974368026a1 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -359,11 +359,6 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
err = fh_verify(rqstp, fhp, ftype, accmode);
if (err)
return err;
- if (get_write_count) {
- host_err = fh_want_write(fhp);
- if (host_err)
- goto out_host_err;
- }
dentry = fhp->fh_dentry;
inode = d_inode(dentry);
@@ -416,6 +411,12 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
iap->ia_valid |= ATTR_CTIME;
+ if (get_write_count) {
+ host_err = fh_want_write(fhp);
+ if (host_err)
+ goto out_host_err;
+ }
+
fh_lock(fhp);
host_err = notify_change(dentry, iap, NULL);
fh_unlock(fhp);
Powered by blists - more mailing lists