Commit 79dae17d authored by Anand Jain's avatar Anand Jain Committed by David Sterba

btrfs: improve device scanning messages

Systems booting without the initramfs seems to scan an unusual kind
of device path (/dev/root). And at a later time, the device is updated
to the correct path. We generally print the process name and PID of the
process scanning the device but we don't capture the same information if
the device path is rescanned with a different pathname.

The current message is too long, so drop the unnecessary UUID and add
process name and PID.

While at this also update the duplicate device warning to include the
process name and PID so the messages are consistent

CC: stable@vger.kernel.org # 4.19+
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=89721Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 457f1864
...@@ -941,16 +941,18 @@ static noinline struct btrfs_device *device_list_add(const char *path, ...@@ -941,16 +941,18 @@ static noinline struct btrfs_device *device_list_add(const char *path,
bdput(path_bdev); bdput(path_bdev);
mutex_unlock(&fs_devices->device_list_mutex); mutex_unlock(&fs_devices->device_list_mutex);
btrfs_warn_in_rcu(device->fs_info, btrfs_warn_in_rcu(device->fs_info,
"duplicate device fsid:devid for %pU:%llu old:%s new:%s", "duplicate device %s devid %llu generation %llu scanned by %s (%d)",
disk_super->fsid, devid, path, devid, found_transid,
rcu_str_deref(device->name), path); current->comm,
task_pid_nr(current));
return ERR_PTR(-EEXIST); return ERR_PTR(-EEXIST);
} }
bdput(path_bdev); bdput(path_bdev);
btrfs_info_in_rcu(device->fs_info, btrfs_info_in_rcu(device->fs_info,
"device fsid %pU devid %llu moved old:%s new:%s", "devid %llu device path %s changed to %s scanned by %s (%d)",
disk_super->fsid, devid, devid, rcu_str_deref(device->name),
rcu_str_deref(device->name), path); path, current->comm,
task_pid_nr(current));
} }
name = rcu_string_strdup(path, GFP_NOFS); name = rcu_string_strdup(path, GFP_NOFS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment