diff options
author | Eric Sandeen <sandeen@redhat.com> | 2015-10-12 07:04:45 +0200 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2015-10-12 07:04:45 +0200 |
commit | 847f9f6875fb02b576035e3dc31f5e647b7617a7 (patch) | |
tree | 34beacf9cf2facf6251ef86bce93753ba65e498a /fs/xfs/xfs_message.c | |
parent | xfs: avoid dependency on Linux XATTR_SIZE_MAX (diff) | |
download | linux-847f9f6875fb02b576035e3dc31f5e647b7617a7.tar.xz linux-847f9f6875fb02b576035e3dc31f5e647b7617a7.zip |
xfs: more info from kmem deadlocks and high-level error msgs
In an effort to get more useful out of "possible memory
allocation deadlock" messages, print the size of the
requested allocation, and dump the stack if the xfs error
level is tuned high.
The stack dump is implemented in define_xfs_printk_level()
for error levels >= LOGLEVEL_ERR, partly because it
seems generically useful, and also because kmem.c has
no knowledge of xfs error level tunables or other such bits,
it's very kmem-specific.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_message.c')
-rw-r--r-- | fs/xfs/xfs_message.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/xfs/xfs_message.c b/fs/xfs/xfs_message.c index d8b67547ab34..11792d888e4e 100644 --- a/fs/xfs/xfs_message.c +++ b/fs/xfs/xfs_message.c @@ -17,6 +17,7 @@ #include "xfs.h" #include "xfs_fs.h" +#include "xfs_error.h" #include "xfs_format.h" #include "xfs_log_format.h" #include "xfs_trans_resv.h" @@ -43,6 +44,7 @@ void func(const struct xfs_mount *mp, const char *fmt, ...) \ { \ struct va_format vaf; \ va_list args; \ + int level; \ \ va_start(args, fmt); \ \ @@ -51,6 +53,11 @@ void func(const struct xfs_mount *mp, const char *fmt, ...) \ \ __xfs_printk(kern_level, mp, &vaf); \ va_end(args); \ + \ + if (!kstrtoint(kern_level, 0, &level) && \ + level <= LOGLEVEL_ERR && \ + xfs_error_level >= XFS_ERRLEVEL_HIGH) \ + xfs_stack_trace(); \ } \ define_xfs_printk_level(xfs_emerg, KERN_EMERG); |