Re: [PATCH v3 03/22] ext4: simplify error handling in ext4_setattr()
From: Jan Kara
Date: Thu Apr 30 2026 - 09:08:33 EST
On Wed 22-04-26 10:10:23, Zhang Yi wrote:
> From: Zhang Yi <yi.zhang@xxxxxxxxxx>
>
> Remove the redundant rc variable and consolidate error handling.
>
> Signed-off-by: Zhang Yi <yi.zhang@xxxxxxxxxx>
One comment below. Otherwise the changes look good.
> @@ -6073,8 +6073,8 @@ int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
>
> filemap_invalidate_lock(inode->i_mapping);
>
> - rc = ext4_break_layouts(inode);
> - if (rc) {
> + error = ext4_break_layouts(inode);
> + if (error) {
This is wrong. Errors from ext4_break_layouts() just need to be returned
but they shouldn't be logged with ext4_std_error().
> filemap_invalidate_unlock(inode->i_mapping);
> goto err_out;
> }
Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR