[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4b916314-4d0a-493e-a04a-8148643e600b@kernel.org>
Date: Tue, 20 Aug 2024 09:20:01 +0800
From: Chao Yu <chao@...nel.org>
To: Yeongjin Gil <youngjin.gil@...sung.com>, jaegeuk@...nel.org,
daehojeong@...gle.com
Cc: linux-f2fs-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
Sungjong Seo <sj1557.seo@...sung.com>, Sunmin Jeong
<s_min.jeong@...sung.com>, Jaewook Kim <jw5454.kim@...sung.com>
Subject: Re: [PATCH v2] f2fs: compress: don't redirty sparse cluster during
{,de}compress
On 2024/8/19 16:34, Yeongjin Gil wrote:
> In f2fs_do_write_data_page, when the data block is NULL_ADDR, it skips
> writepage considering that it has been already truncated.
> This results in an infinite loop as the PAGECACHE_TAG_TOWRITE tag is not
> cleared during the writeback process for a compressed file including
> NULL_ADDR in compress_mode=user.
>
> This is the reproduction process:
>
> 1. dd if=/dev/zero bs=4096 count=1024 seek=1024 of=testfile
> 2. f2fs_io compress testfile
> 3. dd if=/dev/zero bs=4096 count=1 conv=notrunc of=testfile
> 4. f2fs_io decompress testfile
>
> To prevent the problem, let's check whether the cluster is fully
> allocated before redirty its pages.
>
> Fixes: 5fdb322ff2c2 ("f2fs: add F2FS_IOC_DECOMPRESS_FILE and F2FS_IOC_COMPRESS_FILE")
> Reviewed-by: Sungjong Seo <sj1557.seo@...sung.com>
> Reviewed-by: Sunmin Jeong <s_min.jeong@...sung.com>
> Tested-by: Jaewook Kim <jw5454.kim@...sung.com>
> Signed-off-by: Yeongjin Gil <youngjin.gil@...sung.com>
Reviewed-by: Chao Yu <chao@...nel.org>
Thanks,
Powered by blists - more mailing lists