[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <874itk20j2.fsf@mail.parknet.co.jp>
Date: Wed, 03 Sep 2025 03:05:05 +0900
From: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To: YangWen <anmuxixixi@...il.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fat: fix data-race between fat12_ent_put() and
fat_mirror_bhs()
YangWen <anmuxixixi@...il.com> writes:
> Hi,
>
> OGAWA Hirofumi wrote:
>> You are forgetting what I said first. I said, this should be temporary
>> inconsistent. When unmount, temporary inconsistent should be fixed by
>> later write out.
>>
>> IOW, I can't see why you claim this race can be the cause of permanent
>> inconsistent.
>
> I don’t have a reproducer showing a permanent corruption
> after a clean unmount. My concern came only from KCSAN reports under
> syzkaller, and then I tried to reason from the code.
>
> In particular, in fat_mirror_bhs() there is a path:
>
> if (sb->s_flags & SB_SYNCHRONOUS)
> err = sync_dirty_buffer(c_bh);
>
> So with -o sync mount, if memcpy() observes a half-updated FAT12 entry,
> the torn value in the backup FAT buffer could be immediately written to
> disk. In that case, even though the primary FAT is later corrected, the
> backup FAT might persist inconsistent content.
Sync mount doesn't try to keep all of consistency. It is trying to keep
sync the minimum blocks for consistency. The primary should be always
consistent, however this doesn't care much about mirror FAT.
Thanks.
--
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Powered by blists - more mailing lists