btrfs-progs: better error report in btrfs_scan_fs_devices
authorDavid Sterba <dsterba@suse.com>
Fri, 9 Sep 2016 13:56:18 +0000 (15:56 +0200)
committerDavid Sterba <dsterba@suse.com>
Wed, 21 Sep 2016 09:49:48 +0000 (11:49 +0200)
Print the found sizes.

Signed-off-by: David Sterba <dsterba@suse.com>
disk-io.c

index 7c52f12..2fd3330 100644 (file)
--- a/disk-io.c
+++ b/disk-io.c
@@ -1149,7 +1149,9 @@ int btrfs_scan_fs_devices(int fd, const char *path,
        dev_size = seek_ret;
        lseek(fd, 0, SEEK_SET);
        if (sb_bytenr > dev_size) {
-               fprintf(stderr, "Superblock bytenr is larger than device size\n");
+               error("superblock bytenr %llu is larger than device size %llu",
+                               (unsigned long long)sb_bytenr,
+                               (unsigned long long)dev_size);
                return -EINVAL;
        }