mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-16 17:56:51 +00:00
btrfs-progs: device stats: Print devid instead of null
Print e.g. "[devid:4].write_io_errs 6" instead of "[(null)].write_io_errs 6" when device is missing. Signed-off-by: Patrik Lundquist <patrik.lundquist@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
972cfbe32f
commit
a963abc3d3
@ -447,6 +447,13 @@ static int cmd_device_stats(int argc, char **argv)
|
|||||||
|
|
||||||
canonical_path = canonicalize_path((char *)path);
|
canonical_path = canonicalize_path((char *)path);
|
||||||
|
|
||||||
|
/* No path when device is missing. */
|
||||||
|
if (!canonical_path) {
|
||||||
|
canonical_path = malloc(32);
|
||||||
|
snprintf(canonical_path, 32,
|
||||||
|
"devid:%llu", args.devid);
|
||||||
|
}
|
||||||
|
|
||||||
if (args.nr_items >= BTRFS_DEV_STAT_WRITE_ERRS + 1)
|
if (args.nr_items >= BTRFS_DEV_STAT_WRITE_ERRS + 1)
|
||||||
printf("[%s].write_io_errs %llu\n",
|
printf("[%s].write_io_errs %llu\n",
|
||||||
canonical_path,
|
canonical_path,
|
||||||
|
Loading…
Reference in New Issue
Block a user