Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ceph: redirty the page for writepage on failure

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
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

authored by

Xiubo Li and committed by
Ilya Dryomov
3459bd0c 5eed80fb

+3 -1
+3 -1
fs/ceph/addr.c
··· 606 606 CEPH_OSD_OP_WRITE, CEPH_OSD_FLAG_WRITE, snapc, 607 607 ceph_wbc.truncate_seq, ceph_wbc.truncate_size, 608 608 true); 609 - if (IS_ERR(req)) 609 + if (IS_ERR(req)) { 610 + redirty_page_for_writepage(wbc, page); 610 611 return PTR_ERR(req); 612 + } 611 613 612 614 set_page_writeback(page); 613 615 if (caching)