udf: Add handling of in-ICB files to udf_bmap()
authorJan Kara <jack@suse.cz>
Tue, 24 Jan 2023 11:16:38 +0000 (12:16 +0100)
committerJan Kara <jack@suse.cz>
Thu, 26 Jan 2023 15:46:36 +0000 (16:46 +0100)
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>
fs/udf/inode.c

index 094ac6f22c72eaa1b89cea63e609c5f2238762e3..c65a5d76d15a21114c27b64fda6aaa6079b3424c 100644 (file)
@@ -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);
 }