diff options
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index e3b55372726c..9347ab7c9574 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, | |||
846 | int nfs_flush_incompatible(struct file *file, struct page *page) | 846 | int 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; |
@@ -1576,6 +1580,7 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data) | |||
1576 | /* We have a mismatch. Write the page again */ | 1580 | /* We have a mismatch. Write the page again */ |
1577 | dprintk(" mismatch\n"); | 1581 | dprintk(" mismatch\n"); |
1578 | nfs_mark_request_dirty(req); | 1582 | nfs_mark_request_dirty(req); |
1583 | set_bit(NFS_CONTEXT_RESEND_WRITES, &req->wb_context->flags); | ||
1579 | next: | 1584 | next: |
1580 | nfs_unlock_and_release_request(req); | 1585 | nfs_unlock_and_release_request(req); |
1581 | } | 1586 | } |