diff options
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 767e46c09074..010733c8bdcd 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1037,25 +1037,11 @@ nfs_scan_commit_list(struct list_head *src, struct list_head *dst, | |||
1037 | struct nfs_page *req, *tmp; | 1037 | struct nfs_page *req, *tmp; |
1038 | int ret = 0; | 1038 | int ret = 0; |
1039 | 1039 | ||
1040 | restart: | ||
1041 | list_for_each_entry_safe(req, tmp, src, wb_list) { | 1040 | list_for_each_entry_safe(req, tmp, src, wb_list) { |
1042 | kref_get(&req->wb_kref); | 1041 | kref_get(&req->wb_kref); |
1043 | if (!nfs_lock_request(req)) { | 1042 | if (!nfs_lock_request(req)) { |
1044 | int status; | ||
1045 | |||
1046 | /* Prevent deadlock with nfs_lock_and_join_requests */ | ||
1047 | if (!list_empty(dst)) { | ||
1048 | nfs_release_request(req); | ||
1049 | continue; | ||
1050 | } | ||
1051 | /* Ensure we make progress to prevent livelock */ | ||
1052 | mutex_unlock(&NFS_I(cinfo->inode)->commit_mutex); | ||
1053 | status = nfs_wait_on_request(req); | ||
1054 | nfs_release_request(req); | 1043 | nfs_release_request(req); |
1055 | mutex_lock(&NFS_I(cinfo->inode)->commit_mutex); | 1044 | continue; |
1056 | if (status < 0) | ||
1057 | break; | ||
1058 | goto restart; | ||
1059 | } | 1045 | } |
1060 | nfs_request_remove_commit_list(req, cinfo); | 1046 | nfs_request_remove_commit_list(req, cinfo); |
1061 | clear_bit(PG_COMMIT_TO_DS, &req->wb_flags); | 1047 | clear_bit(PG_COMMIT_TO_DS, &req->wb_flags); |
@@ -1904,6 +1890,7 @@ static int __nfs_commit_inode(struct inode *inode, int how, | |||
1904 | int may_wait = how & FLUSH_SYNC; | 1890 | int may_wait = how & FLUSH_SYNC; |
1905 | int ret, nscan; | 1891 | int ret, nscan; |
1906 | 1892 | ||
1893 | how &= ~FLUSH_SYNC; | ||
1907 | nfs_init_cinfo_from_inode(&cinfo, inode); | 1894 | nfs_init_cinfo_from_inode(&cinfo, inode); |
1908 | nfs_commit_begin(cinfo.mds); | 1895 | nfs_commit_begin(cinfo.mds); |
1909 | for (;;) { | 1896 | for (;;) { |