On Wed, Jun 08, 2022 at 09:48:52PM +0800, Fengnan Chang wrote: > When decompressed failed, f2fs_prepare_compress_overwrite will enter > endless loop, may casue hungtask. > > [ 14.088665] F2FS-fs (nvme0n1): lz4 decompress failed, ret:-4155 > [ 14.089851] F2FS-fs (nvme0n1): lz4 decompress failed, ret:-4155 > > Signed-off-by: Fengnan Chang <fengnanch...@gmail.com>
This commit message only explains the problem, not the solution. It should explain the solution too. Also, if it's fixing a bug, it needs 'Fixes' and 'Cc stable' tags. > diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c > index 24824cd96f36..1764e3859262 100644 > --- a/fs/f2fs/compress.c > +++ b/fs/f2fs/compress.c > @@ -1060,7 +1060,7 @@ static int prepare_compress_overwrite(struct > compress_ctx *cc, > sector_t last_block_in_bio; > unsigned fgp_flag = FGP_LOCK | FGP_WRITE | FGP_CREAT; > pgoff_t start_idx = start_idx_of_cluster(cc); > - int i, ret; > + int i, ret, retry_count = 3; > > retry: > ret = f2fs_is_compressed_cluster(cc->inode, start_idx); > @@ -1120,7 +1120,12 @@ static int prepare_compress_overwrite(struct > compress_ctx *cc, > f2fs_put_rpages(cc); > f2fs_unlock_rpages(cc, i + 1); > f2fs_destroy_compress_ctx(cc, true); > - goto retry; > + retry_count--; > + if (PageError(page) && !retry_count) { > + ret = -EIO; > + goto out; > + } else What is the purpose of using PG_error here? - Eric _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel