]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ceph: redirty the page for wirtepage if fails
authorXiubo Li <xiubli@redhat.com>
Sun, 24 Apr 2022 09:35:53 +0000 (17:35 +0800)
committerXiubo Li <xiubli@redhat.com>
Tue, 26 Apr 2022 01:22:55 +0000 (09:22 +0800)
When run out of memories we should redirty the page before failing
the writepage. Or we will hit BUG_ON(folio_get_private(folio)) in
ceph_dirty_folio().

URL: https://tracker.ceph.com/issues/55421
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
fs/ceph/addr.c

index 261bc8bb2ab87faa4ba728a456a1338b2206a65c..656bc0ca7a78393a9868f67b69bb6d8482cc3ebe 100644 (file)
@@ -606,8 +606,10 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
                                    CEPH_OSD_OP_WRITE, CEPH_OSD_FLAG_WRITE, snapc,
                                    ceph_wbc.truncate_seq, ceph_wbc.truncate_size,
                                    true);
-       if (IS_ERR(req))
+       if (IS_ERR(req)) {
+               redirty_page_for_writepage(wbc, page);
                return PTR_ERR(req);
+       }
 
        set_page_writeback(page);
        if (caching)