diff options
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 72813ede029e..106fd0634ab3 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1166,7 +1166,13 @@ static void nfs_writeback_done_full(struct rpc_task *task, void *calldata) | |||
1166 | static void nfs_writeback_release_full(void *calldata) | 1166 | static void nfs_writeback_release_full(void *calldata) |
1167 | { | 1167 | { |
1168 | struct nfs_write_data *data = calldata; | 1168 | struct nfs_write_data *data = calldata; |
1169 | int status = data->task.tk_status; | 1169 | int ret, status = data->task.tk_status; |
1170 | struct nfs_pageio_descriptor pgio; | ||
1171 | |||
1172 | if (data->pnfs_error) { | ||
1173 | nfs_pageio_init_write_mds(&pgio, data->inode, FLUSH_STABLE); | ||
1174 | pgio.pg_recoalesce = 1; | ||
1175 | } | ||
1170 | 1176 | ||
1171 | /* Update attributes as result of writeback. */ | 1177 | /* Update attributes as result of writeback. */ |
1172 | while (!list_empty(&data->pages)) { | 1178 | while (!list_empty(&data->pages)) { |
@@ -1182,6 +1188,11 @@ static void nfs_writeback_release_full(void *calldata) | |||
1182 | req->wb_bytes, | 1188 | req->wb_bytes, |
1183 | (long long)req_offset(req)); | 1189 | (long long)req_offset(req)); |
1184 | 1190 | ||
1191 | if (data->pnfs_error) { | ||
1192 | dprintk(", pnfs error = %d\n", data->pnfs_error); | ||
1193 | goto next; | ||
1194 | } | ||
1195 | |||
1185 | if (status < 0) { | 1196 | if (status < 0) { |
1186 | nfs_set_pageerror(page); | 1197 | nfs_set_pageerror(page); |
1187 | nfs_context_set_write_error(req->wb_context, status); | 1198 | nfs_context_set_write_error(req->wb_context, status); |
@@ -1201,7 +1212,19 @@ remove_request: | |||
1201 | next: | 1212 | next: |
1202 | nfs_clear_page_tag_locked(req); | 1213 | nfs_clear_page_tag_locked(req); |
1203 | nfs_end_page_writeback(page); | 1214 | nfs_end_page_writeback(page); |
1215 | if (data->pnfs_error) { | ||
1216 | lock_page(page); | ||
1217 | nfs_pageio_cond_complete(&pgio, page->index); | ||
1218 | ret = nfs_page_async_flush(&pgio, page, 0); | ||
1219 | if (ret) { | ||
1220 | nfs_set_pageerror(page); | ||
1221 | dprintk("rewrite to MDS error = %d\n", ret); | ||
1222 | } | ||
1223 | unlock_page(page); | ||
1224 | } | ||
1204 | } | 1225 | } |
1226 | if (data->pnfs_error) | ||
1227 | nfs_pageio_complete(&pgio); | ||
1205 | nfs_writedata_release(calldata); | 1228 | nfs_writedata_release(calldata); |
1206 | } | 1229 | } |
1207 | 1230 | ||