]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - mm/page-writeback.c
Merge tag 'iommu-updates-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / mm / page-writeback.c
index 8989eada0ef7e40397e24383af2c2acd40b3c2d7..0b60cc7ddac2b1a63ce71ed17c02a64cb6370e1c 100644 (file)
@@ -2366,15 +2366,15 @@ int do_writepages(struct address_space *mapping, struct writeback_control *wbc)
 }
 
 /**
- * write_one_page - write out a single page and optionally wait on I/O
+ * write_one_page - write out a single page and wait on I/O
  * @page: the page to write
- * @wait: if true, wait on writeout
  *
  * The page must be locked by the caller and will be unlocked upon return.
  *
- * write_one_page() returns a negative error code if I/O failed.
+ * Note that the mapping's AS_EIO/AS_ENOSPC flags will be cleared when this
+ * function returns.
  */
-int write_one_page(struct page *page, int wait)
+int write_one_page(struct page *page)
 {
        struct address_space *mapping = page->mapping;
        int ret = 0;
@@ -2385,21 +2385,20 @@ int write_one_page(struct page *page, int wait)
 
        BUG_ON(!PageLocked(page));
 
-       if (wait)
-               wait_on_page_writeback(page);
+       wait_on_page_writeback(page);
 
        if (clear_page_dirty_for_io(page)) {
                get_page(page);
                ret = mapping->a_ops->writepage(page, &wbc);
-               if (ret == 0 && wait) {
+               if (ret == 0)
                        wait_on_page_writeback(page);
-                       if (PageError(page))
-                               ret = -EIO;
-               }
                put_page(page);
        } else {
                unlock_page(page);
        }
+
+       if (!ret)
+               ret = filemap_check_errors(mapping);
        return ret;
 }
 EXPORT_SYMBOL(write_one_page);