From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, "Richard W.M. Jones" <rjones@redhat.com>,
qemu-devel@nongnu.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] qemu-nbd: only send a limited number of errno codes on the wire
Date: Fri, 08 May 2015 12:27:59 +0200 [thread overview]
Message-ID: <554C8FAF.1080207@redhat.com> (raw)
In-Reply-To: <87zj5ffkea.fsf@blackfin.pond.sub.org>
On 08/05/2015 12:12, Markus Armbruster wrote:
>> The corresponding patch to the NBD protocol description can be found at
>> http://article.gmane.org/gmane.linux.drivers.nbd.general/3154.
[...]
>> - EFBIG is part of the universal set of errors, but it is also changed
>> to ENOSPC because it is pretty similar to ENOSPC or EDQUOT.
>
> Perhaps debatable, but I defer to your judgement.
EFBIG is weird anyway, and requires you (or your parents) to ignore
SIGXFSZ. A simpler protocol puts fewer requirements on the client.
(In fact, we probably should ignore SIGXFSZ in QEMU and treat EFBIG like
ENOSPC everywhere. Should doesn't mean that it will get on anyone's
todo list or priority list...).
>> +static int nbd_errno_to_system_errno(int err)
>> +{
>> + switch (err) {
>> + case NBD_EPERM:
>> + return EPERM;
>> + case NBD_EIO:
>> + return EIO;
>> + case NBD_ENOMEM:
>> + return ENOMEM;
>> + case NBD_ENOSPC:
>> + return ENOSPC;
>> + case NBD_EINVAL:
>> + default:
>> + return EINVAL;
>> + }
>> +}
>> +
>
> If we reach default, something's amiss, isn't it? Worth logging
> something then?
Not necessarily. You could have an older NBD server on the other side,
and then the errno code might only be valid on another platform!
In fact, if the NBD server is qemu-nbd, the producer of the error could
be any driver in block/ for any old version of QEMU. I would not be
surprised if an EPIPE or ENOTCONN sneaked in somehow.
And there are probably other NBD servers around. CCing Rich Jones so
that he can fix nbdkit.
Paolo
next prev parent reply other threads:[~2015-05-08 10:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-08 9:50 [Qemu-devel] [PATCH v2] qemu-nbd: only send a limited number of errno codes on the wire Paolo Bonzini
2015-05-08 10:12 ` Markus Armbruster
2015-05-08 10:27 ` Paolo Bonzini [this message]
2015-05-08 10:40 ` Richard W.M. Jones
2015-05-08 12:35 ` Eric Blake
2015-05-08 12:40 ` Eric Blake
2015-05-08 12:41 ` Paolo Bonzini
2015-05-08 13:02 ` Eric Blake
2015-05-08 13:04 ` Paolo Bonzini
2015-05-09 14:29 ` Thomas Schwinge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=554C8FAF.1080207@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).