2
0
mirror of git://github.com/lxc/lxc synced 2025-08-30 18:39:37 +00:00

zfs: return error directly when zfs creation fails

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner
2017-09-20 10:13:30 +02:00
parent 364c5d97de
commit 24f84f1e31

View File

@@ -754,12 +754,14 @@ int zfs_create(struct lxc_storage *bdev, const char *dest, const char *n,
cmd_args.argv = argv;
ret = run_command(cmd_output, sizeof(cmd_output),
zfs_create_exec_wrapper, (void *)&cmd_args);
if (ret < 0)
if (ret < 0) {
ERROR("Failed to create zfs dataset \"%s\": %s", bdev->src, cmd_output);
else if (cmd_output[0] != '\0')
return -1;
} else if (cmd_output[0] != '\0') {
INFO("Created zfs dataset \"%s\": %s", bdev->src, cmd_output);
else
} else {
TRACE("Created zfs dataset \"%s\"", bdev->src);
}
ret = mkdir_p(bdev->dest, 0755);
if (ret < 0 && errno != EEXIST) {