aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-06-25 16:35:53 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-07-30 14:41:56 -0400
commitf11ac8db5d07b6e99d41ff4aa39d878ee5cef1c5 (patch)
tree4393cbc2653145ba3269d5143f5db7811a59698b /fs/nfs/write.c
parent1f0e890dba5b0f543fea47732116b1c65d55614e (diff)
NFSv4: Ensure that we track the NFSv4 lock state in read/write requests.
This patch fixes bugzilla entry 14501: https://bugzilla.kernel.org/show_bug.cgi?id=14501 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 03df22822c4c..5eccea127cac 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -689,7 +689,9 @@ int nfs_flush_incompatible(struct file *file, struct page *page)
689 req = nfs_page_find_request(page); 689 req = nfs_page_find_request(page);
690 if (req == NULL) 690 if (req == NULL)
691 return 0; 691 return 0;
692 do_flush = req->wb_page != page || req->wb_context != ctx; 692 do_flush = req->wb_page != page || req->wb_context != ctx ||
693 req->wb_lock_context->lockowner != current->files ||
694 req->wb_lock_context->pid != current->tgid;
693 nfs_release_request(req); 695 nfs_release_request(req);
694 if (!do_flush) 696 if (!do_flush)
695 return 0; 697 return 0;
@@ -813,6 +815,7 @@ static int nfs_write_rpcsetup(struct nfs_page *req,
813 data->args.pages = data->pagevec; 815 data->args.pages = data->pagevec;
814 data->args.count = count; 816 data->args.count = count;
815 data->args.context = get_nfs_open_context(req->wb_context); 817 data->args.context = get_nfs_open_context(req->wb_context);
818 data->args.lock_context = req->wb_lock_context;
816 data->args.stable = NFS_UNSTABLE; 819 data->args.stable = NFS_UNSTABLE;
817 if (how & FLUSH_STABLE) { 820 if (how & FLUSH_STABLE) {
818 data->args.stable = NFS_DATA_SYNC; 821 data->args.stable = NFS_DATA_SYNC;