Skip to content

Commit 46116f5

Browse files
yghikungregkh
authored andcommitted
ext4: clear error before retrying inode xattr space fallback
commit 409a7f1 upstream. When ext4_xattr_make_inode_space() returns -ENOSPC, ext4_expand_extra_isize_ea() can retry the expansion with s_min_extra_isize. If that retry succeeds by finding enough ibody free space, control jumps directly to the shift label. The previous -ENOSPC is still stored in error in that path, so the function can update i_extra_isize but still return -ENOSPC to the caller. Clear error before retrying so a successful fallback expansion returns success. Reproduced with an ext4 image using 1 KiB blocks, project quota support, 256-byte inodes, and min_extra_isize/want_extra_isize set to 32. FS_IOC_FSSETXATTR failures dropped from 802 to 86 after the fix. Fixes: 69f3a30 ("ext4: introduce ITAIL helper") Cc: stable@vger.kernel.org Signed-off-by: Guanghui Yang <3497809730@qq.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/tencent_192F8A699EFD21126E02101131C9546F3C08@qq.com Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a40c452 commit 46116f5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/ext4/xattr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2836,6 +2836,7 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
28362836
s_min_extra_isize) {
28372837
tried_min_extra_isize++;
28382838
new_extra_isize = s_min_extra_isize;
2839+
error = 0;
28392840
goto retry;
28402841
}
28412842
goto cleanup;

0 commit comments

Comments
 (0)