Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1574446

Re: Linux 4.10-rc7

From Christoph Hellwig <hch@lst.de>
Newsgroups linux.kernel
Subject Re: Linux 4.10-rc7
Date 2017-02-06 09:20 +0100
Message-ID <t7MGJ-2kY-9@gated-at.bofh.it> (permalink)
References <t7EJb-5x1-5@gated-at.bofh.it> <t7KEW-17z-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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);

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Linux 4.10-rc7 Linus Torvalds <torvalds@linux-foundation.org> - 2017-02-06 00:50 +0100
  Re: Linux 4.10-rc7 Dave Jones <davej@codemonkey.org.uk> - 2017-02-06 07:10 +0100
    Re: Linux 4.10-rc7 Christoph Hellwig <hch@lst.de> - 2017-02-06 09:20 +0100
      Re: Linux 4.10-rc7 Dave Jones <davej@codemonkey.org.uk> - 2017-02-07 01:30 +0100
        Re: Linux 4.10-rc7 Linus Torvalds <torvalds@linux-foundation.org> - 2017-02-07 02:00 +0100
          Re: Linux 4.10-rc7 Christoph Hellwig <hch@lst.de> - 2017-02-07 10:00 +0100

csiph-web