linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve French <smfrench@gmail.com>
To: "Aurélien Aptel" <aaptel@suse.com>
Cc: David Howells <dhowells@redhat.com>,
	CIFS <linux-cifs@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [EXPERIMENT v2] new mount API verbose errors from userspace
Date: Thu, 8 Apr 2021 23:36:38 -0500	[thread overview]
Message-ID: <CAH2r5mve+EXFnkwVzRz2xuhNEMVgdWLZrSNcLFqhZKF4Hsxvug@mail.gmail.com> (raw)
In-Reply-To: <87eegcsj31.fsf@suse.com>

Tentatively merged into cifs-2.6.git for-next but would like more
feedback on other's thoughts on this. Getting more verbose error
information back on mount errors (to userspace returning something
more than a primitive small set of return codes, and a message logged
to dmesg) is critical, and this approach seems reasonable at first
glance but if there are better ways ...

On Thu, Mar 18, 2021 at 8:12 AM Aurélien Aptel <aaptel@suse.com> wrote:
>
>
> Since there's no standard VFS way to get the supported mount options
> from userspace, I thought I would do what Ronnie suggested and export
> them from a cifs /proc file.
> That's the only change since v1, in the 4th patch.
>
> David, maybe this can give your arguments for the need for fsinfo() if
> we end up using this in cifs-utils.
>
> I have added some dumb code in userspace to parse it and see if the
> option exists and what type it is. This removes the requirement of
> having to keep cifs-utils and kernel updated at the same time to use new
> options.
>
> Previous intro
> =======================================================================
> I have some code to use the new mount API from user space.
>
> The kernel changes are just making the code use the fs_context logging
> feature.
>
> The sample userspace prog (fsopen.c attached) is just a PoC showing how
> mounting is done and how the mount errors are read.
>
> If you change the prog to use a wrong version for example (vers=4.0) you
> get this:
>
>     $ gcc -o fsopen fsopen.c
>     $ ./fsopen
>     fsconfig(sfd, FSCONFIG_SET_STRING, "vers", "4.0", 0): Invalid argument
>     kernel mount errors:
>     e Unknown vers= option specified: 4.0
>
> The pros are that we process one option at a time and we can fail early
> with verbose, helpful messages to the user.
> =======================================================================
>
>
>
> Cheers,
> --
> Aurélien Aptel / SUSE Labs Samba Team
> GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
> SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
> GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)



-- 
Thanks,

Steve

  reply	other threads:[~2021-04-09  4:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 18:56 [EXPERIMENT] new mount API verbose errors from userspace Aurélien Aptel
2021-03-01 20:57 ` Aurélien Aptel
2021-03-02 21:59 ` ronnie sahlberg
2021-03-03 11:18   ` Aurélien Aptel
2021-03-09 17:37   ` David Howells
2021-03-09 18:29     ` Aurélien Aptel
2021-03-18 13:10       ` [EXPERIMENT v2] " Aurélien Aptel
2021-04-09  4:36         ` Steve French [this message]
2021-04-12 17:52           ` [EXPERIMENT v3] " Aurélien Aptel

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=CAH2r5mve+EXFnkwVzRz2xuhNEMVgdWLZrSNcLFqhZKF4Hsxvug@mail.gmail.com \
    --to=smfrench@gmail.com \
    --cc=aaptel@suse.com \
    --cc=dhowells@redhat.com \
    --cc=linux-cifs@vger.kernel.org \
    --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 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).