Date: Tue, 11 Dec 2007 18:02:17 -0300 From: Alejandro Pulver <alepulver@FreeBSD.org> To: Doug Barton <dougb@FreeBSD.org> Cc: freebsd-hackers@FreeBSD.org Subject: Re: Disk sync at shutdown and fusefs filesystems Message-ID: <20071211180217.25498424@deimos.mars.bsd> In-Reply-To: <alpine.BSF.0.999999.0712111219070.97221@ync.qbhto.arg> References: <20071211001828.54e1da6b@deimos.mars.bsd> <475E0F92.3040804@FreeBSD.org> <20071211120211.133bdc3f@deimos.mars.bsd> <alpine.BSF.0.999999.0712111219070.97221@ync.qbhto.arg>
next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/VydQ9CJs=Hzxyz1l6_ZM.IK Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 11 Dec 2007 12:22:35 -0800 (PST) Doug Barton <dougb@FreeBSD.org> wrote: > On Tue, 11 Dec 2007, Alejandro Pulver wrote: >=20 > > Thanks, here is what I've got so far: it seems /dev/fuse[0-9]* devices > > aren't removed after the corresponding filesystem is unmounted (I guess > > they are reused), so instead of listing /dev the list has to be taken > > from 'mount'. >=20 > Yeah, I think that's better than using fstab anyway, since this way we ge= t=20 > them all with limited processing. Wish I'd thought of it. :) >=20 Actually, I tried first with "umount -a -t {fusefs,ntfs-3g,fuse,...}" but didn't work. > > Also there should be a delay between the 'umount' and > > 'kldunload' commands. What do you think about the following > > (replacement for fusefs_stop function)? >=20 > I suppose this is mostly a style difference, but I like to avoid all thos= e=20 > subshells if we can. I also think it might be a good idea to wait a secon= d=20 > between unmounts, just to be paranoid. How about: >=20 > mount | while read dev d1 mountpoint d2; do > case "$dev" in > /dev/fuse[0-9]*) umount $mountpoint ; sleep 1 ;; > esac > done > sleep 1 >=20 It looks fine to me. And what about echoing the mountpoints as they are unmounted? mount | while read dev d1 mountpoint d2; do case "$dev" in /dev/fuse[0-9]*) echo "fusefs: unmounting ${mountpoint}." umount $mountpoint ; sleep 1 ;; esac done Also this checks would avoid kldload/kldunload errors: In fusefs_start: if kldstat | grep -q fuse\\.ko; then echo "${name} is already running." return 0 fi In fusefs_stop: if ! kldstat | grep -q fuse\\.ko; then echo "${name} is not running." return 1 fi Well, the word "loaded" instead of "running" would be better. Also a status command could be added, but I don't think it's needed. Also=20 --Sig_/VydQ9CJs=Hzxyz1l6_ZM.IK Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHXvrZiV05EpRcP2ERAkxYAJ9/p7D/P8+/ES432Mtf/t4FZtaylwCfY/2N poiHn7R14BPBa+y8FeTfQks= =IzHj -----END PGP SIGNATURE----- --Sig_/VydQ9CJs=Hzxyz1l6_ZM.IK--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071211180217.25498424>