Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Brahmajit Das" <listout@listout.xyz>, "David Sterba" <dsterba@suse.com>
Cc: "Qu Wenruo" <quwenruo.btrfs@gmx.com>,
	"Chris Mason" <mason@kernel.org>,
	"David Hildenbrand" <david@kernel.org>,
	"Jason Gunthorpe" <jgg@nvidia.com>,
	"John Hubbard" <jhubbard@nvidia.com>,
	"Peter Xu" <peterx@redhat.com>,
	linux-mm@kvack.org, syzkaller-bugs@googlegroups.com,
	syzbot+d6f123d4060990f0f3ff@syzkaller.appspotmail.com,
	"Brahmajit Das" <bdas@suse.de>,
	dsterba@suse.cz
Subject: Re: [PATCH v3 2/3] btrfs: sync the uptodate bitmap when attaching a data folio state
Date: Fri, 04 Dec 2026 13:31:42 +0000	[thread overview]
Message-ID: <sashiko-outbox-249871@kernel.org> (raw)
In-Reply-To: <20261203133059.2193197-3-listout@listout.xyz>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] btrfs: missing Fixes trailer for commit 32443de3382b on bug-fix
  commit
--

commit b3bb4956ce3e9cdfe71173ad7ce6b4ae18b1f506
Author: Brahmajit Das <bdas@suse.de>

> btrfs: sync the uptodate bitmap when attaching a data folio state
>
> A data folio can lose its private while it stays in the page cache, e.g.
> btrfs_release_folio() from a partial invalidation, or from a large folio
> split that then fails.  Such a folio was only released, not invalidated,
> so it can still be uptodate.
>
> When something calls set_folio_extent_mapped() on it again, such as
> prepare_one_folio(), btrfs_page_mkwrite() or btrfs_truncate_block(), a
> new btrfs_folio_state is attached with empty bitmaps, while PG_uptodate
> is still set on the folio.  Those callers see an uptodate folio, skip
> reading it, and only update the uptodate bits of their own range.  The
> other blocks are left marked not uptodate in the subpage bitmap.
>
> That can trip the ASSERT() in can_skip_one_ordered_range(), which
> expects the whole range up to the ordered extent end or folio end to be
> uptodate if its first block is.
>
> Fix it by setting the uptodate bitmap in btrfs_attach_folio_state() if
> the data folio is uptodate.  On the read path, private is attached
> before the folio is uptodate, so nothing changes there.
>
> Note: this was only build tested.
>
> This patch was written with the help of an AI coding assistant (Claude),
> following a review comment from Sashiko AI review.
>
> Signed-off-by: Brahmajit Das <bdas@suse.de>

[Severity: Low]
This fixes a bug in subpage data folio state re-attachment.  Should this
include:

  Fixes: 32443de3382b ("btrfs: introduce btrfs_subpage for data inodes")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203133059.2193197-1-listout@listout.xyz?part=2


  parent reply	other threads:[~2026-12-04 13:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6ab2d179.e8212013.2d060.0001.GAE@google.com>
2026-12-03 13:30 ` [PATCH v3 0/3] btrfs: fix dirtying of folios that lost their private Brahmajit Das
2026-12-03 13:30   ` [PATCH v3 1/3] btrfs: don't dereference a missing folio private on writeback error Brahmajit Das
2026-12-03 13:30   ` [PATCH v3 2/3] btrfs: sync the uptodate bitmap when attaching a data folio state Brahmajit Das
2026-12-03 20:36     ` Qu Wenruo
2026-12-04 13:31     ` sashiko-bot [this message]
2026-12-03 13:30   ` [PATCH v3 3/3] btrfs: re-attach folio private when a released folio gets dirtied Brahmajit Das
2026-12-03 20:36     ` Qu Wenruo
2026-12-04  6:36       ` Brahmajit Das
2026-12-04 13:31     ` sashiko-bot
2026-12-04  6:32   ` [PATCH v4 0/2] btrfs: fix dirtying of folios that lost their private listout
2026-12-04  6:32     ` [PATCH v4 1/2] btrfs: don't dereference a missing folio private on writeback error listout
2026-12-04  7:54       ` Qu Wenruo
2026-12-04  6:32     ` [PATCH v4 2/2] btrfs: re-attach folio private when a released folio gets dirtied listout
2026-12-04  7:52       ` Qu Wenruo

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=sashiko-outbox-249871@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bdas@suse.de \
    --cc=david@kernel.org \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=jgg@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-mm@kvack.org \
    --cc=listout@listout.xyz \
    --cc=mason@kernel.org \
    --cc=peterx@redhat.com \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=syzbot+d6f123d4060990f0f3ff@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