From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 11 21:02:27 2007 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC3CE16A46E for ; Tue, 11 Dec 2007 21:02:27 +0000 (UTC) (envelope-from alepulver@FreeBSD.org) Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by mx1.freebsd.org (Postfix) with SMTP id 68EFE13C465 for ; Tue, 11 Dec 2007 21:02:26 +0000 (UTC) (envelope-from alepulver@FreeBSD.org) Received: (qmail 6470 invoked by uid 0); 11 Dec 2007 21:02:24 -0000 Received: from unknown (HELO deimos.mars.bsd) (unknown) by unknown with SMTP; 11 Dec 2007 21:02:24 -0000 X-pair-Authenticated: 200.127.53.54 Date: Tue, 11 Dec 2007 18:02:17 -0300 From: Alejandro Pulver To: Doug Barton Message-ID: <20071211180217.25498424@deimos.mars.bsd> In-Reply-To: References: <20071211001828.54e1da6b@deimos.mars.bsd> <475E0F92.3040804@FreeBSD.org> <20071211120211.133bdc3f@deimos.mars.bsd> X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.1; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/VydQ9CJs=Hzxyz1l6_ZM.IK"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: freebsd-hackers@FreeBSD.org Subject: Re: Disk sync at shutdown and fusefs filesystems X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2007 21:02:27 -0000 --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 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--