diff options
author | Christoph Hellwig <hch@sgi.com> | 2005-11-01 18:21:35 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-11-01 18:21:35 -0500 |
commit | da1650a5d6026df1bde414173c40bbe09305e6e6 (patch) | |
tree | 09862bd032a5bacf24ba22b1938b529ceef917d7 /fs/xfs | |
parent | 88741a95af0ecf3a745051bdc1d16897d3990cec (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/xfs')
-rw-r--r-- | fs/xfs/support/debug.h | 7 | ||||
-rw-r--r-- | fs/xfs/xfs_bmap.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_ialloc.c | 7 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 5 | ||||
-rw-r--r-- | fs/xfs/xfs_log.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_mount.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_rw.c | 2 |
7 files changed, 18 insertions, 11 deletions
diff --git a/fs/xfs/support/debug.h b/fs/xfs/support/debug.h index c5b9365a7e2a..4fbf5fa4d281 100644 --- a/fs/xfs/support/debug.h +++ b/fs/xfs/support/debug.h | |||
@@ -41,9 +41,10 @@ | |||
41 | #define CE_ALERT 1 /* alert */ | 41 | #define CE_ALERT 1 /* alert */ |
42 | #define CE_PANIC 0 /* panic */ | 42 | #define CE_PANIC 0 /* panic */ |
43 | 43 | ||
44 | extern void icmn_err(int, char *, va_list); | 44 | extern void icmn_err(int, char *, va_list) |
45 | /* PRINTFLIKE2 */ | 45 | __attribute__ ((format (printf, 2, 0))); |
46 | extern void cmn_err(int, char *, ...); | 46 | extern void cmn_err(int, char *, ...) |
47 | __attribute__ ((format (printf, 2, 3))); | ||
47 | 48 | ||
48 | #ifndef STATIC | 49 | #ifndef STATIC |
49 | # define STATIC static | 50 | # define STATIC static |
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 3e76def1283d..26645d267f1b 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -6131,7 +6131,7 @@ error0: | |||
6131 | xfs_trans_brelse(NULL, bp); | 6131 | xfs_trans_brelse(NULL, bp); |
6132 | error_norelse: | 6132 | error_norelse: |
6133 | cmn_err(CE_WARN, "%s: BAD after btree leaves for %d extents", | 6133 | cmn_err(CE_WARN, "%s: BAD after btree leaves for %d extents", |
6134 | i, __FUNCTION__); | 6134 | __FUNCTION__, i); |
6135 | panic("%s: CORRUPTED BTREE OR SOMETHING", __FUNCTION__); | 6135 | panic("%s: CORRUPTED BTREE OR SOMETHING", __FUNCTION__); |
6136 | return; | 6136 | return; |
6137 | } | 6137 | } |
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c index ce5fee9eaec5..02989691e4ab 100644 --- a/fs/xfs/xfs_ialloc.c +++ b/fs/xfs/xfs_ialloc.c | |||
@@ -957,8 +957,11 @@ xfs_difree( | |||
957 | agino = XFS_INO_TO_AGINO(mp, inode); | 957 | agino = XFS_INO_TO_AGINO(mp, inode); |
958 | if (inode != XFS_AGINO_TO_INO(mp, agno, agino)) { | 958 | if (inode != XFS_AGINO_TO_INO(mp, agno, agino)) { |
959 | cmn_err(CE_WARN, | 959 | cmn_err(CE_WARN, |
960 | "xfs_difree: inode != XFS_AGINO_TO_INO() (%d != %d) on %s. Returning EINVAL.", | 960 | "xfs_difree: inode != XFS_AGINO_TO_INO() " |
961 | inode, XFS_AGINO_TO_INO(mp, agno, agino), mp->m_fsname); | 961 | "(%llu != %llu) on %s. Returning EINVAL.", |
962 | (unsigned long long)inode, | ||
963 | (unsigned long long)XFS_AGINO_TO_INO(mp, agno, agino), | ||
964 | mp->m_fsname); | ||
962 | ASSERT(0); | 965 | ASSERT(0); |
963 | return XFS_ERROR(EINVAL); | 966 | return XFS_ERROR(EINVAL); |
964 | } | 967 | } |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index db43308aae93..5bf7b709f91a 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -194,9 +194,10 @@ xfs_inotobp( | |||
194 | if ((imap.im_blkno + imap.im_len) > | 194 | if ((imap.im_blkno + imap.im_len) > |
195 | XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)) { | 195 | XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)) { |
196 | cmn_err(CE_WARN, | 196 | cmn_err(CE_WARN, |
197 | "xfs_inotobp: inode number (%d + %d) maps to a block outside the bounds " | 197 | "xfs_inotobp: inode number (%llu + %d) maps to a block outside the bounds " |
198 | "of the file system %s. Returning EINVAL.", | 198 | "of the file system %s. Returning EINVAL.", |
199 | imap.im_blkno, imap.im_len,mp->m_fsname); | 199 | (unsigned long long)imap.im_blkno, |
200 | imap.im_len, mp->m_fsname); | ||
200 | return XFS_ERROR(EINVAL); | 201 | return XFS_ERROR(EINVAL); |
201 | } | 202 | } |
202 | 203 | ||
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 54a6f1142403..51814c32eddf 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -3533,7 +3533,9 @@ xlog_verify_iclog(xlog_t *log, | |||
3533 | } | 3533 | } |
3534 | } | 3534 | } |
3535 | if (clientid != XFS_TRANSACTION && clientid != XFS_LOG) | 3535 | if (clientid != XFS_TRANSACTION && clientid != XFS_LOG) |
3536 | cmn_err(CE_WARN, "xlog_verify_iclog: invalid clientid %d op 0x%p offset 0x%x", clientid, ophead, field_offset); | 3536 | cmn_err(CE_WARN, "xlog_verify_iclog: " |
3537 | "invalid clientid %d op 0x%p offset 0x%lx", | ||
3538 | clientid, ophead, (unsigned long)field_offset); | ||
3537 | 3539 | ||
3538 | /* check length */ | 3540 | /* check length */ |
3539 | field_offset = (__psint_t) | 3541 | field_offset = (__psint_t) |
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 82e1646e6243..12f10d5c3d99 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -318,7 +318,7 @@ xfs_mount_validate_sb( | |||
318 | "XFS: Attempted to mount file system with blocksize %d bytes", | 318 | "XFS: Attempted to mount file system with blocksize %d bytes", |
319 | sbp->sb_blocksize); | 319 | sbp->sb_blocksize); |
320 | cmn_err(CE_WARN, | 320 | cmn_err(CE_WARN, |
321 | "XFS: Only page-sized (%d) or less blocksizes currently work.", | 321 | "XFS: Only page-sized (%ld) or less blocksizes currently work.", |
322 | PAGE_SIZE); | 322 | PAGE_SIZE); |
323 | return XFS_ERROR(ENOSYS); | 323 | return XFS_ERROR(ENOSYS); |
324 | } | 324 | } |
diff --git a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c index d3ff7aef33ba..31f68cc637b0 100644 --- a/fs/xfs/xfs_rw.c +++ b/fs/xfs/xfs_rw.c | |||
@@ -264,7 +264,7 @@ xfs_ioerror_alert( | |||
264 | { | 264 | { |
265 | cmn_err(CE_ALERT, | 265 | cmn_err(CE_ALERT, |
266 | "I/O error in filesystem (\"%s\") meta-data dev %s block 0x%llx" | 266 | "I/O error in filesystem (\"%s\") meta-data dev %s block 0x%llx" |
267 | " (\"%s\") error %d buf count %u", | 267 | " (\"%s\") error %d buf count %zd", |
268 | (!mp || !mp->m_fsname) ? "(fs name not set)" : mp->m_fsname, | 268 | (!mp || !mp->m_fsname) ? "(fs name not set)" : mp->m_fsname, |
269 | XFS_BUFTARG_NAME(bp->pb_target), | 269 | XFS_BUFTARG_NAME(bp->pb_target), |
270 | (__uint64_t)blkno, | 270 | (__uint64_t)blkno, |