diff options
-rw-r--r-- | mm/page-writeback.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index c3fb38b1ea43..2e8c2b01d5d5 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -945,11 +945,20 @@ continue_unlock: | |||
945 | goto continue_unlock; | 945 | goto continue_unlock; |
946 | } | 946 | } |
947 | 947 | ||
948 | if (wbc->sync_mode != WB_SYNC_NONE) | 948 | if (!PageDirty(page)) { |
949 | wait_on_page_writeback(page); | 949 | /* someone wrote it for us */ |
950 | goto continue_unlock; | ||
951 | } | ||
952 | |||
953 | if (PageWriteback(page)) { | ||
954 | if (wbc->sync_mode != WB_SYNC_NONE) | ||
955 | wait_on_page_writeback(page); | ||
956 | else | ||
957 | goto continue_unlock; | ||
958 | } | ||
950 | 959 | ||
951 | if (PageWriteback(page) || | 960 | BUG_ON(PageWriteback(page)); |
952 | !clear_page_dirty_for_io(page)) | 961 | if (!clear_page_dirty_for_io(page)) |
953 | goto continue_unlock; | 962 | goto continue_unlock; |
954 | 963 | ||
955 | ret = (*writepage)(page, wbc, data); | 964 | ret = (*writepage)(page, wbc, data); |