From: sashiko-bot@kernel.org
To: "Matthias Goergens" <matthias.goergens@gmail.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH] ext4: compensate ea_inode refs and free block on new xattr block write error
Date: Mon, 17 Aug 2026 10:07:24 +0000 [thread overview]
Message-ID: <20260817100724.923291F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260817095421.1171145-1-matthias.goergens@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The patch introduces calls to `mb_cache_entry_delete_or_get()` and `mb_cache_entry_wait_unused()`, which are not defined anywhere in the Linux kernel codebase. This will cause compilation and linking failures due to implicit function declarations and undefined symbols.
--
--- Patch [1]: [PATCH] ext4: compensate ea_inode refs and free block on new xattr block write error ---
commit 867eb1668b3595297e1515877804d2ee15fc4038
Author: Matthias Goergens <matthias.goergens@gmail.com>
ext4: compensate ea_inode refs and free block on new xattr block write error
This commit adds error handling in ext4_xattr_block_set() to properly revert
the on-disk reference counts and free the newly allocated xattr block if
metadata dirtying fails. It introduces ext4_xattr_new_block_fail() to handle
mbcache cleanup, block freeing, and quota release.
Link: https://lore.kernel.org/linux-ext4/20260814070432.595B91F00A3A@smtp.kernel.org/
> diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
> index 6127e94ea4f5d..f49d1e74e3214 100644
> --- a/fs/ext4/xattr.c
> +++ b/fs/ext4/xattr.c
[ ... ]
> @@ -1299,6 +1299,63 @@ ext4_xattr_release_block(handle_t *handle, struct inode *inode,
> return;
> }
>
> +/*
> + * Undo the setup of a new xattr block that failed to be written out: drop
> + * the ext4_xattr_inode_inc_ref_all() references, free the block, and
> + * release the quota this operation charged for the new value (quota_len,
> + * zero when the value is not in an EA inode).
> + */
> +static void ext4_xattr_new_block_fail(handle_t *handle, struct inode *inode,
> + struct buffer_head *new_bh,
> + size_t quota_len, int error)
> +{
[ ... ]
> + lock_buffer(new_bh);
> +retry_owner:
> + if (le32_to_cpu(BHDR(new_bh)->h_refcount) != 1) {
> + unlock_buffer(new_bh);
> + return;
> + }
> + if (ea_block_cache) {
> + oe = mb_cache_entry_delete_or_get(ea_block_cache,
> + le32_to_cpu(BHDR(new_bh)->h_hash),
> + new_bh->b_blocknr);
> + if (oe) {
> + unlock_buffer(new_bh);
> + mb_cache_entry_wait_unused(oe);
[Severity: Low]
Are mb_cache_entry_delete_or_get() and mb_cache_entry_wait_unused() defined
anywhere in the kernel codebase?
Building the kernel with EXT4 support enabled will likely fail to compile
or link because these required mbcache functions appear to be missing.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260817095421.1171145-1-matthias.goergens@gmail.com?part=1
next prev parent reply other threads:[~2026-08-17 10:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 4:45 [PATCH 1/1] ext4: drop extra ea_inode ref in cached-block reuse path Matthias Goergens
2026-08-12 5:05 ` sashiko-bot
2026-08-14 6:50 ` [PATCH v2] " Matthias Goergens
2026-08-14 7:04 ` sashiko-bot
2026-08-17 9:54 ` [PATCH] ext4: compensate ea_inode refs and free block on new xattr block write error Matthias Goergens
2026-08-17 10:07 ` sashiko-bot [this message]
2026-08-17 11:49 ` Matthias Goergens
2026-08-17 15:29 ` [PATCH] ext4: compensate ea_inode refs and free block on new xattr block write error\ Theodore Tso
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=20260817100724.923291F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=matthias.goergens@gmail.com \
--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.