diff options
-rw-r--r-- | fs/nfs/write.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index ce40cadb15db..997b42aa3702 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1493,18 +1493,19 @@ static int nfs_wb_page_priority(struct inode *inode, struct page *page, | |||
1493 | }; | 1493 | }; |
1494 | int ret; | 1494 | int ret; |
1495 | 1495 | ||
1496 | BUG_ON(!PageLocked(page)); | 1496 | do { |
1497 | if (clear_page_dirty_for_io(page)) { | 1497 | if (clear_page_dirty_for_io(page)) { |
1498 | ret = nfs_writepage_locked(page, &wbc); | 1498 | ret = nfs_writepage_locked(page, &wbc); |
1499 | if (ret < 0) | ||
1500 | goto out_error; | ||
1501 | } else if (!PagePrivate(page)) | ||
1502 | break; | ||
1503 | ret = nfs_sync_mapping_wait(page->mapping, &wbc, how); | ||
1499 | if (ret < 0) | 1504 | if (ret < 0) |
1500 | goto out; | 1505 | goto out_error; |
1501 | } | 1506 | } while (PagePrivate(page)); |
1502 | if (!PagePrivate(page)) | 1507 | return 0; |
1503 | return 0; | 1508 | out_error: |
1504 | ret = nfs_sync_mapping_wait(page->mapping, &wbc, how); | ||
1505 | if (ret >= 0) | ||
1506 | return 0; | ||
1507 | out: | ||
1508 | __mark_inode_dirty(inode, I_DIRTY_PAGES); | 1509 | __mark_inode_dirty(inode, I_DIRTY_PAGES); |
1509 | return ret; | 1510 | return ret; |
1510 | } | 1511 | } |