diff options
author | Xiubo Li <xiubli@redhat.com> | 2022-04-24 17:35:53 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2022-05-25 20:45:14 +0200 |
commit | 3459bd0c55ed28f86a1fd2e01e376492cb6d4f91 (patch) | |
tree | 520116252ba66279f53d9fc3854a3ba64920bc20 /fs/ceph | |
parent | 5eed80fba65cd707075892450bc5d6bd464862a0 (diff) | |
download | linux-stable-3459bd0c55ed28f86a1fd2e01e376492cb6d4f91.tar.gz linux-stable-3459bd0c55ed28f86a1fd2e01e376492cb6d4f91.tar.bz2 linux-stable-3459bd0c55ed28f86a1fd2e01e376492cb6d4f91.zip |
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>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/addr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index c25a33dd6284..18956c629ad4 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) |