diff mbox

[21/23] Btrfs: fix fs logging for multi device

Message ID 1439548388-29686-22-git-send-email-anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Anand Jain Aug. 14, 2015, 10:33 a.m. UTC
In case of multi device btrfs fs, using one of device for
the logging purpose it quite confusing, instead use the
fsid. FSID is bit long, but the device path can be long
as well in some cases.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Sterba Oct. 1, 2015, 1:45 p.m. UTC | #1
On Fri, Aug 14, 2015 at 06:33:06PM +0800, Anand Jain wrote:
> In case of multi device btrfs fs, using one of device for
> the logging purpose it quite confusing, instead use the
> fsid. FSID is bit long, but the device path can be long
> as well in some cases.

The fsid in the log would be good but yeah it's quite long. Though the
device paths could be long as well, they are not in most cases. The uuid
length is 36 bytes, a device mapper path starts at 12 (prefix) plus the
volume name.

Please send this patch separately with a RFC tag so we can hopeully have
a discussion among more people.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Anand Jain Oct. 1, 2015, 1:48 p.m. UTC | #2
On 10/01/2015 09:45 PM, David Sterba wrote:
> On Fri, Aug 14, 2015 at 06:33:06PM +0800, Anand Jain wrote:
>> In case of multi device btrfs fs, using one of device for
>> the logging purpose it quite confusing, instead use the
>> fsid. FSID is bit long, but the device path can be long
>> as well in some cases.
>
> The fsid in the log would be good but yeah it's quite long. Though the
> device paths could be long as well, they are not in most cases. The uuid
> length is 36 bytes, a device mapper path starts at 12 (prefix) plus the
> volume name.
>
> Please send this patch separately with a RFC tag so we can hopeully have
> a discussion among more people.

  got it. will do.

Thanks, Anand

> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 56c0174..a8a0109 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -190,12 +190,12 @@  static const char * const logtypes[] = {
 
 void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...)
 {
-	struct super_block *sb = fs_info->sb;
 	char lvl[4];
 	struct va_format vaf;
 	va_list args;
 	const char *type = logtypes[4];
 	int kern_level;
+	struct btrfs_fs_devices *fs_devs = fs_info->fs_devices;
 
 	va_start(args, fmt);
 
@@ -212,7 +212,7 @@  void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...)
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	printk("%sBTRFS %s (device %s): %pV\n", lvl, type, sb->s_id, &vaf);
+	printk("%sBTRFS: %pU %s: %pV\n", lvl, fs_devs->fsid, type, &vaf);
 
 	va_end(args);
 }