RFC xfs: rework error logging infrastructure
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest12 patches 14 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/12 | xfs: prevent NMI timeouts in cmn_errfs/ fs/ fs/ +4 more | +96 | 4 replies | |
| 2/12 | xfs: introduce new logging API.fs/ fs/ fs/ +1 more | +155 | 0 replies | |
| 3/12 | xfs: Convert linux-2.6/ files to new logging interfacefs/ fs/ fs/ +3 more | +76 | 0 replies | |
| 4/12 | xfs: Convert xlog_warn to new logging interfacefs/ fs/ fs/ +3 more | +177 | 1 reply | |
| 5/12 | xfs: convert xfs_cmn_err to xfs_alert_tagfs/ fs/ fs/ +6 more | +36 | 0 replies | |
| 6/12 | xfs: kill xfs_fs_repair_cmn_err() macrofs/ fs/ fs/ +1 more | +19 | 0 replies | |
| 7/12 | xfs: kill xfs_fs_mount_cmn_err() macrofs/ fs/ | +43 | 3 replies | |
| 8/12 | xfs: convert xfs_fs_cmn_err to new error logging APIfs/ fs/ fs/ +10 more | +53 | 0 replies | |
| 9/12 | xfs: rename xfs_cmn_err_fsblock_zero()fs/ | +5 | 0 replies | |
| 10/12 | xfs: convert the quota debug prints to new APIfs/ | +12 | 0 replies | |
| 11/12 | xfs: Convert remaining cmn_err() callers to new APIfs/ fs/ fs/ +17 more | +169 | 0 replies | |
| 12/12 | xfs: kill support/debug.[ch]fs/ fs/ fs/ +4 more | +39 | 2 replies |
Reviews trailers per patch
2 of 12 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Alex Elder | Christoph Hellwig |
|---|---|---|
| Series | R-b | R-b |
| 1/12 | R-b | R-b |
| 2/12 | ||
| 3/12 | ||
| 4/12 | R-b | |
| 5/12 | ||
| 6/12 | ||
| 7/12 | ||
| 8/12 | ||
| 9/12 | ||
| 10/12 | ||
| 11/12 | ||
| 12/12 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC, PATCH 0/12] xfs: rework error logging infrastructure
This series completely reworks the cmn_err logging infrastructure by replacing it with a simple, consistent API that can be used everwhere. IOWs, this series replaces the various cmn_err APIs:
cmn_err() xfs_cmn_err() xfs_fs_cmn_err() xfs_fs_mount_cmn_err() xfs_fs_repair_cmn_err() xlog_warn() xlog_panic() xlog_exit()
With the following log level specific functions:
xfs_emerg(mp, ....) xfs_alert(mp, ....) xfs_alert_tag(mp, int tag, ....) xfs_crit(mp, ....) xfs_err(mp, ....) xfs_warn(mp, ....) xfs_notice(mp, ....) xfs_info(mp, ....) xfs_debug(mp, ....)
and a generic printk function that uses the kernel log level definitions(e.g. KERN_WARN):
xfs_printk(level, mp, ....)
This provides all the log messages with a common format. If mp && mp->m_fsname exist, then the format is:
"XFS (device name): <log message>"
otherwise it is:
"XFS: <log message>"
Hence we end up with log messages looking like this:
Normal mount:
XFS (vda): Mounting Filesystem
XFS (vda): Ending clean mount
Bad mount options:
XFS (vdb): unknown mount option [foobar].
XFS (vdb): Filesystem has duplicate UUID - can't mount
Quota check:
XFS (vdb): Mounting Filesystem
XFS (vdb): Ending clean mount
XFS (vdb): Quotacheck needed: Please wait.
XFS (vdb): Quotacheck: Done.
Log recovery warnings:
XFS (vdb): Mounting Filesystem
XFS (vdb): Invalid block length (0x2000) for buffer
XFS (vdb): Ending clean mount
....
XFS (vdb): Mounting Filesystem
XFS (vdb): recovery required on read-only device.
XFS (vdb): write access unavailable, cannot proceed.
XFS (vdb): log mount/recovery failed: error 30
XFS (vdb): log mount failed
XFS (vdb): Disabling barriers, underlying device is readonly
XFS (vdb): Mounting filesystem in no-recovery mode. Filesystem will be inconsistent.
Forced shutdown:
XFS (vdb): Mounting Filesystem
XFS (vdb): Ending clean mount
XFS (vdb): xfs_log_force: error 5 returned.
XFS (vdb): xfs_log_force: error 5 returned.
XFS (vdb): xfs_do_force_shutdown(0x1) called from line 1046 of file fs/xfs/linux-2.6/xfs_buf.c. Return address = 0xffffffff814acd93 XFS (vdb): xfs_log_force: error 5 returned.
XFS (vdb): xfs_log_force: error 5 returned.
And so on.
The other main change that pervades this series is that as I've touched each log messsage that quotes the function name, I've converted them to "%s:....", __func__, ... format. This shortens the message format string and also makes it easier to grep the source code to find the function definition.
Comments welcome.
Diffstat:
fs/xfs/Makefile | 2 +- fs/xfs/linux-2.6/kmem.c | 9 +- fs/xfs/linux-2.6/xfs_aops.c | 6 +- fs/xfs/linux-2.6/xfs_buf.c | 17 ++-- fs/xfs/linux-2.6/xfs_linux.h | 22 ++++ fs/xfs/linux-2.6/xfs_printk.c | 133 ++++++++++++++++++++++++ fs/xfs/linux-2.6/xfs_printk.h | 38 +++++++ fs/xfs/linux-2.6/xfs_super.c | 127 ++++++++++------------- fs/xfs/linux-2.6/xfs_sync.c | 5 +- fs/xfs/linux-2.6/xfs_sysctl.c | 25 ++++- fs/xfs/quota/xfs_dquot.c | 48 +++++---- fs/xfs/quota/xfs_dquot_item.c | 5 +- fs/xfs/quota/xfs_qm.c | 42 ++++---- fs/xfs/quota/xfs_qm_bhv.c | 3 +- fs/xfs/quota/xfs_qm_syscalls.c | 85 ++++++++-------- fs/xfs/quota/xfs_trans_dquot.c | 5 +- fs/xfs/support/debug.c | 115 --------------------- fs/xfs/support/debug.h | 54 ---------- fs/xfs/xfs_bmap.c | 17 ++-- fs/xfs/xfs_buf_item.c | 15 ++-- fs/xfs/xfs_da_btree.c | 9 +- fs/xfs/xfs_dfrag.c | 4 +- fs/xfs/xfs_dir2.c | 2 +- fs/xfs/xfs_dir2_node.c | 25 ++--- fs/xfs/xfs_error.c | 53 ++-------- fs/xfs/xfs_error.h | 29 +----- fs/xfs/xfs_fsops.c | 6 +- fs/xfs/xfs_ialloc.c | 82 ++++++--------- fs/xfs/xfs_inode.c | 124 ++++++++++------------ fs/xfs/xfs_iomap.c | 12 +- fs/xfs/xfs_log.c | 124 +++++++++++------------ fs/xfs/xfs_log_priv.h | 4 - fs/xfs/xfs_log_recover.c | 223 +++++++++++++++++++-------------------- fs/xfs/xfs_mount.c | 148 ++++++++++++++------------- fs/xfs/xfs_quota.h | 3 +- fs/xfs/xfs_rtalloc.c | 8 +- fs/xfs/xfs_rtalloc.h | 2 +- fs/xfs/xfs_rw.c | 40 +++---- fs/xfs/xfs_trans_ail.c | 2 +- fs/xfs/xfs_trans_buf.c | 6 +- fs/xfs/xfs_vnodeops.c | 13 +-- 41 files changed, 808 insertions(+), 884 deletions(-)
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs