]> git.dujemihanovic.xyz Git - linux.git/commit
ext4: propagate errors from ext4_sb_bread() in ext4_xattr_block_cache_find()
authorBaokun Li <libaokun1@huawei.com>
Sat, 4 May 2024 07:55:26 +0000 (15:55 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 7 May 2024 19:59:18 +0000 (15:59 -0400)
commitdc1c4663bc493f323d6b2f9dd55c044ea920dacf
tree02a25d49d7318b7e3e97843c826c5f0663b23afb
parent0c0b4a49d3e7f49690a6827a41faeffad5df7e21
ext4: propagate errors from ext4_sb_bread() in ext4_xattr_block_cache_find()

In ext4_xattr_block_cache_find(), when ext4_sb_bread() returns an error,
we will either continue to find the next ea block or return NULL to try to
insert a new ea block. But whether ext4_sb_bread() returns -EIO or -ENOMEM,
the next operation is most likely to fail with the same error. So propagate
the error returned by ext4_sb_bread() to make ext4_xattr_block_set() fail
to reduce pointless operations.

Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20240504075526.2254349-3-libaokun@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/xattr.c