OpenSolaris

Printable Version Enter a New Search
Bug ID 6767292
Synopsis autofs mount option string cleanup
State 1-Dispatched (Default State)
Category:Subcategory network:automounter
Keywords oss-bite-size
Sponsor
Submitter
Reported Against snv_100
Duplicate Of
Introduced In
Commit to Fix
Fixed In
Release Fixed
Related Bugs
Submit Date 4-November-2008
Last Update Date 24-November-2008
Description
autofs may benefit from some mount option string handling, eg in
/usr/include/sys/mntent.h we do have:

#define	MNTOPT_DIRECT	"direct"	/* Automount   direct map mount */
#define	MNTOPT_INDIRECT	"indirect"	/* Automount indirect map mount */
#define	MNTOPT_IGNORE	"ignore"	/* Ignore this entry */
#define	MNTOPT_DEV	"dev"		/* Device id of mounted fs */

yet we have code like this:

usr/src/cmd/fs.d/autofs/automount.c

main()

    257 			 * Check for an overlaid direct autofs mount.
    258 			 * Cannot remount since it's inaccessible.
    259 			 */
    260 			omntp = (struct mnttab *)mntp;
    261 			if (hasmntopt(omntp, "direct") != NULL) {
[...]
    303 		(void) sprintf(mntopts, "ignore,%s",
    304 			dir->dir_direct  ? "direct" : "indirect");
[...]
    367 static char *ignore_opts[] = {"ignore", "direct", "indirect", "dev", NULL};

we may also think about introducing an MNTOPT_NEST flag as well:

    500 		 * Don't unmount autofs mounts done
    501 		 * from the autofs mount command.
    502 		 * How do we tell them apart ?
    503 		 * Autofs mounts not eligible for auto-unmount
    504 		 * have the "nest" pseudo-option.
    505 		 */
    506 		if (hasmntopt(omnt, "nest") != NULL)
    507 			continue;

/usr/src/uts/common/fs/autofs/auto_vfsops.c	172	{ "nest", NULL, NULL, MO_TAG,
/usr/src/cmd/fs.d/autofs/automount.c	504	* have the "nest" pseudo-option.
/usr/src/cmd/fs.d/autofs/automount.c	506	if (hasmntopt(omnt, "nest") != NULL)
/usr/src/cmd/fs.d/autofs/autod_autofs.c	159	* space for "nest" if it isn't already in the option string
/usr/src/cmd/fs.d/autofs/autod_autofs.c	169	(void) strcat(buf, "nest");
/usr/src/cmd/fs.d/autofs/autod_autofs.c	225	if (strcmp(opt, "nest") == 0) {
/usr/src/cmd/fs.d/autofs/mount.c	172	* Remove pseudo-options "direct", "indirect", "nest", and "ignore" from
/usr/src/cmd/fs.d/autofs/mount.c	200	} else if ((strcmp(opt, "nest") != 0) &&   

usr/src/cmd/fs.d/autofs/mount.c
  
  49 #define MNTTAB_OPTS     "ignore,nest" 
  
main:

 146         strcat(obuf, 
 147                 fni.direct ? MNTTAB_OPTS ",direct" : MNTTAB_OPTS ",indirect"); 
 
178 process_opts(char *options, int *directp) 
[...]
 196                 if (strcmp(opt, "direct") == 0) { 
 197                         *directp = 1; 
 198                 } else if (strcmp(opt, "indirect") == 0) { 
 199                         *directp = 0; 
 200                 } else if ((strcmp(opt, "nest") != 0) && 
 201                                 (strcmp(opt, "ignore") != 0)) { 

oss-bite-size
Work Around
N/A
Comments
N/A