Re: [PATCH] btrfs: include device major and minor numbers in the device scan notice

Anand Jain
2024-02-25T06:33:36Z

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)) {