ceph: SetPageError() for writeback pages if writepages fails
authorYan, Zheng <zyan@redhat.com>
Fri, 13 May 2016 09:54:17 +0000 (17:54 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 25 May 2016 23:15:41 +0000 (01:15 +0200)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
fs/ceph/addr.c

index 080a9cab3ee17f3975f759a1846805cc7e8aa4fa..8fa1f91cbf16e49c22b8be525aa24b11dd196ef6 100644 (file)
@@ -626,7 +626,6 @@ static void writepages_finish(struct ceph_osd_request *req)
        struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
        bool remove_page;
 
-
        dout("writepages_finish %p rc %d\n", inode, rc);
        if (rc < 0)
                mapping_set_error(mapping, rc);
@@ -661,6 +660,9 @@ static void writepages_finish(struct ceph_osd_request *req)
                                clear_bdi_congested(&fsc->backing_dev_info,
                                                    BLK_RW_ASYNC);
 
+                       if (rc < 0)
+                               SetPageError(page);
+
                        ceph_put_snap_context(page_snap_context(page));
                        page->private = 0;
                        ClearPagePrivate(page);