When we spot directory corruption when trying to load next directory
extent, we didn't propagate the error up properly, leading to possibly
indefinite looping on corrupted directories. Fix the problem by
propagating the error properly.
Signed-off-by: Jan Kara <jack@suse.cz>
/* Need to fetch next block to get name? */
if (off + udf_dir_entry_len(fi) > blksize) {
fetch_next:
- udf_fiiter_advance_blk(iter);
+ err = udf_fiiter_advance_blk(iter);
+ if (err)
+ goto out_brelse;
iter->bh[1] = udf_fiiter_bread_blk(iter);
if (!iter->bh[1]) {
err = -ENOMEM;
iter->bh[0] = iter->bh[1];
iter->bh[1] = NULL;
} else {
- udf_fiiter_advance_blk(iter);
+ err = udf_fiiter_advance_blk(iter);
+ if (err < 0)
+ return err;
}
}
err = udf_fiiter_load_bhs(iter);