From: Xiubo Li Date: Sun, 24 Apr 2022 09:35:53 +0000 (+0800) Subject: ceph: redirty the page for writepage on failure X-Git-Tag: v6.1-rc5~1179^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3459bd0c55ed28f86a1fd2e01e376492cb6d4f91;p=platform%2Fkernel%2Flinux-starfive.git 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 Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index c25a33d..18956c6 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -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)