All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Dave Jones <davej@codemonkey.org.uk>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: Linux 4.10-rc7
Date: Mon, 6 Feb 2017 09:19:24 +0100	[thread overview]
Message-ID: <20170206081924.GA21703@lst.de> (raw)
In-Reply-To: <20170206060032.f7ktrvogksxl4ppy@codemonkey.org.uk>

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

  reply	other threads:[~2017-02-06  8:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-05 23:41 Linux 4.10-rc7 Linus Torvalds
2017-02-06  6:00 ` Dave Jones
2017-02-06  8:19   ` Christoph Hellwig [this message]
2017-02-07  0:22     ` Dave Jones
2017-02-07  0:56       ` Linus Torvalds
2017-02-07  8:57         ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2017-02-06  6:14 Sedat Dilek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170206081924.GA21703@lst.de \
    --to=hch@lst.de \
    --cc=davej@codemonkey.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.