public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: include device major and minor numbers in the device scan notice
@ 2024-02-23 11:26 Anand Jain
  2024-02-23 15:46 ` Filipe Manana
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Anand Jain @ 2024-02-23 11:26 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Anand Jain

To better debug issues surrounding device scans, include the device's
major and minor numbers in the device scan notice for btrfs.

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

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 32312f0de2bb..6db37615a3e5 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -824,13 +824,15 @@ static noinline struct btrfs_device *device_list_add(const char *path,
 
 		if (disk_super->label[0])
 			pr_info(
-	"BTRFS: device label %s devid %llu transid %llu %s scanned by %s (%d)\n",
+"BTRFS: device label %s devid %llu transid %llu %s(%d:%d) scanned by %s (%d)\n",
 				disk_super->label, devid, found_transid, path,
+				MAJOR(path_devt), MINOR(path_devt),
 				current->comm, task_pid_nr(current));
 		else
 			pr_info(
-	"BTRFS: device fsid %pU devid %llu transid %llu %s scanned by %s (%d)\n",
+"BTRFS: device fsid %pU devid %llu transid %llu %s(%d:%d) scanned by %s (%d)\n",
 				disk_super->fsid, devid, found_transid, path,
+				MAJOR(path_devt), MINOR(path_devt),
 				current->comm, task_pid_nr(current));
 
 	} else if (!device->name || strcmp(device->name->str, path)) {
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] btrfs: include device major and minor numbers in the device scan notice
  2024-02-23 11:26 [PATCH] btrfs: include device major and minor numbers in the device scan notice Anand Jain
@ 2024-02-23 15:46 ` Filipe Manana
  2024-02-25  5:29   ` Anand Jain
  2024-02-23 16:12 ` Sweet Tea Dorminy
  2024-02-23 19:57 ` Qu Wenruo
  2 siblings, 1 reply; 7+ messages in thread
From: Filipe Manana @ 2024-02-23 15:46 UTC (permalink / raw)
  To: Anand Jain; +Cc: linux-btrfs

On Fri, Feb 23, 2024 at 11:27 AM Anand Jain <anand.jain@oracle.com> wrote:
>
> To better debug issues surrounding device scans, include the device's
> major and minor numbers in the device scan notice for btrfs.
>
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
>  fs/btrfs/volumes.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 32312f0de2bb..6db37615a3e5 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -824,13 +824,15 @@ static noinline struct btrfs_device *device_list_add(const char *path,
>
>                 if (disk_super->label[0])
>                         pr_info(
> -       "BTRFS: device label %s devid %llu transid %llu %s scanned by %s (%d)\n",
> +"BTRFS: device label %s devid %llu transid %llu %s(%d:%d) scanned by %s (%d)\n",

Can we please leave a space before the opening parentheses?
So that it's consistent with the rest of the message and more readable
(I believe it's also more formal English).


>                                 disk_super->label, devid, found_transid, path,
> +                               MAJOR(path_devt), MINOR(path_devt),
>                                 current->comm, task_pid_nr(current));
>                 else
>                         pr_info(
> -       "BTRFS: device fsid %pU devid %llu transid %llu %s scanned by %s (%d)\n",
> +"BTRFS: device fsid %pU devid %llu transid %llu %s(%d:%d) scanned by %s (%d)\n",

Same here.

With that adjusted:

Reviewed-by: Filipe Manana <fdmanana@suse.com>

Thanks.

>                                 disk_super->fsid, devid, found_transid, path,
> +                               MAJOR(path_devt), MINOR(path_devt),
>                                 current->comm, task_pid_nr(current));
>
>         } else if (!device->name || strcmp(device->name->str, path)) {
> --
> 2.38.1
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] btrfs: include device major and minor numbers in the device scan notice
  2024-02-23 11:26 [PATCH] btrfs: include device major and minor numbers in the device scan notice Anand Jain
  2024-02-23 15:46 ` Filipe Manana
@ 2024-02-23 16:12 ` Sweet Tea Dorminy
  2024-02-23 16:15   ` Anand Jain
  2024-02-23 19:57 ` Qu Wenruo
  2 siblings, 1 reply; 7+ messages in thread
From: Sweet Tea Dorminy @ 2024-02-23 16:12 UTC (permalink / raw)
  To: Anand Jain, linux-btrfs



On 2/23/24 06:26, Anand Jain wrote:
> To better debug issues surrounding device scans, include the device's
> major and minor numbers in the device scan notice for btrfs.
> 

It would also be nice to add in maj:min into all the error messages in 
that function too, if you're sending a new version. Or I can send 
another patch with that if it feels too different in spirit to you.

But either way (with Filipe's adjustment):
Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] btrfs: include device major and minor numbers in the device scan notice
  2024-02-23 16:12 ` Sweet Tea Dorminy
@ 2024-02-23 16:15   ` Anand Jain
  0 siblings, 0 replies; 7+ messages in thread
From: Anand Jain @ 2024-02-23 16:15 UTC (permalink / raw)
  To: Sweet Tea Dorminy, linux-btrfs



On 2/23/24 21:42, Sweet Tea Dorminy wrote:
> 
> 
> On 2/23/24 06:26, Anand Jain wrote:
>> To better debug issues surrounding device scans, include the device's
>> major and minor numbers in the device scan notice for btrfs.
>>
> 
> It would also be nice to add in maj:min into all the error messages in 
> that function too, if you're sending a new version. Or I can send 
> another patch with that if it feels too different in spirit to you.
> 

Sure, I'll add that, certainly these logs need clarity. Thanks.

-Anand

> But either way (with Filipe's adjustment):
> Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] btrfs: include device major and minor numbers in the device scan notice
  2024-02-23 11:26 [PATCH] btrfs: include device major and minor numbers in the device scan notice Anand Jain
  2024-02-23 15:46 ` Filipe Manana
  2024-02-23 16:12 ` Sweet Tea Dorminy
@ 2024-02-23 19:57 ` Qu Wenruo
  2024-02-25  6:33   ` Anand Jain
  2 siblings, 1 reply; 7+ messages in thread
From: Qu Wenruo @ 2024-02-23 19:57 UTC (permalink / raw)
  To: Anand Jain, linux-btrfs



在 2024/2/23 21:56, Anand Jain 写道:
> To better debug issues surrounding device scans, include the device's
> major and minor numbers in the device scan notice for btrfs.
>
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Maybe you want to expand the device number to all other device name output?

Especially considering the recent device name problem, device
major/minor looks a much better supplement.

Thanks,
Qu
> ---
>   fs/btrfs/volumes.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 32312f0de2bb..6db37615a3e5 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -824,13 +824,15 @@ static noinline struct btrfs_device *device_list_add(const char *path,
>
>   		if (disk_super->label[0])
>   			pr_info(
> -	"BTRFS: device label %s devid %llu transid %llu %s scanned by %s (%d)\n",
> +"BTRFS: device label %s devid %llu transid %llu %s(%d:%d) scanned by %s (%d)\n",
>   				disk_super->label, devid, found_transid, path,
> +				MAJOR(path_devt), MINOR(path_devt),
>   				current->comm, task_pid_nr(current));
>   		else
>   			pr_info(
> -	"BTRFS: device fsid %pU devid %llu transid %llu %s scanned by %s (%d)\n",
> +"BTRFS: device fsid %pU devid %llu transid %llu %s(%d:%d) scanned by %s (%d)\n",
>   				disk_super->fsid, devid, found_transid, path,
> +				MAJOR(path_devt), MINOR(path_devt),
>   				current->comm, task_pid_nr(current));
>
>   	} else if (!device->name || strcmp(device->name->str, path)) {

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] btrfs: include device major and minor numbers in the device scan notice
  2024-02-23 15:46 ` Filipe Manana
@ 2024-02-25  5:29   ` Anand Jain
  0 siblings, 0 replies; 7+ messages in thread
From: Anand Jain @ 2024-02-25  5:29 UTC (permalink / raw)
  To: Filipe Manana; +Cc: linux-btrfs

On 2/23/24 21:16, Filipe Manana wrote:
> On Fri, Feb 23, 2024 at 11:27 AM Anand Jain <anand.jain@oracle.com> wrote:
>>
>> To better debug issues surrounding device scans, include the device's
>> major and minor numbers in the device scan notice for btrfs.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> ---
>>   fs/btrfs/volumes.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
>> index 32312f0de2bb..6db37615a3e5 100644
>> --- a/fs/btrfs/volumes.c
>> +++ b/fs/btrfs/volumes.c
>> @@ -824,13 +824,15 @@ static noinline struct btrfs_device *device_list_add(const char *path,
>>
>>                  if (disk_super->label[0])
>>                          pr_info(
>> -       "BTRFS: device label %s devid %llu transid %llu %s scanned by %s (%d)\n",
>> +"BTRFS: device label %s devid %llu transid %llu %s(%d:%d) scanned by %s (%d)\n",
> 
> Can we please leave a space before the opening parentheses?

> So that it's consistent with the rest of the message and more readable
> (I believe it's also more formal English).

Sure.
> 
> 
>>                                  disk_super->label, devid, found_transid, path,
>> +                               MAJOR(path_devt), MINOR(path_devt),
>>                                  current->comm, task_pid_nr(current));
>>                  else
>>                          pr_info(
>> -       "BTRFS: device fsid %pU devid %llu transid %llu %s scanned by %s (%d)\n",
>> +"BTRFS: device fsid %pU devid %llu transid %llu %s(%d:%d) scanned by %s (%d)\n",
> 
> Same here.
> 

yep.

Thanks,  Anand


> With that adjusted:
> 
> Reviewed-by: Filipe Manana <fdmanana@suse.com>
> 
> Thanks.
> 
>>                                  disk_super->fsid, devid, found_transid, path,
>> +                               MAJOR(path_devt), MINOR(path_devt),
>>                                  current->comm, task_pid_nr(current));
>>
>>          } else if (!device->name || strcmp(device->name->str, path)) {
>> --
>> 2.38.1
>>
>>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] btrfs: include device major and minor numbers in the device scan notice
  2024-02-23 19:57 ` Qu Wenruo
@ 2024-02-25  6:33   ` Anand Jain
  0 siblings, 0 replies; 7+ messages in thread
From: Anand Jain @ 2024-02-25  6:33 UTC (permalink / raw)
  To: Qu Wenruo, linux-btrfs

On 2/24/24 01:27, Qu Wenruo wrote:
> 
> 
> 在 2024/2/23 21:56, Anand Jain 写道:
>> To better debug issues surrounding device scans, include the device's
>> major and minor numbers in the device scan notice for btrfs.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> 
> Reviewed-by: Qu Wenruo <wqu@suse.com>
> 
> Maybe you want to expand the device number to all other device name output?
> 
> Especially considering the recent device name problem, device
> major/minor looks a much better supplement.

  Yeah.. added to all scan related messages.

Thanks, Anand

> 
> Thanks,
> Qu
>> ---
>>   fs/btrfs/volumes.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
>> index 32312f0de2bb..6db37615a3e5 100644
>> --- a/fs/btrfs/volumes.c
>> +++ b/fs/btrfs/volumes.c
>> @@ -824,13 +824,15 @@ static noinline struct btrfs_device 
>> *device_list_add(const char *path,
>>
>>           if (disk_super->label[0])
>>               pr_info(
>> -    "BTRFS: device label %s devid %llu transid %llu %s scanned by %s 
>> (%d)\n",
>> +"BTRFS: device label %s devid %llu transid %llu %s(%d:%d) scanned by 
>> %s (%d)\n",
>>                   disk_super->label, devid, found_transid, path,
>> +                MAJOR(path_devt), MINOR(path_devt),
>>                   current->comm, task_pid_nr(current));
>>           else
>>               pr_info(
>> -    "BTRFS: device fsid %pU devid %llu transid %llu %s scanned by %s 
>> (%d)\n",
>> +"BTRFS: device fsid %pU devid %llu transid %llu %s(%d:%d) scanned by 
>> %s (%d)\n",
>>                   disk_super->fsid, devid, found_transid, path,
>> +                MAJOR(path_devt), MINOR(path_devt),
>>                   current->comm, task_pid_nr(current));
>>
>>       } else if (!device->name || strcmp(device->name->str, path)) {


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-02-25  6:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-23 11:26 [PATCH] btrfs: include device major and minor numbers in the device scan notice Anand Jain
2024-02-23 15:46 ` Filipe Manana
2024-02-25  5:29   ` Anand Jain
2024-02-23 16:12 ` Sweet Tea Dorminy
2024-02-23 16:15   ` Anand Jain
2024-02-23 19:57 ` Qu Wenruo
2024-02-25  6:33   ` Anand Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox