* mount nofail: what failures should we allow ?
@ 2016-01-19 23:24 Mike Frysinger
2016-01-20 10:28 ` Karel Zak
2016-01-20 20:20 ` [PATCH] mount: allow nofail to silence ENOMEDIUM cases Mike Frysinger
0 siblings, 2 replies; 6+ messages in thread
From: Mike Frysinger @ 2016-01-19 23:24 UTC (permalink / raw)
To: util-linux
[-- Attachment #1: Type: text/plain, Size: 930 bytes --]
i've received two requests for the "nofail" option. the doc for the
option is a bit ... terse ... so it's hard to guess at the overall
intention.
(1) ignore ENOMEDIUM like:
sys-utils/mount.c could be updated to do:
case ENOMEDIUM:
if (uflags & MNT_MS_NOFAIL)
return MOUNT_EX_SUCCESS;
warnx(_("no medium found on %s"), src);
break;
this is for cases like cd/dvd drives which happens to have no disk loaded.
(2) ignore unknown fs types. e.g. when a kernel config/module is missing
support for the requested filesystem type. so a fstab entry like:
..src.. /mnt/foo somefs defaults,nofail
rather than error out with:
mount: unknown filesystem type 'somefs'
it would just issue a warning like it does for other nofail options.
if we go this route though, how far should we take it ? should we make
all failures when nofail is active the same ? i'm kind of leaning that
way ...
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: mount nofail: what failures should we allow ? 2016-01-19 23:24 mount nofail: what failures should we allow ? Mike Frysinger @ 2016-01-20 10:28 ` Karel Zak 2016-01-20 20:00 ` Mike Frysinger 2016-01-20 20:20 ` [PATCH] mount: allow nofail to silence ENOMEDIUM cases Mike Frysinger 1 sibling, 1 reply; 6+ messages in thread From: Karel Zak @ 2016-01-20 10:28 UTC (permalink / raw) To: util-linux On Tue, Jan 19, 2016 at 06:24:58PM -0500, Mike Frysinger wrote: > i've received two requests for the "nofail" option. the doc for the > option is a bit ... terse ... so it's hard to guess at the overall > intention. man mount: nofail Do not report errors for this device if it does not exist. from my point of view this description is pretty explicit :-) > (1) ignore ENOMEDIUM like: > sys-utils/mount.c could be updated to do: > case ENOMEDIUM: > if (uflags & MNT_MS_NOFAIL) > return MOUNT_EX_SUCCESS; > warnx(_("no medium found on %s"), src); > break; > this is for cases like cd/dvd drives which happens to have no disk loaded. It seems like a good idea, send patch :-) > (2) ignore unknown fs types. e.g. when a kernel config/module is missing > support for the requested filesystem type. so a fstab entry like: > ..src.. /mnt/foo somefs defaults,nofail > rather than error out with: > mount: unknown filesystem type 'somefs' > it would just issue a warning like it does for other nofail options. I'm not sure with this. It's unusual situation when any filesystem is unknown for libblkid, but it's pretty common that kernel returns EINVAL. This happen when a kernel config/module is missing, but also if you specify wrong mount options and in some another situations. I don't think we want to hide such problems. It's too generic... Karel -- Karel Zak <kzak@redhat.com> http://karelzak.blogspot.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: mount nofail: what failures should we allow ? 2016-01-20 10:28 ` Karel Zak @ 2016-01-20 20:00 ` Mike Frysinger 2016-01-21 10:18 ` Karel Zak 0 siblings, 1 reply; 6+ messages in thread From: Mike Frysinger @ 2016-01-20 20:00 UTC (permalink / raw) To: Karel Zak; +Cc: util-linux [-- Attachment #1: Type: text/plain, Size: 1870 bytes --] On 20 Jan 2016 11:28, Karel Zak wrote: > On Tue, Jan 19, 2016 at 06:24:58PM -0500, Mike Frysinger wrote: > > i've received two requests for the "nofail" option. the doc for the > > option is a bit ... terse ... so it's hard to guess at the overall > > intention. > > man mount: > nofail Do not report errors for this device if it does not exist. > > from my point of view this description is pretty explicit :-) does it mean the device node doesn't exist (ENOENT) ? or does it also accept the node being there, but returning other errors like ENXIO (the driver isn't loaded) or ENOTDIR (bad path) or ENOTBLK (used a bad path like /dev/zero) or ENOMEDIUM (the node & hardware exists, but is not loaded) ? there's probably other errno values you could catch here. surely you agree that "does not exist" does not cover all these cases. or at the very least, it's pretty ambiguous/fuzzy. > > (2) ignore unknown fs types. e.g. when a kernel config/module is missing > > support for the requested filesystem type. so a fstab entry like: > > ..src.. /mnt/foo somefs defaults,nofail > > rather than error out with: > > mount: unknown filesystem type 'somefs' > > it would just issue a warning like it does for other nofail options. > > I'm not sure with this. It's unusual situation when any filesystem is unknown > for libblkid, but it's pretty common that kernel returns EINVAL. This > happen when a kernel config/module is missing, but also if you specify > wrong mount options and in some another situations. I don't think we > want to hide such problems. It's too generic... i think there's a lot going on in this response. let me distill it a bit. if i have a reiserfs that is usable, but i forgot to enable or load the reiserfs kernel driver, should nofail be allowed to skip ? or is this a hard failure ? -mike [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: mount nofail: what failures should we allow ? 2016-01-20 20:00 ` Mike Frysinger @ 2016-01-21 10:18 ` Karel Zak 0 siblings, 0 replies; 6+ messages in thread From: Karel Zak @ 2016-01-21 10:18 UTC (permalink / raw) To: util-linux On Wed, Jan 20, 2016 at 03:00:28PM -0500, Mike Frysinger wrote: > On 20 Jan 2016 11:28, Karel Zak wrote: > > On Tue, Jan 19, 2016 at 06:24:58PM -0500, Mike Frysinger wrote: > > > i've received two requests for the "nofail" option. the doc for the > > > option is a bit ... terse ... so it's hard to guess at the overall > > > intention. > > > > man mount: > > nofail Do not report errors for this device if it does not exist. > > > > from my point of view this description is pretty explicit :-) > > does it mean the device node doesn't exist (ENOENT) ? or does it also > accept the node being there, but returning other errors like ENXIO (the > driver isn't loaded) or ENOTDIR (bad path) or ENOTBLK (used a bad path > like /dev/zero) or ENOMEDIUM (the node & hardware exists, but is not > loaded) ? there's probably other errno values you could catch here. > > surely you agree that "does not exist" does not cover all these cases. > or at the very least, it's pretty ambiguous/fuzzy. now we use "nofail" if: - impossible to translate UUID/LABEL/etc to device name - mount(2) returns ENOENT and stat() on source fails - mount(2) returns ENOTDIR and stat() on source fails with ENOTDIR - mount(2) returns ENOTBLK - mount(2) returns ENXIO - and ENOMEDIUM now ... well, maybe we can improve the description in the man page to make it more user friendly. > > > (2) ignore unknown fs types. e.g. when a kernel config/module is missing > > > support for the requested filesystem type. so a fstab entry like: > > > ..src.. /mnt/foo somefs defaults,nofail > > > rather than error out with: > > > mount: unknown filesystem type 'somefs' > > > it would just issue a warning like it does for other nofail options. > > > > I'm not sure with this. It's unusual situation when any filesystem is unknown > > for libblkid, but it's pretty common that kernel returns EINVAL. This > > happen when a kernel config/module is missing, but also if you specify > > wrong mount options and in some another situations. I don't think we > > want to hide such problems. It's too generic... > > i think there's a lot going on in this response. let me distill it a > bit. if i have a reiserfs that is usable, but i forgot to enable or > load the reiserfs kernel driver, should nofail be allowed to skip ? > or is this a hard failure ? Now it's hard failure and I'm fine with it ;) In this case kernel returns EINVAL -- the problem is that kernel uses EINVAL it in another situations too. It makes "nofail" very problematic for this use-case, because we're not able to detect that you have no reiserfs driver. Frankly, people will ask for "nofail" extension all time... Karel -- Karel Zak <kzak@redhat.com> http://karelzak.blogspot.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] mount: allow nofail to silence ENOMEDIUM cases 2016-01-19 23:24 mount nofail: what failures should we allow ? Mike Frysinger 2016-01-20 10:28 ` Karel Zak @ 2016-01-20 20:20 ` Mike Frysinger 2016-01-21 9:51 ` Karel Zak 1 sibling, 1 reply; 6+ messages in thread From: Mike Frysinger @ 2016-01-20 20:20 UTC (permalink / raw) To: util-linux Allow people to use nofail to ignore empty cd/dvd drive errors. URL: https://bugs.gentoo.org/559356 Reported-by: William Hubbs <williamh@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org> --- sys-utils/mount.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys-utils/mount.c b/sys-utils/mount.c index 73f9d0b..01eaccb 100644 --- a/sys-utils/mount.c +++ b/sys-utils/mount.c @@ -628,6 +628,9 @@ try_readonly: break; case ENOMEDIUM: + if (uflags & MNT_MS_NOFAIL) + return MOUNT_EX_SUCCESS; + warnx(_("no medium found on %s"), src); break; -- 2.6.2 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] mount: allow nofail to silence ENOMEDIUM cases 2016-01-20 20:20 ` [PATCH] mount: allow nofail to silence ENOMEDIUM cases Mike Frysinger @ 2016-01-21 9:51 ` Karel Zak 0 siblings, 0 replies; 6+ messages in thread From: Karel Zak @ 2016-01-21 9:51 UTC (permalink / raw) To: Mike Frysinger; +Cc: util-linux On Wed, Jan 20, 2016 at 03:20:08PM -0500, Mike Frysinger wrote: > sys-utils/mount.c | 3 +++ > 1 file changed, 3 insertions(+) Applied, thanks. -- Karel Zak <kzak@redhat.com> http://karelzak.blogspot.com ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-01-21 10:18 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-01-19 23:24 mount nofail: what failures should we allow ? Mike Frysinger 2016-01-20 10:28 ` Karel Zak 2016-01-20 20:00 ` Mike Frysinger 2016-01-21 10:18 ` Karel Zak 2016-01-20 20:20 ` [PATCH] mount: allow nofail to silence ENOMEDIUM cases Mike Frysinger 2016-01-21 9:51 ` Karel Zak
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.