From: Krystian Kaniewski <krystianmkaniewski@gmail.com>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
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 16:01:31 +0200 [thread overview]
Message-ID: <f9b27432-4104-4323-8cd7-e2cda73db2f9@gmail.com> (raw)
In-Reply-To: <87cxt921rc.fsf@mail.parknet.co.jp>
On 10/16/26 15:50, OGAWA Hirofumi wrote:
> 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.
Thanks. I was trying to handle transient errors here. The old entry still exists at this point, so if the read and removal succeed, the rename can be fully rolled back.
In my tests with a single injected write error, giving up left the new entry pointing at the root directory, and fsck.fat wanted to remove it. Retrying the cleanup left the filesystem clean. If either the read or the cleanup write fails, we stop and report corruption anyway.
Do you still think we should give up here? If you prefer not to retry the new-entry block after its failed write, should we also avoid rereading and rewriting dotdot_bh after a failed .. update?
--
Krystian Kaniewski
next prev parent reply other threads:[~2026-10-16 14:01 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
2026-10-16 14:01 ` Krystian Kaniewski [this message]
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=f9b27432-4104-4323-8cd7-e2cda73db2f9@gmail.com \
--to=krystianmkaniewski@gmail.com \
--cc=hirofumi@mail.parknet.co.jp \
--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
all inboxes | Powered by JetHome®