linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: convert: Print different error message if convert partly failed.
@ 2015-06-09  7:57 Qu Wenruo
  2015-09-25 17:57 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Qu Wenruo @ 2015-06-09  7:57 UTC (permalink / raw)
  To: linux-btrfs

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>
---
 btrfs-convert.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/btrfs-convert.c b/btrfs-convert.c
index 9a9d619..5606156 100644
--- a/btrfs-convert.c
+++ b/btrfs-convert.c
@@ -2286,6 +2286,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;
@@ -2435,6 +2436,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) {
@@ -2455,7 +2457,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,
+			"some error happened, but still converted to btrfs\n");
+	else
+		fprintf(stderr, "conversion aborted\n");
 	return -1;
 }
 
-- 
2.4.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-26  8:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-09  7:57 [PATCH] btrfs-progs: convert: Print different error message if convert partly failed Qu Wenruo
2015-09-25 17:57 ` David Sterba
2015-09-26  8:03   ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).