Subject: bin/3495: I want amd timeout for ffs.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <koji@math.human.nagoya-u.ac.jp>
List: netbsd-bugs
Date: 04/15/1997 16:17:31
>Number:         3495
>Category:       bin
>Synopsis:       amd timeout for ffs.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 15 05:05:01 1997
>Last-Modified:
>Originator:     Koji Imada - je4owb/2
>Organization:
Mathematics Group of Graduate School of Human
	Infomatics, Nagoya University, Japan.
>Release:        970413
>Environment:
	
System: NetBSD bimota 1.2D NetBSD 1.2D (BIMOTA) #3: Thu Apr 10 05:13:13 JST 1997 koji@ducati:/mnt2/NetBSD/work/src-ipv6/sys/arch/i386/compile/BIMOTA i386


>Description:
	In current amd implementation, amd never unmount ffs file
	system for any timeout value. This patches add option
	'unmount' for ffs to enable unmount for ffs on timeout.

	This is useful to use ffs on removable media(like MO).
>How-To-Repeat:
	
>Fix:
	apply following patch.

Index: usr.sbin/amd/amd//util.c
===================================================================
RCS file: /mnt2/NetBSD/cvsroot/netbsd/usr.sbin/amd/amd/util.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 util.c
*** util.c	1997/04/01 07:49:02	1.1.1.2
--- util.c	1997/04/15 05:09:03
***************
*** 394,400 ****
  	 * Check whether this mount should be cached permanently
  	 */
  	if (mf->mf_ops->fs_flags & FS_NOTIMEOUT) {
! 		mp->am_flags |= AMF_NOTIMEOUT;
  	} else if (mf->mf_mount[1] == '\0' && mf->mf_mount[0] == '/') {
  		mp->am_flags |= AMF_NOTIMEOUT;
  	} else {
--- 394,406 ----
  	 * Check whether this mount should be cached permanently
  	 */
  	if (mf->mf_ops->fs_flags & FS_NOTIMEOUT) {
! 		struct mntent mnt;
! 		mnt.mnt_opts = mf->mf_mopts;
! 
! 		if (mf->mf_mopts && hasmntopt(&mnt, "unmount"))
! 			mp->am_flags &= ~AMF_NOTIMEOUT;
! 		else
! 			mp->am_flags |= AMF_NOTIMEOUT;
  	} else if (mf->mf_mount[1] == '\0' && mf->mf_mount[0] == '/') {
  		mp->am_flags |= AMF_NOTIMEOUT;
  	} else {
***************
*** 403,408 ****
--- 409,416 ----
  			mnt.mnt_opts = mf->mf_mopts;
  			if (hasmntopt(&mnt, "nounmount"))
  				mp->am_flags |= AMF_NOTIMEOUT;
+ 			if (hasmntopt(&mnt, "unmount"))
+ 				mp->am_flags &= ~AMF_NOTIMEOUT;
  			if ((mp->am_timeo = hasmntval(&mnt, "utimeout")) == 0)
  				mp->am_timeo = am_timeo;
  		}
>Audit-Trail:
>Unformatted: