Recently, during my xfs bugfix work, notice a bug that makes xfs_stack_trace never take effect. This has been around here at xfs debug framework for a long time. The root cause is misuse of `kstrtoint` which always return -EINVAL because KERN_<LEVEL> with KERN_SOH prefix unable to parse correctly by it. By skipping the prefix KERN_SOH we can get correct printk level. Fixes: 847f9f6875fb ("xfs: more info from kmem deadlocks and high-level error msgs") Signed-off-by: Guo Xuenan <guoxuenan@xxxxxxxxxx> --- fs/xfs/xfs_message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_message.c b/fs/xfs/xfs_message.c index 8f495cc23903..bda4c0a0ca42 100644 --- a/fs/xfs/xfs_message.c +++ b/fs/xfs/xfs_message.c @@ -45,7 +45,7 @@ xfs_printk_level( va_end(args); - if (!kstrtoint(kern_level, 0, &level) && + if (!kstrtoint(kern_level + strlen(KERN_SOH), 0, &level) && level <= LOGLEVEL_ERR && xfs_error_level >= XFS_ERRLEVEL_HIGH) xfs_stack_trace(); -- 2.31.1