On 4/24/25 00:15, Dmitry Antipov wrote:
> In 'f2fs_write_end_io()', end all of the in-progress writes with
> -EFSCORRUPTED if the corresponding error was detected earlier.
>
> Reported-by: [email protected]
> Closes: https://syzkaller.appspot.com/bug?extid=803dd716c4310d16ff3a
> Signed-off-by: Dmitry Antipov <[email protected]>
> ---
> fs/f2fs/data.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 54f89f0ee69b..755806868f0e 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -320,9 +320,11 @@ static void f2fs_write_end_io(struct bio *bio)
> {
> struct f2fs_sb_info *sbi;
> struct folio_iter fi;
> + bool check;
>
> iostat_update_and_unbind_ctx(bio);
> sbi = bio->bi_private;
> + check = is_sbi_flag_set(sbi, SBI_NEED_FSCK);
>
> if (time_to_inject(sbi, FAULT_WRITE_IO))
> bio->bi_status = BLK_STS_IOERR;
> @@ -331,6 +333,11 @@ static void f2fs_write_end_io(struct bio *bio)
> struct folio *folio = fi.folio;
> enum count_type type;
>
> + if (check) {
> + mapping_set_error(folio->mapping, -EFSCORRUPTED);
> + continue;
Backing to the implementation, it seems it won't release resources
below, e.g. missed to call:
- fscrypt_free_bounce_page()
- f2fs_compress_write_end_io()
...
- folio_end_writeback()
I guess it may hang kernel w/ this patch? Or any thing I missed?
Thanks,
> + }
> +
> if (fscrypt_is_bounce_folio(folio)) {
> struct folio *io_folio = folio;
>
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel