Re: [PATCH v3 03/22] ext4: simplify error handling in ext4_setattr()
From: Zhang Yi
Date: Fri May 08 2026 - 04:49:16 EST
On 4/30/2026 9:03 PM, Jan Kara wrote:
> 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().
Yeah, I got it, will fix.
Thanks,
Yi.
>
>> filemap_invalidate_unlock(inode->i_mapping);
>> goto err_out;
>> }
>
> Honza