From bd904f3c74969442b0ac42f81c0d02da54cd47eb Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Wed, 18 Jan 2023 13:55:31 +0100 Subject: udf: Unify types in anchor block detection When detecting last recorded block and from it derived anchor block position, we were mixing unsigned long, u32, and sector_t types. Since udf supports only 32-bit block numbers this is harmless but sometimes makes things awkward. Convert everything to udf_pblk_t and also handle the situation when block device size would not fit into udf_pblk_t. Signed-off-by: Jan Kara --- fs/udf/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/udf/super.c') diff --git a/fs/udf/super.c b/fs/udf/super.c index 241b40e886b3..c756d903a862 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -1861,10 +1861,10 @@ static int udf_check_anchor_block(struct super_block *sb, sector_t block, * Returns < 0 on error, 0 on success. -EAGAIN is special - try next set * of anchors. */ -static int udf_scan_anchors(struct super_block *sb, sector_t *lastblock, +static int udf_scan_anchors(struct super_block *sb, udf_pblk_t *lastblock, struct kernel_lb_addr *fileset) { - sector_t last[6]; + udf_pblk_t last[6]; int i; struct udf_sb_info *sbi = UDF_SB(sb); int last_count = 0; -- cgit v1.2.3-73-gaa49b