Linux filesystem development
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Krystian Kaniewski <krystianmkaniewski@gmail.com>
Cc: linux-kernel@vger.kernel.org,  linux-fsdevel@vger.kernel.org,
	syzbot+b0aebd03565f5774f7f8@syzkaller.appspotmail.com
Subject: Re: [PATCH v3] fat: make rename recovery safe after metadata write errors
Date: Fri, 16 Oct 2026 22:50:15 +0900	[thread overview]
Message-ID: <87cxt921rc.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <55a1f016-a7a2-469f-b481-37223d695f29@gmail.com>

Krystian Kaniewski <krystianmkaniewski@gmail.com> writes:

> On 10/15/26 20:54, OGAWA Hirofumi wrote:
>
>>> +	} else if (!rollback_err) {
>>> +		/* Read the entry block again if a failed write invalidated it. */
>>> +		rollback_err = bh_read(sinfo.bh, 0);
>> 
>> Why do this read the bh from on disk?
>> 
>
> The bh_read(sinfo.bh, 0) is needed because a failed inode-position write clears BH_Uptodate. fat_remove_entries() modifies and dirties that retained buffer directly, which otherwise triggers the warning. Reading it first refreshes the whole block. If the read fails, the buffer is left untouched.
>
> The same reasoning applies to both the VFAT and MS-DOS paths.

If sinfo.bh is required to read because of failure of I/O error, I guess
the bh will fail to write again. I think we should give up to rollback
in that case.

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

  reply	other threads:[~2026-10-16 13:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 16:38 [syzbot] [exfat?] WARNING in vfat_update_dotdot_de syzbot
2026-09-29  9:00 ` [PATCH] fat: validate dotdot buffers in VFAT and MSDOS rename and rollback Krystian Kaniewski
2026-09-30  8:02   ` OGAWA Hirofumi
2026-09-30 12:17     ` Krystian Kaniewski
2026-10-02 13:43     ` [PATCH v2] fat: skip rename rollback on buffers with failed I/O Krystian Kaniewski
2026-10-11 18:36       ` OGAWA Hirofumi
2026-10-14  8:21         ` Krystian Kaniewski
2026-10-14  8:23         ` [PATCH v3] fat: make rename recovery safe after metadata write errors Krystian Kaniewski
2026-10-15 18:54           ` OGAWA Hirofumi
2026-10-16 13:30             ` Krystian Kaniewski
2026-10-16 13:50               ` OGAWA Hirofumi [this message]
2026-10-16 14:01                 ` Krystian Kaniewski
2026-10-16 15:23                   ` OGAWA Hirofumi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cxt921rc.fsf@mail.parknet.co.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=krystianmkaniewski@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+b0aebd03565f5774f7f8@syzkaller.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox