summaryrefslogtreecommitdiffstats
path: root/fs/udf
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2023-01-24 12:16:38 +0100
committerJan Kara <jack@suse.cz>2023-01-26 16:46:36 +0100
commit907c6c2ffa6a6d28f59db22ac0686ca3103c61d8 (patch)
tree55d54be37456a45fa53f001e83109ad7a680d285 /fs/udf
parentc694e40ba231e854fcddd25cce46db3918fca291 (diff)
downloadlinux-stable-907c6c2ffa6a6d28f59db22ac0686ca3103c61d8.tar.gz
linux-stable-907c6c2ffa6a6d28f59db22ac0686ca3103c61d8.tar.bz2
linux-stable-907c6c2ffa6a6d28f59db22ac0686ca3103c61d8.zip
udf: Add handling of in-ICB files to udf_bmap()
Add detection of in-ICB files to udf_bmap() and return error in that case. This will allow us o use single address_space_operations in UDF. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 094ac6f22c72..c65a5d76d15a 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -296,6 +296,10 @@ ssize_t udf_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
static sector_t udf_bmap(struct address_space *mapping, sector_t block)
{
+ struct udf_inode_info *iinfo = UDF_I(mapping->host);
+
+ if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
+ return -EINVAL;
return generic_block_bmap(mapping, block, udf_get_block);
}