mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-27 07:53:27 +00:00
btrfs-progs: convert: update error message to reflect original fs unmodified cases
The original fs is not touched until we migrate the super blocks. Under most error cases, we fail before that thus the original fs is still safe. So change the error message according the stages we failed to reflect that. Signed-off-by: Qu Wenruo <wqu@suse.com> [ adjust wording of messages ] Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
b79fdc0ac3
commit
5587635716
@ -1123,6 +1123,7 @@ static int do_convert(const char *devname, u32 convert_flags, u32 nodesize,
|
||||
struct task_ctx ctx;
|
||||
char features_buf[64];
|
||||
struct btrfs_mkfs_config mkfs_cfg;
|
||||
bool btrfs_sb_committed = false;
|
||||
|
||||
init_convert_context(&cctx);
|
||||
ret = convert_open_fs(devname, &cctx);
|
||||
@ -1270,6 +1271,7 @@ static int do_convert(const char *devname, u32 convert_flags, u32 nodesize,
|
||||
error("unable to migrate super block: %d", ret);
|
||||
goto fail;
|
||||
}
|
||||
btrfs_sb_committed = true;
|
||||
|
||||
root = open_ctree_fd(fd, devname, 0,
|
||||
OPEN_CTREE_WRITES | OPEN_CTREE_TEMPORARY_SUPER);
|
||||
@ -1287,8 +1289,12 @@ fail:
|
||||
clean_convert_context(&cctx);
|
||||
if (fd != -1)
|
||||
close(fd);
|
||||
warning(
|
||||
"an error occurred during conversion, filesystem is partially created but not finalized and not mountable");
|
||||
if (btrfs_sb_committed)
|
||||
warning(
|
||||
"error during conversion, filesystem is partially created but not finalized and not mountable");
|
||||
else
|
||||
warning(
|
||||
"error during conversion, the original filesystem is not modified");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user