summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2023-02-28 12:11:38 +0100
committerJan Kara <jack@suse.cz>2023-03-06 16:38:25 +0100
commit63bceed808c5cafbac4e20b5a40012a0ec6c6529 (patch)
tree093c450eee8a0fdc6deab026596bf6247914ebb8 /fs
parentcecb1f06541e12ec68805dbddb2013ee720dfe3d (diff)
downloadlinux-stable-63bceed808c5cafbac4e20b5a40012a0ec6c6529.tar.gz
linux-stable-63bceed808c5cafbac4e20b5a40012a0ec6c6529.tar.bz2
linux-stable-63bceed808c5cafbac4e20b5a40012a0ec6c6529.zip
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 <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r--fs/udf/inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 0cb7d8fba2c8..2210e5eb1ea0 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -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;