aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index e3b55372726c..e1b5fe4d873a 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -846,6 +846,7 @@ static int nfs_writepage_setup(struct nfs_open_context *ctx, struct page *page,
846int nfs_flush_incompatible(struct file *file, struct page *page) 846int nfs_flush_incompatible(struct file *file, struct page *page)
847{ 847{
848 struct nfs_open_context *ctx = nfs_file_open_context(file); 848 struct nfs_open_context *ctx = nfs_file_open_context(file);
849 struct nfs_lock_context *l_ctx;
849 struct nfs_page *req; 850 struct nfs_page *req;
850 int do_flush, status; 851 int do_flush, status;
851 /* 852 /*
@@ -860,9 +861,12 @@ int nfs_flush_incompatible(struct file *file, struct page *page)
860 req = nfs_page_find_request(page); 861 req = nfs_page_find_request(page);
861 if (req == NULL) 862 if (req == NULL)
862 return 0; 863 return 0;
863 do_flush = req->wb_page != page || req->wb_context != ctx || 864 l_ctx = req->wb_lock_context;
864 req->wb_lock_context->lockowner != current->files || 865 do_flush = req->wb_page != page || req->wb_context != ctx;
865 req->wb_lock_context->pid != current->tgid; 866 if (l_ctx) {
867 do_flush |= l_ctx->lockowner.l_owner != current->files
868 || l_ctx->lockowner.l_pid != current->tgid;
869 }
866 nfs_release_request(req); 870 nfs_release_request(req);
867 if (!do_flush) 871 if (!do_flush)
868 return 0; 872 return 0;