All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfs: nfs_commit_inode should redirty inode if the inode has outstanding requests
@ 2018-03-02 16:00 Scott Mayhew
  2018-03-02 16:52 ` Trond Myklebust
  2018-03-05 21:16 ` J. Bruce Fields
  0 siblings, 2 replies; 14+ messages in thread
From: Scott Mayhew @ 2018-03-02 16:00 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker; +Cc: linux-nfs

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


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-03-12 12:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-02 16:00 [PATCH] nfs: nfs_commit_inode should redirty inode if the inode has outstanding requests Scott Mayhew
2018-03-02 16:52 ` 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

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.