aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@sgi.com>2005-11-02 10:21:35 +1100
committerNathan Scott <nathans@sgi.com>2005-11-02 10:21:35 +1100
commitda1650a5d6026df1bde414173c40bbe09305e6e6 (patch)
tree09862bd032a5bacf24ba22b1938b529ceef917d7 /fs
parent88741a95af0ecf3a745051bdc1d16897d3990cec (diff)
[XFS] Add format checking to cmn_err and icmn_err
SGI-PV: 942243 SGI-Modid: xfs-linux:xfs-kern:198658a Signed-off-by: Christoph Hellwig <hch@sgi.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/support/debug.h7
-rw-r--r--fs/xfs/xfs_bmap.c2
-rw-r--r--fs/xfs/xfs_ialloc.c7
-rw-r--r--fs/xfs/xfs_inode.c5
-rw-r--r--fs/xfs/xfs_log.c4
-rw-r--r--fs/xfs/xfs_mount.c2
-rw-r--r--fs/xfs/xfs_rw.c2
7 files changed, 18 insertions, 11 deletions
diff --git a/fs/xfs/support/debug.h b/fs/xfs/support/debug.h
index c5b9365a7e2..4fbf5fa4d28 100644
--- a/fs/xfs/support/debug.h
+++ b/fs/xfs/support/debug.h
@@ -41,9 +41,10 @@
#define CE_ALERT 1 /* alert */
#define CE_PANIC 0 /* panic */
-extern void icmn_err(int, char *, va_list);
-/* PRINTFLIKE2 */
-extern void cmn_err(int, char *, ...);
+extern void icmn_err(int, char *, va_list)
+ __attribute__ ((format (printf, 2, 0)));
+extern void cmn_err(int, char *, ...)
+ __attribute__ ((format (printf, 2, 3)));
#ifndef STATIC
# define STATIC static
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 3e76def1283..26645d267f1 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -6131,7 +6131,7 @@ error0:
xfs_trans_brelse(NULL, bp);
error_norelse:
cmn_err(CE_WARN, "%s: BAD after btree leaves for %d extents",
- i, __FUNCTION__);
+ __FUNCTION__, i);
panic("%s: CORRUPTED BTREE OR SOMETHING", __FUNCTION__);
return;
}
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index ce5fee9eaec..02989691e4a 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -957,8 +957,11 @@ xfs_difree(
agino = XFS_INO_TO_AGINO(mp, inode);
if (inode != XFS_AGINO_TO_INO(mp, agno, agino)) {
cmn_err(CE_WARN,
- "xfs_difree: inode != XFS_AGINO_TO_INO() (%d != %d) on %s. Returning EINVAL.",
- inode, XFS_AGINO_TO_INO(mp, agno, agino), mp->m_fsname);
+ "xfs_difree: inode != XFS_AGINO_TO_INO() "
+ "(%llu != %llu) on %s. Returning EINVAL.",
+ (unsigned long long)inode,
+ (unsigned long long)XFS_AGINO_TO_INO(mp, agno, agino),
+ mp->m_fsname);
ASSERT(0);
return XFS_ERROR(EINVAL);
}
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index db43308aae9..5bf7b709f91 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -194,9 +194,10 @@ xfs_inotobp(
if ((imap.im_blkno + imap.im_len) >
XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)) {
cmn_err(CE_WARN,
- "xfs_inotobp: inode number (%d + %d) maps to a block outside the bounds "
+ "xfs_inotobp: inode number (%llu + %d) maps to a block outside the bounds "
"of the file system %s. Returning EINVAL.",
- imap.im_blkno, imap.im_len,mp->m_fsname);
+ (unsigned long long)imap.im_blkno,
+ imap.im_len, mp->m_fsname);
return XFS_ERROR(EINVAL);
}
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 54a6f114240..51814c32edd 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -3533,7 +3533,9 @@ xlog_verify_iclog(xlog_t *log,
}
}
if (clientid != XFS_TRANSACTION && clientid != XFS_LOG)
- cmn_err(CE_WARN, "xlog_verify_iclog: invalid clientid %d op 0x%p offset 0x%x", clientid, ophead, field_offset);
+ cmn_err(CE_WARN, "xlog_verify_iclog: "
+ "invalid clientid %d op 0x%p offset 0x%lx",
+ clientid, ophead, (unsigned long)field_offset);
/* check length */
field_offset = (__psint_t)
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 82e1646e624..12f10d5c3d9 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -318,7 +318,7 @@ xfs_mount_validate_sb(
"XFS: Attempted to mount file system with blocksize %d bytes",
sbp->sb_blocksize);
cmn_err(CE_WARN,
- "XFS: Only page-sized (%d) or less blocksizes currently work.",
+ "XFS: Only page-sized (%ld) or less blocksizes currently work.",
PAGE_SIZE);
return XFS_ERROR(ENOSYS);
}
diff --git a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c
index d3ff7aef33b..31f68cc637b 100644
--- a/fs/xfs/xfs_rw.c
+++ b/fs/xfs/xfs_rw.c
@@ -264,7 +264,7 @@ xfs_ioerror_alert(
{
cmn_err(CE_ALERT,
"I/O error in filesystem (\"%s\") meta-data dev %s block 0x%llx"
- " (\"%s\") error %d buf count %u",
+ " (\"%s\") error %d buf count %zd",
(!mp || !mp->m_fsname) ? "(fs name not set)" : mp->m_fsname,
XFS_BUFTARG_NAME(bp->pb_target),
(__uint64_t)blkno,