Error codes for VFS calls
ronniesahlberg at gmail.com
Thu Oct 1 11:34:27 UTC 2020
On Thu, Oct 1, 2020 at 8:59 PM Shyam Prasad N <nspmangalore at gmail.com> wrote:
> Hi developers,
> I seek your opinions about the error codes returned by the Linux
> filesystem for the I/Os triggered by users. In general, each VFS
> system call (open, read, write, close, stat) man page defines a
> limited set of error codes returned by the call, and the meaning of
> the error, in the context of that call.
> But in many cases, especially in network based filesystems, this
> limited set of error codes may not be sufficient to indicate the exact
> problem to the user. For example, in case of SMB3, where things like
> authentication or actual mount of the filesystem may be delayed to the
> point of first I/O by the specific user on the mount point, having a
> limited set of error codes could end up confusing the user, and not
> indicate the actual error to the user.
> So my questions here:
> 1. Should the error codes be specific to the filesystem in question,
> and not just specific to the VFS system call?
> 2. Do we have any other mechanism of returning a custom error message
> to the user (the one that tells the user about the exact problem in
> more detail), other than to print this in the logs?
We are limited by what the manpage lists as valid errno values in the manpages.
This is what applications and glibc is coded against.
Other mechanisms/side-channels may be possible.
dmesg or /var/log/messages comes to mind.
But we cant break the userspace api.
More information about the samba-technical