Skip to content

Commit 3459bd0

Browse files
lxbszidryomov
authored andcommitted
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 <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 5eed80f commit 3459bd0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/ceph/addr.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,10 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
606606
CEPH_OSD_OP_WRITE, CEPH_OSD_FLAG_WRITE, snapc,
607607
ceph_wbc.truncate_seq, ceph_wbc.truncate_size,
608608
true);
609-
if (IS_ERR(req))
609+
if (IS_ERR(req)) {
610+
redirty_page_for_writepage(wbc, page);
610611
return PTR_ERR(req);
612+
}
611613

612614
set_page_writeback(page);
613615
if (caching)

0 commit comments

Comments
 (0)