Skip to content

Commit

Permalink
sheepdog: Fix misleading error messages in sd_snapshot_create()
Browse files Browse the repository at this point in the history
If do_sd_create() fails, it first reports the error returned, then
reports a another one with strerror(errno).  errno is meaningless at
that point.

Report just one error combining the valid information from both
messages.

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Liu Yuan <namei.unix@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
Markus Armbruster authored and kevmw committed Mar 10, 2015
1 parent 354483e commit 27994d5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions block/sheepdog.c
Expand Up @@ -2339,9 +2339,8 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)

ret = do_sd_create(s, &new_vid, 1, &local_err);
if (ret < 0) {
error_report_err(local_err);
error_report("failed to create inode for snapshot. %s",
strerror(errno));
error_report("failed to create inode for snapshot: %s",
error_get_pretty(local_err));
goto cleanup;
}

Expand Down

0 comments on commit 27994d5

Please sign in to comment.