[PATCH] xfs: prevent NMI timeouts in cmn_err
Christoph Hellwig
hch at infradead.org
Fri Dec 10 07:29:35 CST 2010
On Fri, Dec 03, 2010 at 03:38:46PM +1100, Dave Chinner wrote:
> FWIW, while these macros are the best way to make a simple backport
> is possible, I just discovered that mainline has a %pV format
> operator that allows an implementation like:
>
> void
> xfs_fs_cmn_err(
> const char *lvl,
> struct xfs_mount *mp,
> const char *fmt,
> ...)
> {
> struct va_format vaf;
> va_list args;
>
> va_start(args, fmt);
> vaf.fmt = fmt;
> vaf.va = &args;
>
> printk("%sFilesystem %s: %pV", lvl, mp->m_fsname, &vaf);
> va_end(args);
>
> BUG_ON(strncmp(lvl, KERN_EMERG, strlen(KERN_EMERG)) == 0);
> }
With this we can also keep the existing integer-based CE_ values
and do trivial array lookup. That also avoids having to do a strcmp for
every message printed.
More information about the xfs
mailing list