[PATCH 3/4] erofs-utils: resolve `PRINTF_ARGS`

Gao Xiang hsiangkao at linux.alibaba.com
Tue Jul 8 12:17:21 AEST 2025


Coverity-id: 569452
Coverity-id: 569454
Coverity-id: 569455
Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
---
 lib/blobchunk.c |  4 ++--
 lib/cache.c     |  3 ++-
 lib/dir.c       | 11 ++++++-----
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/lib/blobchunk.c b/lib/blobchunk.c
index 024a3927..54644cd4 100644
--- a/lib/blobchunk.c
+++ b/lib/blobchunk.c
@@ -73,8 +73,8 @@ static struct erofs_blobchunk *erofs_blob_getchunk(struct erofs_sb_info *sbi,
 			chunk = &erofs_holechunk;
 			erofs_dbg("Found duplicated hole chunk");
 		} else {
-			erofs_dbg("Found duplicated chunk at %u",
-				  chunk->blkaddr);
+			erofs_dbg("Found duplicated chunk at %llu",
+				  chunk->blkaddr | 0ULL);
 		}
 		return chunk;
 	}
diff --git a/lib/cache.c b/lib/cache.c
index b91a2887..2c730169 100644
--- a/lib/cache.c
+++ b/lib/cache.c
@@ -487,7 +487,8 @@ int erofs_bflush(struct erofs_bufmgr *bmgr,
 
 		if (p->type != DATA)
 			bmgr->metablkcnt += p->buffers.nblocks;
-		erofs_dbg("block %u to %u flushed", p->blkaddr, blkaddr - 1);
+		erofs_dbg("block %llu to %llu flushed", p->blkaddr | 0ULL,
+			  (blkaddr - 1) | 0ULL);
 		erofs_bfree(p);
 	}
 	return 0;
diff --git a/lib/dir.c b/lib/dir.c
index 3405844c..821a364f 100644
--- a/lib/dir.c
+++ b/lib/dir.c
@@ -18,7 +18,7 @@ static bool erofs_validate_filename(const char *dname, int size)
 }
 
 static int traverse_dirents(struct erofs_dir_context *ctx,
-			    void *dentry_blk, unsigned int lblk,
+			    void *dentry_blk, erofs_off_t lblk,
 			    unsigned int next_nameoff, unsigned int maxsize,
 			    bool fsck)
 {
@@ -132,8 +132,8 @@ static int traverse_dirents(struct erofs_dir_context *ctx,
 	}
 out:
 	if (ret && !silent)
-		erofs_err("%s @ nid %llu, lblk %u, index %lu",
-			  errmsg, ctx->dir->nid | 0ULL, lblk,
+		erofs_err("%s @ nid %llu, lblk %llu, index %lu",
+			  errmsg, ctx->dir->nid | 0ULL, lblk | 0ULL,
 			  (de - (struct erofs_dirent *)dentry_blk) | 0UL);
 	return ret;
 }
@@ -162,8 +162,9 @@ int erofs_iterate_dir(struct erofs_dir_context *ctx, bool fsck)
 
 		err = erofs_pread(dir, buf, maxsize, pos);
 		if (err) {
-			erofs_err("I/O error occurred when reading dirents @ nid %llu, lblk %u: %d",
-				  dir->nid | 0ULL, lblk, err);
+			erofs_err("I/O error when reading dirents @ nid %llu, lblk %llu: %s",
+				  dir->nid | 0ULL, lblk | 0ULL,
+				  erofs_strerror(err));
 			return err;
 		}
 
-- 
2.43.5



More information about the Linux-erofs mailing list