Re: [PATCH] btrfs: add device scanned-by process name in the scan message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2.10.19 г. 13:30 ч., Anand Jain wrote:
> Its very helpful if we had logged the device scanner process name
> to debug the race condition between the systemd-udevd scan and the
> user initiated device forget command.
> 
> This patch adds scanned-by process name to the scan message.
> 
> Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx>

Same effect can be achieved (for debugging purposes) if you have used
ftrace on device_list_add without needing to patch the kernel.


I'm somewhat indifferent whether this will be merged or not but I
personally don't see much value in it.

> ---
>  fs/btrfs/volumes.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 788271649726..2c4c89bfafd1 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -1011,11 +1011,11 @@ static noinline struct btrfs_device *device_list_add(const char *path,
>  		*new_device_added = true;
>  
>  		if (disk_super->label[0])
> -			pr_info("BTRFS: device label %s devid %llu transid %llu %s\n",
> -				disk_super->label, devid, found_transid, path);
> +			pr_info("BTRFS: device label %s devid %llu transid %llu %s scanned-by %s\n",
> +				disk_super->label, devid, found_transid, path, current->comm);
>  		else
> -			pr_info("BTRFS: device fsid %pU devid %llu transid %llu %s\n",
> -				disk_super->fsid, devid, found_transid, path);
> +			pr_info("BTRFS: device fsid %pU devid %llu transid %llu %s scanned-by %s\n",
> +				disk_super->fsid, devid, found_transid, path, current->comm);
>  
>  	} else if (!device->name || strcmp(device->name->str, path)) {
>  		/*
> 



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux