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 <[email protected]>
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/[email protected]/
> 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/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.