All of lore.kernel.org
 help / color / mirror / Atom feed
From: Murphy Zhou <jencce.kernel@gmail.com>
To: Linux-Fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] vfs: return EINVAL instead of ENOENT when missing source
Date: Fri, 29 Mar 2019 17:18:17 +0800	[thread overview]
Message-ID: <CADJHv_tmKTqo53x-24qYFKbupv8+Y0P73UUq=EvrM8eLW_RYTQ@mail.gmail.com> (raw)
In-Reply-To: <20190318050022.7833-1-jencce.kernel@gmail.com>

Ping on this one?

Thanks!

On Mon, Mar 18, 2019 at 1:39 PM Murphy Zhou <jencce.kernel@gmail.com> wrote:
>
> mount(2) with a NULL source device would return ENOENT instead of EINVAL
> after this commit:
>
> commit f3a09c92018a91ad0981146a4ac59414f814d801
> Author: Al Viro <viro@zeniv.linux.org.uk>
> Date:   Sun Dec 23 18:55:56 2018 -0500
>
>     introduce fs_context methods
>
> Change the return value to be compatible with the old behaviour.
>
> This was caught by LTP mount02[1]. This testcase is calling mount(2) with a
> NULL device name and expecting EINVAL to PASS but now we are getting ENOENT.
>
> [1] https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/mount/mount02.c
>
> Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
> ---
>  fs/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/super.c b/fs/super.c
> index 583a0124bc39..48e51f13a4ba 100644
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -1469,7 +1469,7 @@ int vfs_get_tree(struct fs_context *fc)
>
>         if (fc->fs_type->fs_flags & FS_REQUIRES_DEV && !fc->source) {
>                 errorf(fc, "Filesystem requires source device");
> -               return -ENOENT;
> +               return -EINVAL;
>         }
>
>         if (fc->root)
> --
> 2.21.0
>

  parent reply	other threads:[~2019-03-29  9:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18  5:00 [PATCH] vfs: return EINVAL instead of ENOENT when missing source Murphy Zhou
2019-03-18 23:00 ` David Howells
2019-03-29  9:18 ` Murphy Zhou [this message]
2019-04-04  8:39 ` Murphy Zhou

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='CADJHv_tmKTqo53x-24qYFKbupv8+Y0P73UUq=EvrM8eLW_RYTQ@mail.gmail.com' \
    --to=jencce.kernel@gmail.com \
    --cc=linux-fsdevel@vger.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.