All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Christian Göttsche" <cgoettsche@seltendoof.de>
Cc: tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] jbd2: set JBD2_LOADED under j_state_lock
Date: Mon, 28 Sep 2026 20:29:33 +0000	[thread overview]
Message-ID: <20260928202934.1B3831F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260928202159.2463182-1-cgoettsche@seltendoof.de>

> From: Christian Göttsche <cgzones@googlemail.com>
> 
> j_flags is protected by j_state_lock, with only quick racy checks done
> without it.  jbd2_journal_load() however sets JBD2_LOADED with a plain
> read-modify-write after journal_reset() has already started kjournald2,
> which tests and may update j_flags under the lock.  KCSAN reports this
> while mounting the root file system:
> 
>   BUG: KCSAN: data-race in jbd2_journal_load / kjournald2
> 
>   write to 0xffff9c6b012c6000 of 8 bytes by task 1 on cpu 3:
>    jbd2_journal_load+0x279/0x3c0
>    ext4_fill_super+0x34dc/0x5740
>    get_tree_bdev_flags+0x21d/0x340
>    ...
>   read to 0xffff9c6b012c6000 of 8 bytes by task 77 on cpu 0:
>    kjournald2+0xc8/0x3e0
>    kthread+0x1bd/0x200
>    ...
> 
>   value changed: 0x00000000000000a8 -> 0x00000000000000b8
> 
> A concurrent update of another flag, e.g. JBD2_ABORT, could be lost.
> Take j_state_lock when setting JBD2_LOADED, like the other writers of
> j_flags do.
> 
> Fixes: 470decc613ab ("[PATCH] jbd2: initial copy of files from jbd")
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260928202159.2463182-1-cgoettsche@seltendoof.de?part=1


  reply	other threads:[~2026-09-28 20:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 20:21 [PATCH] jbd2: set JBD2_LOADED under j_state_lock Christian Göttsche
2026-09-28 20:29 ` sashiko-bot [this message]
2026-09-30 11:34 ` Jan Kara

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=20260928202934.1B3831F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=cgoettsche@seltendoof.de \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.