From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Dec 17 03:50:01 2007 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6809A16A46E for ; Mon, 17 Dec 2007 03:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4B5D013C45B for ; Mon, 17 Dec 2007 03:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBH3o1BI074105 for ; Mon, 17 Dec 2007 03:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBH3o1Fd074104; Mon, 17 Dec 2007 03:50:01 GMT (envelope-from gnats) Resent-Date: Mon, 17 Dec 2007 03:50:01 GMT Resent-Message-Id: <200712170350.lBH3o1Fd074104@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Alejandro Pulver" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A410016A418 for ; Mon, 17 Dec 2007 03:45:26 +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 50C0E13C465 for ; Mon, 17 Dec 2007 03:45:26 +0000 (UTC) (envelope-from alepulver@FreeBSD.org) Received: (qmail 38041 invoked from network); 17 Dec 2007 03:45:23 -0000 Received: from unknown (HELO deimos.mars.bsd) (unknown) by unknown with SMTP; 17 Dec 2007 03:45:23 -0000 Message-Id: <1197863127.49445@deimos.mars.bsd> Date: Mon, 17 Dec 2007 00:45:27 -0300 From: "Alejandro Pulver" To: "FreeBSD gnats submit" X-Send-Pr-Version: gtk-send-pr 0.4.8 Cc: Subject: ports/118758: [PATCH] sysutils/fusefs-kmod: bug fixes from Hg repo, data corruption workaround X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2007 03:50:01 -0000 >Number: 118758 >Category: ports >Synopsis: [PATCH] sysutils/fusefs-kmod: bug fixes from Hg repo, data corruption workaround >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Mon Dec 17 03:50:00 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Alejandro Pulver >Release: FreeBSD 6.2-RELEASE i386 >Organization: >Environment: System: FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP >Description: - Bump PORTREVISION. - Add checks in rc.d scripts to avoid "double" loading/unloading. - Add patch-fuse_io.c (fix from http://mercurial.creo.hu/repos/fuse4bsd-hg/?rev/d7bf90a8cc85). - Handle "nonempty" option by ignoring it, used by ntfs-3g (http://mercurial.creo.hu/repos/fuse4bsd-hg/?rev/aef999f12049). - In the rc.d script unmount FUSE filesystem in the "stop" command, in reverse order in case the mounts are nested, waiting one second after each. This is a temporary workaround for umount returning before the cache has been flushed (which causes for example files not being written to the disk), a proper solution is being worked on. - Add note in pkg-message about "stop" rc.d command unmounting FUSE filesystems. >How-To-Repeat: >Fix: --- fusefs-kmod.diff begins here --- Index: fusefs-kmod/Makefile =================================================================== RCS file: /home/pcvs/ports/sysutils/fusefs-kmod/Makefile,v retrieving revision 1.16 diff -u -r1.16 Makefile --- fusefs-kmod/Makefile 15 Nov 2007 19:46:42 -0000 1.16 +++ fusefs-kmod/Makefile 17 Dec 2007 03:34:41 -0000 @@ -7,7 +7,7 @@ PORTNAME= fusefs DISTVERSION= 0.3.9-pre1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= sysutils kld MASTER_SITES= http://fuse4bsd.creo.hu/downloads/ \ http://am-productions.biz/docs/ Index: fusefs-kmod/files/fusefs.in =================================================================== RCS file: /home/pcvs/ports/sysutils/fusefs-kmod/files/fusefs.in,v retrieving revision 1.4 diff -u -r1.4 fusefs.in --- fusefs-kmod/files/fusefs.in 30 Oct 2007 03:10:09 -0000 1.4 +++ fusefs-kmod/files/fusefs.in 17 Dec 2007 03:34:41 -0000 @@ -25,13 +25,31 @@ fusefs_start() { + if kldstat | grep -q fuse\\.ko; then + echo "${name} is already running." + return 0 + fi echo "Starting ${name}." kldload $kmod } fusefs_stop() { + if ! kldstat | grep -q fuse\\.ko; then + echo "${name} is not running." + return 1 + fi echo "Stopping ${name}." +# Unmount FUSE filesystems in reverse order (in case they are nested) with +# a delay of one second after, to allow 'umount' finish. + mount | sed -e '1!G;h;$!d' | while read dev d1 mountpoint d2; do + case "$dev" in + /dev/fuse[0-9]*) + echo "fusefs: unmounting ${mountpoint}." + umount $mountpoint ; sleep 1 + ;; + esac + done kldunload $kmod } load_rc_config $name Index: fusefs-kmod/files/patch-fuse_io.c =================================================================== RCS file: fusefs-kmod/files/patch-fuse_io.c diff -N fusefs-kmod/files/patch-fuse_io.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ fusefs-kmod/files/patch-fuse_io.c 17 Dec 2007 03:34:41 -0000 @@ -0,0 +1,11 @@ +--- fuse_module/fuse_io.c.orig Tue Jun 19 09:35:22 2007 ++++ fuse_module/fuse_io.c Thu Dec 13 02:46:05 2007 +@@ -148,7 +148,7 @@ + } + + if (uio->uio_resid == 0) +- return (0); ++ goto out; + + if (uio->uio_rw == UIO_WRITE && fp->f_flag & O_APPEND) { + if ((err = VOP_GETATTR(vp, &va, cred, td))) Index: fusefs-kmod/files/patch-mount_fusefs-mount_fusefs.c =================================================================== RCS file: /home/pcvs/ports/sysutils/fusefs-kmod/files/patch-mount_fusefs-mount_fusefs.c,v retrieving revision 1.1 diff -u -r1.1 patch-mount_fusefs-mount_fusefs.c --- fusefs-kmod/files/patch-mount_fusefs-mount_fusefs.c 13 Aug 2007 10:48:41 -0000 1.1 +++ fusefs-kmod/files/patch-mount_fusefs-mount_fusefs.c 17 Dec 2007 03:34:41 -0000 @@ -1,6 +1,15 @@ ---- mount_fusefs/mount_fusefs.c Sat Jul 14 13:12:09 2007 -+++ mount_fusefs/mount_fusefs.c Sat Jul 14 13:12:09 2007 -@@ -469,7 +469,8 @@ showversion(void) +--- mount_fusefs/mount_fusefs.c.orig Tue Jun 19 09:35:22 2007 ++++ mount_fusefs/mount_fusefs.c Thu Dec 13 02:44:12 2007 +@@ -70,6 +70,8 @@ + { "user_id=", 0, 0x00, 1 }, + { "group_id=", 0, 0x00, 1 }, + { "large_read", 0, 0x00, 1 }, ++ /* "nonempty", just the first two chars are stripped off during parsing */ ++ { "nempty", 0, 0x00, 1 }, + MOPT_STDOPTS, + MOPT_END + }; +@@ -469,7 +471,8 @@ int init_backgrounded(void) { @@ -9,3 +18,4 @@ + size_t len; len = sizeof(ibg); + Index: fusefs-kmod/files/pkg-message.in =================================================================== RCS file: /home/pcvs/ports/sysutils/fusefs-kmod/files/pkg-message.in,v retrieving revision 1.1 diff -u -r1.1 pkg-message.in --- fusefs-kmod/files/pkg-message.in 30 Oct 2007 03:10:09 -0000 1.1 +++ fusefs-kmod/files/pkg-message.in 17 Dec 2007 03:34:41 -0000 @@ -12,4 +12,9 @@ /etc/fstab with the "late" parameter. This requires a symlink in /usr/sbin named "mount_", which is not created by all the fusefs ports. +Note that the rc.d script will unmount all fuse filesystems when called with +"stop", so it can unload the kernel module, and as a temporary workaround to +flush cache in drivers like NTFS-3G (sysutils/fusefs-ntfs) at shutdown (until +a proper solution is implemented). + ============================================================================== --- fusefs-kmod.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: