Skip to content

Commit

Permalink
nbd: Detect servers that send unexpected error values
Browse files Browse the repository at this point in the history
Add some debugging to flag servers that are not compliant to
the NBD protocol.  This would have flagged the server bug
fixed in commit c0301fc.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alex Bligh <alex@alex.org.uk>

Message-Id: <1463006384-7734-11-git-send-email-eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
ebblake authored and bonzini committed Jun 16, 2016
1 parent f57e241 commit f3c32fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nbd/client.c
Expand Up @@ -33,8 +33,10 @@ static int nbd_errno_to_system_errno(int err)
return ENOMEM;
case NBD_ENOSPC:
return ENOSPC;
case NBD_EINVAL:
default:
TRACE("Squashing unexpected error %d to EINVAL", err);
/* fallthrough */
case NBD_EINVAL:
return EINVAL;
}
}
Expand Down

0 comments on commit f3c32fc

Please sign in to comment.