From: sashiko-bot@kernel.org
To: "Chandradhar Kumar" <chandradhar.2003@gmail.com>,
linux-ext4@vger.kernel.org
Cc: tytso@mit.edu
Subject: Re: [PATCH] ext4: wait for tail page commit in ext4_truncate_failed_write()
Date: Thu, 12 Nov 2026 13:02:59 +0000 [thread overview]
Message-ID: <sashiko-outbox-211134@kernel.org> (raw)
In-Reply-To: <20261112124835.114888-1-chandradhar.2003@gmail.com>
> When a buffered write fails partially (e.g., due to a user page fault)
> on an ext4 filesystem mounted in data=journal mode with blocksize <
> PAGE_SIZE, ext4_journalled_write_end() invokes ext4_truncate_failed_write()
> to discard newly allocated blocks beyond inode->i_size.
>
> If the updated inode->i_size straddles a folio whose buffers are currently
> being committed to the journal, truncate_inode_pages() attempts to
> partially invalidate that folio via ext4_journalled_invalidate_folio().
> Because JBD2 cannot unmap buffers belonging to a committing transaction
> on a partial folio, journal_unmap_buffer() returns -EBUSY, triggering
> the WARN_ON() in ext4_journalled_invalidate_folio().
>
> Unlike the standard truncate path in ext4_truncate_down(),
> ext4_truncate_failed_write() does not wait for the committing
> transaction on the tail page to finish before truncating the page cache.
> Export ext4_wait_for_tail_page_commit() and call it in
> ext4_truncate_failed_write() when data=journal is enabled before
> acquiring filemap_invalidate_lock() and calling truncate_inode_pages().
>
> Fixes: 53e872681fed ("ext4: fix deadlock in journal_unmap_buffer()")
> Reported-by: syzbot+f111db4cb2acd44eb2f4@syzkaller.appspotmail.com
> Closes: https://syzbot.org/bug?extid=f111db4cb2acd44eb2f4
> Signed-off-by: Chandradhar Kumar <chandradhar.2003@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261112124835.114888-1-chandradhar.2003@gmail.com?part=1
prev parent reply other threads:[~2026-11-12 13:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 12:48 [PATCH] ext4: wait for tail page commit in ext4_truncate_failed_write() Chandradhar Kumar
2026-11-12 13:02 ` sashiko-bot [this message]
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-211134@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=chandradhar.2003@gmail.com \
--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.