From: Christoph Hellwig Date: Wed, 18 Jan 2023 17:30:27 +0000 (+0100) Subject: ocfs2: don't use write_one_page in ocfs2_duplicate_clusters_by_page X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8e4bfd136410df75c915fb462914b36e6e5fdfc0;p=linux.git ocfs2: don't use write_one_page in ocfs2_duplicate_clusters_by_page Use filemap_write_and_wait_range to write back the range of the dirty page instead of write_one_page in preparation of removing write_one_page and eventually ->writepage. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Joseph Qi Signed-off-by: Al Viro --- diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 5a656dc683f10..564ab48d03eff 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -2952,10 +2952,11 @@ retry: */ if (PAGE_SIZE <= OCFS2_SB(sb)->s_clustersize) { if (PageDirty(page)) { - /* - * write_on_page will unlock the page on return - */ - ret = write_one_page(page); + unlock_page(page); + put_page(page); + + ret = filemap_write_and_wait_range(mapping, + offset, map_end - 1); goto retry; } }