summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2015-06-09 15:57:40 +0800
committerDavid Sterba <dsterba@suse.com>2015-10-07 12:13:26 +0200
commit4bdc7105428b9a372b15b03082c20909bc8ce6f0 (patch)
tree56888b0faefb604219fecfca2cc24edd66e828a9
parent8d1ed12f7992be24c75ad50dba140b15e89d0992 (diff)
btrfs-progs: convert: Print different error message if convert partly failed.
When testing under libguestfs, btrfs-convert will never succeed to fix chunk map, and always fails. But in that case, it's already a mountable btrfs. So better to info user with different error message for that case. The root cause of it is still under investigation. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--btrfs-convert.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/btrfs-convert.c b/btrfs-convert.c
index 802930c9..39eaa37a 100644
--- a/btrfs-convert.c
+++ b/btrfs-convert.c
@@ -2292,6 +2292,7 @@ static int do_convert(const char *devname, int datacsum, int packing, int noxatt
{
int i, ret, blocks_per_node;
int fd = -1;
+ int is_btrfs = 0;
u32 blocksize;
u64 blocks[7];
u64 total_bytes;
@@ -2459,6 +2460,7 @@ static int do_convert(const char *devname, int datacsum, int packing, int noxatt
fprintf(stderr, "unable to migrate super block\n");
goto fail;
}
+ is_btrfs = 1;
root = open_ctree_fd(fd, devname, 0, OPEN_CTREE_WRITES);
if (!root) {
@@ -2479,7 +2481,11 @@ static int do_convert(const char *devname, int datacsum, int packing, int noxatt
fail:
if (fd != -1)
close(fd);
- fprintf(stderr, "conversion aborted.\n");
+ if (is_btrfs)
+ fprintf(stderr,
+ "WARNING: an error occured during chunk mapping fixup, filesystem mountable but not finalized\n");
+ else
+ fprintf(stderr, "conversion aborted\n");
return -1;
}