btrfs-progs: convert: don't print message when fs is not recognized, ext2
authorDavid Sterba <dsterba@suse.com>
Tue, 29 Aug 2017 17:42:10 +0000 (19:42 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 8 Sep 2017 14:15:05 +0000 (16:15 +0200)
Bad magic error means it's not the desired filesystem so the error
message is just noise.

Signed-off-by: David Sterba <dsterba@suse.com>
convert/source-ext2.c

index 559669f..44d5e3a 100644 (file)
@@ -39,7 +39,8 @@ static int ext2_open_fs(struct btrfs_convert_context *cctx, const char *name)
 
        ret = ext2fs_open(name, open_flag, 0, 0, unix_io_manager, &ext2_fs);
        if (ret) {
-               fprintf(stderr, "ext2fs_open: %s\n", error_message(ret));
+               if (ret != EXT2_ET_BAD_MAGIC)
+                       fprintf(stderr, "ext2fs_open: %s\n", error_message(ret));
                return -1;
        }
        /*