These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / fs / sync.c
index fbc98ee..dd5d171 100644 (file)
@@ -86,7 +86,12 @@ static void fdatawrite_one_bdev(struct block_device *bdev, void *arg)
 
 static void fdatawait_one_bdev(struct block_device *bdev, void *arg)
 {
-       filemap_fdatawait(bdev->bd_inode->i_mapping);
+       /*
+        * We keep the error status of individual mapping so that
+        * applications can catch the writeback error using fsync(2).
+        * See filemap_fdatawait_keep_errors() for details.
+        */
+       filemap_fdatawait_keep_errors(bdev->bd_inode->i_mapping);
 }
 
 /*
@@ -343,7 +348,8 @@ SYSCALL_DEFINE4(sync_file_range, int, fd, loff_t, offset, loff_t, nbytes,
        }
 
        if (flags & SYNC_FILE_RANGE_WRITE) {
-               ret = filemap_fdatawrite_range(mapping, offset, endbyte);
+               ret = __filemap_fdatawrite_range(mapping, offset, endbyte,
+                                                WB_SYNC_NONE);
                if (ret < 0)
                        goto out_put;
        }