All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Mayhew <smayhew@redhat.com>
To: trond.myklebust@primarydata.com, anna.schumaker@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH] nfs: nfs_commit_inode should redirty inode if the inode has outstanding requests
Date: Fri,  2 Mar 2018 11:00:38 -0500	[thread overview]
Message-ID: <20180302160038.1598-1-smayhew@redhat.com> (raw)

It seems that nfs_commit_inode can be called where the nfs_inode has
outstanding requests and the commit lists are empty.  That can lead to
invalidate_complete_page2 failing due to the associated page having
private data which in turn leads to invalidate_inode_pages2_range
returning -EBUSY.

Instead of having nfs_commit_inode exit early when the commit lists are
empty, only do so if nrequests is also 0.

Fixes: dc4fd9ab01 ("nfs: don't wait on commit in nfs_commit_inode() if there were no commit requests")
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 fs/nfs/write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 7428a66..0268bd1 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1890,7 +1890,7 @@ int nfs_commit_inode(struct inode *inode, int how)
 	if (res)
 		error = nfs_generic_commit_list(inode, &head, how, &cinfo);
 	nfs_commit_end(cinfo.mds);
-	if (res == 0)
+	if (res == 0 && !nfs_have_writebacks(inode))
 		return res;
 	if (error < 0)
 		goto out_error;
-- 
2.9.5


             reply	other threads:[~2018-03-02 16:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-02 16:00 Scott Mayhew [this message]
2018-03-02 16:52 ` [PATCH] nfs: nfs_commit_inode should redirty inode if the inode has outstanding requests Trond Myklebust
2018-03-02 17:04   ` Trond Myklebust
2018-03-05 21:16 ` J. Bruce Fields
2018-03-05 21:48   ` Trond Myklebust
2018-03-07 19:53     ` Scott Mayhew
2018-03-07 20:38       ` Trond Myklebust
2018-03-08 13:09         ` Scott Mayhew
2018-03-08 17:13           ` Trond Myklebust
2018-03-12 12:07             ` Scott Mayhew
2018-03-12 12:32               ` Trond Myklebust
2018-03-08 21:39           ` bfields
2018-03-08 22:01             ` Trond Myklebust
2018-03-09  2:46               ` bfields

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=20180302160038.1598-1-smayhew@redhat.com \
    --to=smayhew@redhat.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /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.