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@xxxxxxxx> 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