Skip to content

Commit 4190caf

Browse files
asjgregkh
authored andcommitted
btrfs: improve device scanning messages
commit 79dae17 upstream. 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=89721 Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 27e7868 commit 4190caf

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

fs/btrfs/volumes.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -942,16 +942,18 @@ static noinline struct btrfs_device *device_list_add(const char *path,
942942
bdput(path_bdev);
943943
mutex_unlock(&fs_devices->device_list_mutex);
944944
btrfs_warn_in_rcu(device->fs_info,
945-
"duplicate device fsid:devid for %pU:%llu old:%s new:%s",
946-
disk_super->fsid, devid,
947-
rcu_str_deref(device->name), path);
945+
"duplicate device %s devid %llu generation %llu scanned by %s (%d)",
946+
path, devid, found_transid,
947+
current->comm,
948+
task_pid_nr(current));
948949
return ERR_PTR(-EEXIST);
949950
}
950951
bdput(path_bdev);
951952
btrfs_info_in_rcu(device->fs_info,
952-
"device fsid %pU devid %llu moved old:%s new:%s",
953-
disk_super->fsid, devid,
954-
rcu_str_deref(device->name), path);
953+
"devid %llu device path %s changed to %s scanned by %s (%d)",
954+
devid, rcu_str_deref(device->name),
955+
path, current->comm,
956+
task_pid_nr(current));
955957
}
956958

957959
name = rcu_string_strdup(path, GFP_NOFS);

0 commit comments

Comments
 (0)