[PATCH 1/2] NFS: Fix NFS page_state usage

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

 



From: Trond Myklebust <[email protected]>

The introduction of the FLUSH_INVALIDATE argument to nfs_sync_inode_wait()
can cause the nr_unstable page state counter to be corrupted. Fix by
moving the call to sub_page_state() to inside nfs_scan_commit().

Signed-off-by: Trond Myklebust <[email protected]>
---

 fs/nfs/write.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index b383fdd..d054f12 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -636,6 +636,7 @@ nfs_scan_commit(struct inode *inode, str
 	if (nfsi->ncommit != 0) {
 		res = nfs_scan_list(nfsi, &nfsi->commit, dst, idx_start, npages);
 		nfsi->ncommit -= res;
+		sub_page_state(nr_unstable,res);
 		if ((nfsi->ncommit == 0) != list_empty(&nfsi->commit))
 			printk(KERN_ERR "NFS: desynchronized value of nfs_i.ncommit.\n");
 	}
@@ -1434,7 +1435,6 @@ static void nfs_commit_done(struct rpc_t
 		nfs_clear_page_writeback(req);
 		res++;
 	}
-	sub_page_state(nr_unstable,res);
 }
 
 static const struct rpc_call_ops nfs_commit_ops = {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux