From: Trond Myklebust <trond.myklebust@primarydata.com>
Date: Tue, 20 Jun 2017 23:35:38 +0000 (-0400)
Subject: NFS: Fix commit policy for non-blocking calls to nfs_write_inode()
X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1a4edf0f46b0cb87dd5020481d355cd5cc456c47;p=linux.git

NFS: Fix commit policy for non-blocking calls to nfs_write_inode()

Now that the writes will schedule a commit on their own, we don't
need nfs_write_inode() to schedule one if there are outstanding
writes, and we're being called in non-blocking mode.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
---

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 051197cb9195f..b1af5dee5e0a8 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1941,7 +1941,7 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc)
 		/* Don't commit yet if this is a non-blocking flush and there
 		 * are a lot of outstanding writes for this mapping.
 		 */
-		if (nfsi->commit_info.ncommit <= (nfsi->nrequests >> 1))
+		if (mapping_tagged(inode->i_mapping, PAGECACHE_TAG_WRITEBACK))
 			goto out_mark_dirty;
 
 		/* don't wait for the COMMIT response */