summaryrefslogtreecommitdiff
path: root/cmds-device.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmds-device.c')
-rw-r--r--cmds-device.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmds-device.c b/cmds-device.c
index b17b6c6f..7616c430 100644
--- a/cmds-device.c
+++ b/cmds-device.c
@@ -447,6 +447,13 @@ static int cmd_device_stats(int argc, char **argv)
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)
printf("[%s].write_io_errs %llu\n",
canonical_path,