diff mbox series

[06/10] udf: Add handling of in-ICB files to udf_bmap()

Message ID 20230124120628.24449-6-jack@suse.cz (mailing list archive)
State New, archived
Headers show
Series udf: Unify aops | expand

Commit Message

Jan Kara Jan. 24, 2023, 12:06 p.m. UTC
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.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/udf/inode.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Christoph Hellwig Jan. 24, 2023, 1:27 p.m. UTC | #1
On Tue, Jan 24, 2023 at 01:06:17PM +0100, Jan Kara wrote:
> 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.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 91758c8d77e5..703db2a4516b 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);
 }