summaryrefslogtreecommitdiffstats
path: root/fs/udf/super.c
diff options
context:
space:
mode:
authorZhao Mengmeng <zhaomengmeng@kylinos.cn>2024-10-01 13:54:24 +0200
committerJan Kara <jack@suse.cz>2024-10-02 14:10:50 +0200
commitb405c1e58b73981da0f8df03b00666b22b9397ae (patch)
tree70894d7f47122bfa41ce5ec4efbe54f7fff00816 /fs/udf/super.c
parentudf: refactor udf_current_aext() to handle error (diff)
downloadlinux-b405c1e58b73981da0f8df03b00666b22b9397ae.tar.xz
linux-b405c1e58b73981da0f8df03b00666b22b9397ae.zip
udf: refactor udf_next_aext() to handle error
Since udf_current_aext() has error handling, udf_next_aext() should have error handling too. Besides, when too many indirect extents found in one inode, return -EFSCORRUPTED; when reading block failed, return -EIO. Signed-off-by: Zhao Mengmeng <zhaomengmeng@kylinos.cn> Suggested-by: Jan Kara <jack@suse.cz> Signed-off-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20241001115425.266556-3-zhaomzhao@126.com
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r--fs/udf/super.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 3460ecc826d1..1c8a736b3309 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -2482,13 +2482,14 @@ static unsigned int udf_count_free_table(struct super_block *sb,
uint32_t elen;
struct kernel_lb_addr eloc;
struct extent_position epos;
+ int8_t etype;
mutex_lock(&UDF_SB(sb)->s_alloc_mutex);
epos.block = UDF_I(table)->i_location;
epos.offset = sizeof(struct unallocSpaceEntry);
epos.bh = NULL;
- while (udf_next_aext(table, &epos, &eloc, &elen, 1) != -1)
+ while (udf_next_aext(table, &epos, &eloc, &elen, &etype, 1) > 0)
accum += (elen >> table->i_sb->s_blocksize_bits);
brelse(epos.bh);