summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2018-07-25 19:28:26 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2018-07-25 19:28:26 -0400
commit8dab1fd52777427896b8833d3387a56cd5768e11 (patch)
treea2db10316186985ebbb7fc98ace3a51f5e3b2634
parentd0cf63086f470c44c63d7ecaf604301f4839eb7d (diff)
downloadlongterm-queue-4.12-8dab1fd52777427896b8833d3387a56cd5768e11.tar.gz
nfs: fixup conversion backport for additional instance
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r--queue/NFS-Use-an-atomic_long_t-to-count-the-number-of-comm.patch15
1 files changed, 12 insertions, 3 deletions
diff --git a/queue/NFS-Use-an-atomic_long_t-to-count-the-number-of-comm.patch b/queue/NFS-Use-an-atomic_long_t-to-count-the-number-of-comm.patch
index 40d6a64..df52f20 100644
--- a/queue/NFS-Use-an-atomic_long_t-to-count-the-number-of-comm.patch
+++ b/queue/NFS-Use-an-atomic_long_t-to-count-the-number-of-comm.patch
@@ -1,4 +1,4 @@
-From d07628cc1c9b1f16242295ea24e515fa00b26b04 Mon Sep 17 00:00:00 2001
+From 0105e0cfd1e3f88968caa14bf8ae92f76c27d9ed Mon Sep 17 00:00:00 2001
From: Trond Myklebust <trond.myklebust@primarydata.com>
Date: Tue, 1 Aug 2017 17:04:12 -0400
Subject: [PATCH] NFS: Use an atomic_long_t to count the number of commits
@@ -6,6 +6,7 @@ Subject: [PATCH] NFS: Use an atomic_long_t to count the number of commits
commit 5cb953d4b1e70a09084f71594c45d47458346bc2 upstream.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
+[PG: add an additional conversion for older 4.12.x code base.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
@@ -22,7 +23,7 @@ index 8c465d3c7e05..4246812964ed 100644
init_rwsem(&nfsi->rmdir_sem);
nfs4_init_once(nfsi);
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
-index 86d73ecda36b..2fd1a2959fa5 100644
+index 86d73ecda36b..ea9f381624c7 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -826,7 +826,7 @@ nfs_request_add_commit_list_locked(struct nfs_page *req, struct list_head *dst,
@@ -64,7 +65,7 @@ index 86d73ecda36b..2fd1a2959fa5 100644
const int max = INT_MAX;
ret = nfs_scan_commit_list(&cinfo->mds->list, dst,
-@@ -1879,7 +1881,7 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc)
+@@ -1879,14 +1881,14 @@ int nfs_write_inode(struct inode *inode, struct writeback_control *wbc)
int ret = 0;
/* no commits means nothing needs to be done */
@@ -73,6 +74,14 @@ index 86d73ecda36b..2fd1a2959fa5 100644
return ret;
if (wbc->sync_mode == WB_SYNC_NONE) {
+ /* 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 (atomic_long_read(&nfsi->commit_info.ncommit) <= (nfsi->nrequests >> 1))
+ goto out_mark_dirty;
+
+ /* don't wait for the COMMIT response */
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 7882a07d973e..34e80ffd9e90 100644
--- a/include/linux/nfs_xdr.h