erofs: fix missing continue for !shouldalloc in z_erofs_bind_cache()
Yue Hu
reviewerPATCH 1/1 erofs: fix missing continue for !shouldalloc in z_erofs_bind_cache()
From: Yue Hu <[email protected]>
Do cmpxchg_relaxed() is only for successful allocation if I/O is needed.
Fixes 69b511baa0be ("erofs: clean up cached I/O strategies")
Signed-off-by Yue Hu <[email protected]>
--- fs/erofs/zdata.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
fs/erofs/zdata.c +13 -13
@@ -333,19 +333,19 @@ static void z_erofs_bind_cache(struct z_erofs_decompress_frontend *fe, } else {/* I/O is needed, no possible to decompress directly */ standalone = false; -if (shouldalloc) { -/* -* try to use cached I/O if page allocation -* succeeds or fallback to in-place I/O instead -* to avoid any direct reclaim. -*/ - newpage =erofs_allocpage (pagepool, gfp); -if (!newpage) -continue ; -set_page_private (newpage, -Z_EROFS_PREALLOCATED_PAGE ); - t =tag_compressed_page_justfound (newpage); - } +if (!shouldalloc) +continue ; + +/* +* try to use cached I/O if page allocation +* succeeds or fallback to in-place I/O instead +* to avoid any direct reclaim. +*/ + newpage =erofs_allocpage (pagepool, gfp); +if (!newpage) +continue ; +set_page_private (newpage,Z_EROFS_PREALLOCATED_PAGE ); + t =tag_compressed_page_justfound (newpage); } if (!cmpxchg_relaxed(&pcl->compressed_bvecs[i].page, NULL,
Signature · 1 line
2.17.1
Gao Xiang
maintainerHi Yue,
Quoted 6 lines · Yue Hu
From: Yue Hu <[email protected]>
Do
cmpxchg_relaxed()is only for successful allocation if I/O is needed.Fixes 69b511baa0be ("erofs: clean up cached I/O strategies")Signed-off-by Yue Hu <[email protected]>
Thanks for the catch, it looks good to me.
Let's fold this into the original patch.
Thanks,
Gao Xiang