Skip to content

Commit

Permalink
udf: Warn if block mapping is done for in-ICB files
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jankara committed Mar 6, 2023
1 parent cecb1f0 commit 63bceed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/udf/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ static int udf_map_block(struct inode *inode, struct udf_map_rq *map)
int err;
struct udf_inode_info *iinfo = UDF_I(inode);

if (WARN_ON_ONCE(iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB))
return -EFSCORRUPTED;

map->oflags = 0;
if (!(map->iflags & UDF_MAP_CREATE)) {
struct kernel_lb_addr eloc;
Expand Down

0 comments on commit 63bceed

Please sign in to comment.