[PATCH] nfs: nfs_commit_inode should redirty inode if the inode has outstanding requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux