All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilya Dryomov <idryomov@gmail.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: Ceph Development <ceph-devel@vger.kernel.org>
Subject: Re: [PATCH] ceph: decoding error in ceph_update_snap_realm should return -EIO
Date: Thu, 3 Jun 2021 15:57:52 +0200	[thread overview]
Message-ID: <CAOi1vP_UFhGVP3Nf7chj9J7q12BYdKguPLudddPdJHnd3G_3WQ@mail.gmail.com> (raw)
In-Reply-To: <20210603133914.79072-1-jlayton@kernel.org>

On Thu, Jun 3, 2021 at 3:39 PM Jeff Layton <jlayton@kernel.org> wrote:
>
> Currently ceph_update_snap_realm returns -EINVAL when it hits a decoding
> error, which is the wrong error code. -EINVAL implies that the user gave
> us a bogus argument to a syscall or something similar. -EIO is more
> descriptive when we hit a decoding error.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/ceph/snap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c
> index d07c1c6ac8fb..f8cac2abab3f 100644
> --- a/fs/ceph/snap.c
> +++ b/fs/ceph/snap.c
> @@ -807,7 +807,7 @@ int ceph_update_snap_trace(struct ceph_mds_client *mdsc,
>         return 0;
>
>  bad:
> -       err = -EINVAL;
> +       err = -EIO;
>  fail:
>         if (realm && !IS_ERR(realm))
>                 ceph_put_snap_realm(mdsc, realm);

Hi Jeff,

Is this error code propagated anywhere important?

The vast majority of functions that have something to do with decoding
use EINVAL as a default (usually out-of-bounds) error.  I agree that it
is totally ambiguous, but EIO doesn't seem to be any better to me.  If
there is a desire to separate these errors, I think we need to pick
something much more distinctive.

Thanks,

                Ilya

  reply	other threads:[~2021-06-03 13:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03 13:39 [PATCH] ceph: decoding error in ceph_update_snap_realm should return -EIO Jeff Layton
2021-06-03 13:57 ` Ilya Dryomov [this message]
2021-06-03 14:02   ` Jeff Layton
2021-06-03 14:33     ` Ilya Dryomov
2021-06-03 14:42       ` Jeff Layton
2021-06-03 15:19         ` Ilya Dryomov
2021-06-03 15:20           ` Jeff Layton
2021-06-03 15:37             ` Ilya Dryomov

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=CAOi1vP_UFhGVP3Nf7chj9J7q12BYdKguPLudddPdJHnd3G_3WQ@mail.gmail.com \
    --to=idryomov@gmail.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=jlayton@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.