[PATCH] erofs-utils: mount: fix type mismatches causing compilation errors

Gao Xiang hsiangkao at linux.alibaba.com
Wed Dec 17 19:07:11 AEDT 2025


In file included from ../include/erofs/config.h:15,
                 from main.c:14:
main.c: In function ‘erofsmount_tarindex_pread’:
../include/erofs/defs.h:148:24: error: comparison of distinct pointer types lacks a cast [-Werror]
  148 |         (void) (&_min1 == &_min2);              \
      |                        ^~
main.c:380:30: note: in expansion of macro ‘min’
  380 |                 index_part = min(count, tp->tarindex_size - offset);
      |                              ^~~

Fixes: da1fb2864fbb ("erofs-utils: mount: add support for standard OCI targz blob access")
Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
---
 mount/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mount/main.c b/mount/main.c
index e25134caf10a..de39727d6eed 100644
--- a/mount/main.c
+++ b/mount/main.c
@@ -376,7 +376,7 @@ static ssize_t erofsmount_tarindex_pread(struct erofs_vfile *vf, void *buf,
 		remote_offset = offset - tp->tarindex_size;
 		index_part = 0;
 	} else {
-		index_part = min(count, tp->tarindex_size - offset);
+		index_part = min_t(u64, count, tp->tarindex_size - offset);
 		remote_offset = 0;
 	}
 	tardata_part = count - index_part;
-- 
2.43.5



More information about the Linux-erofs mailing list