diff options
author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2024-09-05 14:44:50 +0300 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2024-10-01 12:19:09 +0300 |
commit | 48dbc127836a6f311414bc03eae386023d05ed30 (patch) | |
tree | 87c4faa4fe17b6748c7e9df48b302d79adf6f264 /fs/ntfs3 | |
parent | 031d6f608290c847ba6378322d0986d08d1a645a (diff) | |
download | linux-stable-48dbc127836a6f311414bc03eae386023d05ed30.tar.gz linux-stable-48dbc127836a6f311414bc03eae386023d05ed30.tar.bz2 linux-stable-48dbc127836a6f311414bc03eae386023d05ed30.zip |
fs/ntfs3: Format output messages like others fs in kernel
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3')
-rw-r--r-- | fs/ntfs3/super.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 128d49512f5d..6a0f6b0a3ab2 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -90,7 +90,7 @@ void ntfs_printk(const struct super_block *sb, const char *fmt, ...) level = printk_get_level(fmt); vaf.fmt = printk_skip_level(fmt); vaf.va = &args; - printk("%c%cntfs3: %s: %pV\n", KERN_SOH_ASCII, level, sb->s_id, &vaf); + printk("%c%cntfs3(%s): %pV\n", KERN_SOH_ASCII, level, sb->s_id, &vaf); va_end(args); } @@ -124,10 +124,15 @@ void ntfs_inode_printk(struct inode *inode, const char *fmt, ...) struct dentry *de = d_find_alias(inode); if (de) { + int len; spin_lock(&de->d_lock); - snprintf(name, sizeof(s_name_buf), " \"%s\"", - de->d_name.name); + len = snprintf(name, sizeof(s_name_buf), " \"%s\"", + de->d_name.name); spin_unlock(&de->d_lock); + if (len <= 0) + name[0] = 0; + else if (len >= sizeof(s_name_buf)) + name[sizeof(s_name_buf) - 1] = 0; } else { name[0] = 0; } @@ -140,7 +145,7 @@ void ntfs_inode_printk(struct inode *inode, const char *fmt, ...) vaf.fmt = printk_skip_level(fmt); vaf.va = &args; - printk("%c%cntfs3: %s: ino=%lx,%s %pV\n", KERN_SOH_ASCII, level, + printk("%c%cntfs3(%s): ino=%lx,%s %pV\n", KERN_SOH_ASCII, level, sb->s_id, inode->i_ino, name ? name : "", &vaf); va_end(args); |