Skip to content

Commit 63bceed

Browse files
committed
udf: Warn if block mapping is done for in-ICB files
Now that address space operations are merge dfor in-ICB and normal files, it is more likely some code mistakenly tries to map blocks for in-ICB files. WARN and return error instead of silently returning garbage. Signed-off-by: Jan Kara <[email protected]>
1 parent cecb1f0 commit 63bceed

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/udf/inode.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,9 @@ static int udf_map_block(struct inode *inode, struct udf_map_rq *map)
416416
int err;
417417
struct udf_inode_info *iinfo = UDF_I(inode);
418418

419+
if (WARN_ON_ONCE(iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB))
420+
return -EFSCORRUPTED;
421+
419422
map->oflags = 0;
420423
if (!(map->iflags & UDF_MAP_CREATE)) {
421424
struct kernel_lb_addr eloc;

0 commit comments

Comments
 (0)