Bug 163742

Summary: [patch] document failok mount(8) option
Product: Documentation Reporter: Enji Cooper <ngie>
Component: Books & ArticlesAssignee: Eitan Adler <eadler>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Enji Cooper freebsd_committer freebsd_triage 2011-12-31 19:20:11 UTC
The failok option isn't documented in mount(8). As noted in the sbin/mount/mount.c:

730                         } else if (strcmp(p, "failok") == 0) {
731                                 /*
732                                  * "failok" is used to prevent certain file
733                                  * systems from being causing the system to
734                                  * drop into single user mode in the boot
735                                  * cycle, and is not a real mount option.
736                                  */
737                                 continue;

The attached patch documents the missing option.

Fix: Patch attached with submission follows:
Comment 1 Ben Kaduk 2012-01-02 06:27:59 UTC
On Sat, 31 Dec 2011, Garrett Cooper wrote:

>> Description:
> The failok option isn't documented in mount(8). As noted in the sbin/mount/mount.c:
>
> 730                         } else if (strcmp(p, "failok") == 0) {
> 731                                 /*
> 732                                  * "failok" is used to prevent certain file
> 733                                  * systems from being causing the system to
> 734                                  * drop into single user mode in the boot
> 735                                  * cycle, and is not a real mount option.
> 736                                  */
> 737                                 continue;
>


r222832 also introduced (some) documentation of failok in fstab.5 -- do 
you feel that this is insufficient and it also needs to be documented in 
mount.8?


> The attached patch documents the missing option.
>> How-To-Repeat:
>
>> Fix:
>
>
> >
> Index: sbin/mount/mount.8
> ===================================================================
> --- sbin/mount/mount.8	(revision 228846)
> +++ sbin/mount/mount.8	(working copy)
> @@ -145,6 +145,13 @@
> .Fl u
> flag, this is the same as specifying the options currently in effect for
> the mounted file system.
> +.It Cm failok
> +This option is used to prevent certain file systems from dropping into
> +single-user mode when booting up; it is used internally in
> +.Xr mount 8
> +and thus is not a true
> +.Xr mount 2
> +flag.

It seems hard to phrase this in an unconfusing manner.
I would probably say "this option is used to indicate that if an error 
occurs during the mounting of a file system, the boot process should 
continue on normally.  This is in contrast to the normal behavior where a 
mount error will cause the system to drop into single-user mode."

-Ben
Comment 2 Enji Cooper freebsd_committer freebsd_triage 2012-01-02 07:22:23 UTC
On Sun, Jan 1, 2012 at 10:27 PM, Benjamin Kaduk <kaduk@mit.edu> wrote:
> On Sat, 31 Dec 2011, Garrett Cooper wrote:
>
>>> Description:
>>
>> The failok option isn't documented in mount(8). As noted in the
>> sbin/mount/mount.c:
>>
>> 730 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else if (strcmp(p,=
 "failok") =3D=3D 0) {
>> 731 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /*
>> 732 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*=
 "failok" is used to prevent certain
>> file
>> 733 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*=
 systems from being causing the
>> system to
>> 734 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*=
 drop into single user mode in the
>> boot
>> 735 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*=
 cycle, and is not a real mount
>> option.
>> 736 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*=
/
>> 737 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 cont=
inue;
>>
>
>
> r222832 also introduced (some) documentation of failok in fstab.5 -- do y=
ou
> feel that this is insufficient and it also needs to be documented in
> mount.8?

I look at mount*(8) before I look at fstab(5) as fstab(5) is far from
complete. I'm sure I'm not the only one.

That and I can actually use it via mount -o on the commandline makes
more sense for it to be in mount(8) than fstab(5).

>> The attached patch documents the missing option.

...

> It seems hard to phrase this in an unconfusing manner.
> I would probably say "this option is used to indicate that if an error
> occurs during the mounting of a file system, the boot process should
> continue on normally. =A0This is in contrast to the normal behavior where=
 a
> mount error will cause the system to drop into single-user mode."

I didn't really wordsmith the original text too much, as you noticed
above -- and quite frankly I wasn't happy with the text anyhow.

The proposed sentences above get the meaning across, but in a bit
roundabout manner. What about this instead?

'In the event that mounting a filesystem via rc fails, standard
behavior is that the user is dropped into the 'administrative shell'
to diagnose the mount failure. The failok option allows mount failures
to pass.

This option should be used on non-boot/-runtime critical filesystems.'

Thanks!
-Garrett
Comment 3 Ben Kaduk 2012-01-02 07:36:45 UTC
On Sun, 1 Jan 2012, Garrett Cooper wrote:

> On Sun, Jan 1, 2012 at 10:27 PM, Benjamin Kaduk <kaduk@mit.edu> wrote:
>> On Sat, 31 Dec 2011, Garrett Cooper wrote:
>>
>>>> Description:
>>>
>>> The failok option isn't documented in mount(8). As noted in the
>>> sbin/mount/mount.c:
>>>
>>> 730                         } else if (strcmp(p, "failok") == 0) {
>>> 731                                 /*
>>> 732                                  * "failok" is used to prevent certain
>>> file
>>> 733                                  * systems from being causing the
>>> system to
>>> 734                                  * drop into single user mode in the
>>> boot
>>> 735                                  * cycle, and is not a real mount
>>> option.
>>> 736                                  */
>>> 737                                 continue;
>>>
>>
>>
>> r222832 also introduced (some) documentation of failok in fstab.5 -- do you
>> feel that this is insufficient and it also needs to be documented in
>> mount.8?
>
> I look at mount*(8) before I look at fstab(5) as fstab(5) is far from
> complete. I'm sure I'm not the only one.
>
> That and I can actually use it via mount -o on the commandline makes
> more sense for it to be in mount(8) than fstab(5).
>
>>> The attached patch documents the missing option.
>
> ...
>
>> It seems hard to phrase this in an unconfusing manner.
>> I would probably say "this option is used to indicate that if an error
>> occurs during the mounting of a file system, the boot process should
>> continue on normally.  This is in contrast to the normal behavior where a
>> mount error will cause the system to drop into single-user mode."
>
> I didn't really wordsmith the original text too much, as you noticed
> above -- and quite frankly I wasn't happy with the text anyhow.
>
> The proposed sentences above get the meaning across, but in a bit
> roundabout manner. What about this instead?
>
> 'In the event that mounting a filesystem via rc fails, standard
> behavior is that the user is dropped into the 'administrative shell'
> to diagnose the mount failure. The failok option allows mount failures
> to pass.
>
> This option should be used on non-boot/-runtime critical filesystems.'


No major objections.  The "non-boot/-runtime" is a bit awkward, so I might 
prefer "should be used on file systems which are not critical for boot or 
runtime usage."

Thanks,

Ben
Comment 4 Enji Cooper freebsd_committer freebsd_triage 2012-01-02 07:50:35 UTC
On Sun, Jan 1, 2012 at 11:36 PM, Benjamin Kaduk <kaduk@mit.edu> wrote:
> On Sun, 1 Jan 2012, Garrett Cooper wrote:
>
>> On Sun, Jan 1, 2012 at 10:27 PM, Benjamin Kaduk <kaduk@mit.edu> wrote:
>>>
>>> On Sat, 31 Dec 2011, Garrett Cooper wrote:
>>>
>>>>> Description:
>>>>
>>>>
>>>> The failok option isn't documented in mount(8). As noted in the
>>>> sbin/mount/mount.c:
>>>>
>>>> 730 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else if (strcmp(=
p, "failok") =3D=3D 0) {
>>>> 731 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /*
>>>> 732 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0* "failok" is used to prevent
>>>> certain
>>>> file
>>>> 733 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0* systems from being causing the
>>>> system to
>>>> 734 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0* drop into single user mode in the
>>>> boot
>>>> 735 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0* cycle, and is not a real mount
>>>> option.
>>>> 736 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0*/
>>>> 737 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 co=
ntinue;
>>>>
>>>
>>>
>>> r222832 also introduced (some) documentation of failok in fstab.5 -- do
>>> you
>>> feel that this is insufficient and it also needs to be documented in
>>> mount.8?
>>
>>
>> I look at mount*(8) before I look at fstab(5) as fstab(5) is far from
>> complete. I'm sure I'm not the only one.
>>
>> That and I can actually use it via mount -o on the commandline makes
>> more sense for it to be in mount(8) than fstab(5).
>>
>>>> The attached patch documents the missing option.
>>
>>
>> ...
>>
>>> It seems hard to phrase this in an unconfusing manner.
>>> I would probably say "this option is used to indicate that if an error
>>> occurs during the mounting of a file system, the boot process should
>>> continue on normally. =A0This is in contrast to the normal behavior whe=
re a
>>> mount error will cause the system to drop into single-user mode."
>>
>>
>> I didn't really wordsmith the original text too much, as you noticed
>> above -- and quite frankly I wasn't happy with the text anyhow.
>>
>> The proposed sentences above get the meaning across, but in a bit
>> roundabout manner. What about this instead?
>>
>> 'In the event that mounting a filesystem via rc fails, standard
>> behavior is that the user is dropped into the 'administrative shell'
>> to diagnose the mount failure. The failok option allows mount failures
>> to pass.
>>
>> This option should be used on non-boot/-runtime critical filesystems.'
>
>
> No major objections. =A0The "non-boot/-runtime" is a bit awkward, so I mi=
ght
> prefer "should be used on file systems which are not critical for boot or
> runtime usage."

Ok. I'll whip up a new patch and submit it via reply-to with alpine.
-Garrett
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2012-05-13 23:22:24 UTC
Responsible Changed
From-To: freebsd-doc->eadler

I'll take it.
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2012-07-09 01:03:13 UTC
State Changed
From-To: open->analyzed

awaiting approval
Comment 7 dfilter service freebsd_committer freebsd_triage 2012-07-12 16:20:29 UTC
Author: eadler
Date: Thu Jul 12 15:20:20 2012
New Revision: 238399
URL: http://svn.freebsd.org/changeset/base/238399

Log:
  Document the behavior of mount with failok specified.
  
  PR:		docs/163742
  Submitted by:	gcooper
  Discussion by:	gcooper
  Discussion by:	bjk
  Approved by:	gabor
  MFC after:	3 days

Modified:
  head/sbin/mount/mount.8

Modified: head/sbin/mount/mount.8
==============================================================================
--- head/sbin/mount/mount.8	Thu Jul 12 13:54:24 2012	(r238398)
+++ head/sbin/mount/mount.8	Thu Jul 12 15:20:20 2012	(r238399)
@@ -28,7 +28,7 @@
 .\"     @(#)mount.8	8.8 (Berkeley) 6/16/94
 .\" $FreeBSD$
 .\"
-.Dd June 6, 2011
+.Dd July 12, 2012
 .Dt MOUNT 8
 .Os
 .Sh NAME
@@ -145,6 +145,11 @@ When used with the
 .Fl u
 flag, this is the same as specifying the options currently in effect for
 the mounted file system.
+.It Cm failok
+If this option is specified,
+.Nm
+will return 0 even if an error occurs
+during the mount of the filesystem.
 .It Cm force
 The same as
 .Fl f ;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 8 Eitan Adler freebsd_committer freebsd_triage 2012-07-12 16:24:02 UTC
State Changed
From-To: analyzed->patched

committed in r238399
Comment 9 dfilter service freebsd_committer freebsd_triage 2012-09-02 19:09:02 UTC
Author: eadler
Date: Sun Sep  2 18:08:41 2012
New Revision: 240033
URL: http://svn.freebsd.org/changeset/base/240033

Log:
  MFC r238399:
  	Document the behavior of mount with failok specified.
  
  PR:		docs/163742
  Approved by:	cperciva (implicit)

Modified:
  stable/9/sbin/mount/mount.8
Directory Properties:
  stable/9/sbin/mount/   (props changed)

Modified: stable/9/sbin/mount/mount.8
==============================================================================
--- stable/9/sbin/mount/mount.8	Sun Sep  2 18:04:50 2012	(r240032)
+++ stable/9/sbin/mount/mount.8	Sun Sep  2 18:08:41 2012	(r240033)
@@ -28,7 +28,7 @@
 .\"     @(#)mount.8	8.8 (Berkeley) 6/16/94
 .\" $FreeBSD$
 .\"
-.Dd June 6, 2011
+.Dd July 12, 2012
 .Dt MOUNT 8
 .Os
 .Sh NAME
@@ -145,6 +145,11 @@ When used with the
 .Fl u
 flag, this is the same as specifying the options currently in effect for
 the mounted file system.
+.It Cm failok
+If this option is specified,
+.Nm
+will return 0 even if an error occurs
+during the mount of the filesystem.
 .It Cm force
 The same as
 .Fl f ;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 10 dfilter service freebsd_committer freebsd_triage 2012-09-02 19:09:10 UTC
Author: eadler
Date: Sun Sep  2 18:08:46 2012
New Revision: 240034
URL: http://svn.freebsd.org/changeset/base/240034

Log:
  MFC r238399:
  	Document the behavior of mount with failok specified.
  
  PR:		docs/163742
  Approved by:	cperciva (implicit)

Modified:
  stable/8/sbin/mount/mount.8
Directory Properties:
  stable/8/sbin/mount/   (props changed)

Modified: stable/8/sbin/mount/mount.8
==============================================================================
--- stable/8/sbin/mount/mount.8	Sun Sep  2 18:08:41 2012	(r240033)
+++ stable/8/sbin/mount/mount.8	Sun Sep  2 18:08:46 2012	(r240034)
@@ -28,7 +28,7 @@
 .\"     @(#)mount.8	8.8 (Berkeley) 6/16/94
 .\" $FreeBSD$
 .\"
-.Dd June 6, 2011
+.Dd July 12, 2012
 .Dt MOUNT 8
 .Os
 .Sh NAME
@@ -145,6 +145,11 @@ When used with the
 .Fl u
 flag, this is the same as specifying the options currently in effect for
 the mounted file system.
+.It Cm failok
+If this option is specified,
+.Nm
+will return 0 even if an error occurs
+during the mount of the filesystem.
 .It Cm force
 The same as
 .Fl f ;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 11 Eitan Adler freebsd_committer freebsd_triage 2012-09-02 19:28:16 UTC
State Changed
From-To: patched->closed

Committed. Thanks!