mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthias Goergens <matthias.goergens@gmail.com>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: linux-kernel@vger.kernel.org,
	syzbot+018e6f695ad9bccb182a@syzkaller.appspotmail.com,
	syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] fat: serialize primary and mirror updates
Date: Mon,  2 Nov 2026 16:03:22 +0800	[thread overview]
Message-ID: <20261102080322.1466478-1-matthias.goergens@gmail.com> (raw)
In-Reply-To: <87tsm25wm4.fsf@mail.parknet.co.jp>

OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> writes:

> What is the real issue?

Only the data race syzbot reports, "KCSAN: data-race in fat16_ent_put /
fat_mirror_bhs": fat_mirror_bhs() copies a FAT block to the backup FAT
while another task updates an entry in that block.  I have not found any
effect on disk.  fat_mirror_bhs() holds the backup buffer's lock across
the copy, and every writer mirrors the block again after its own update,
so a copy that caught an entry mid-update is replaced by that writer's
copy.  The commit message should have said so, and the patch also lacked
my Signed-off-by: it went out before it was ready, sorry.

That leaves two ways to deal with the report.  Would you prefer marking
the copy as an intended race, data_race() around the memcpy() with a
comment on why it is harmless?  Or the locking in this patch, which
holds fat_lock across fat_sync_bhs() for synchronous inodes and so
makes other allocations wait for that I/O?

Matthias

  reply	other threads:[~2026-11-02  8:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31  3:32 Matthias Goergens
2026-10-31  4:20 ` OGAWA Hirofumi
2026-11-02  8:03   ` Matthias Goergens [this message]
2026-11-02  9:33     ` 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=20261102080322.1466478-1-matthias.goergens@gmail.com \
    --to=matthias.goergens@gmail.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+018e6f695ad9bccb182a@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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®