As described in ports/122907 fusefs keeps a lot of things in memory and only writes them back when a filsystem is unmounted. During shutdown the time to write things back is often not sufficient, hence the shutdown script contains code that is meant to stall shutdown until the writing back is finished (this is detected by trying to unload the fusefs kernel module). Unfortunately the script is often shot down by the shutdown watchdog (see rc.shutdown). How-To-Repeat: Do some heavy writing on a fusefs file system, like ntfs-3g and shutdown immediately afterwards. You'll see the watchdog kill the shutdown process and some of the files will definitely not be there any more upon the next boot. The file system will be in requirement of a file system check.
Maintainer of sysutils/fusefs-kmod, Please note that PR ports/124901 has just been submitted. If it contains a patch for an upgrade, an enhancement or a bug fix you agree on, reply to this email stating that you approve the patch and a committer will take care of it. The full text of the PR can be found at: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/124901 -- Edwin Groothuis via the GNATS Auto Assign Tool edwin@FreeBSD.org
State Changed From-To: open->feedback Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Hi, how long does the shutdown procedure take? Wouldn't it be feasible/a better solution to set rcshutdown_timeout in /etc/rc.conf? If not: Anish, is it OK to commit this patch [1]? Best regards, Stefan [1]: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/124901
Responsible Changed From-To: freebsd-ports-bugs->stefan Take.
On Friday 10 October 2008, Stefan Walter wrote: > Hi, > > how long does the shutdown procedure take? Wouldn't it be feasible/a > better solution to set rcshutdown_timeout in /etc/rc.conf? If not: Anish, > is it OK to commit this patch [1]? > > Best regards, > Stefan > > [1]: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/124901 I still don't think this is the right way to do it. It really needs to be fixed in the module, but if it works for some people then make it a configurable knob that they can enable for them. -- Anish Mistry
Anish Mistry, 12.10.08, 00:25h CEST: > On Friday 10 October 2008, Stefan Walter wrote: > > Hi, > > > > how long does the shutdown procedure take? Wouldn't it be feasible/a > > better solution to set rcshutdown_timeout in /etc/rc.conf? If not: Anish, > > is it OK to commit this patch [1]? > > > > Best regards, > > Stefan > > > > [1]: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/124901 > I still don't think this is the right way to do it. It really needs to be > fixed in the module, but if it works for some people then make it a > configurable knob that they can enable for them. I agree that this issue looks like it should be fixed upstream. Does the author know about it? (A quick glance over the project's mailing list revealed nothing to me.) Best regards, Stefan
On Tuesday 14 October 2008, Stefan Walter wrote: > Anish Mistry, 12.10.08, 00:25h CEST: > > On Friday 10 October 2008, Stefan Walter wrote: > > > Hi, > > > > > > how long does the shutdown procedure take? Wouldn't it be feasible/a > > > better solution to set rcshutdown_timeout in /etc/rc.conf? If not: > > > Anish, is it OK to commit this patch [1]? > > > > > > Best regards, > > > Stefan > > > > > > [1]: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/124901 > > > > I still don't think this is the right way to do it. It really needs to > > be fixed in the module, but if it works for some people then make it a > > configurable knob that they can enable for them. > > I agree that this issue looks like it should be fixed upstream. Does the > author know about it? (A quick glance over the project's mailing list > revealed nothing to me.) > > Best regards, > Stefan Csaba, Have you take a look at this: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/124901 -- Anish Mistry
Hi Dominic, sorry for the delay, I've been abroad for a couple of weeks and then busy with lots of non-FreeBSD stuff recently. Since there hasn't been any response by the author, yet, and Anish seems to think it's OK to use your solution until the issue is fixed in the code itself, could you provide a new patch that adds a knob to switch it on/off? (Default should be off as Anish stated.) I'll commit it, then. Regards, Stefan
Here is my evil patch. I hope this will satisfy everyone. I had to switch to a force unmount or the stop process was likely to never terminate, with the watchdog paused and eternally trying to unload the module. diff -Pur ports/sysutils/fusefs-kmod.orig/files/fusefs.in ports/sysutils/fusefs-kmod/files/fusefs.in --- ports/sysutils/fusefs-kmod.orig/files/fusefs.in 2008-12-12 11:36:44.000000000 +0100 +++ ports/sysutils/fusefs-kmod/files/fusefs.in 2008-12-12 12:15:20.000000000 +0100 @@ -13,6 +13,14 @@ # fusefs_enable (bool): Set to NO by default. # Set it to YES to enable fusefs. # +# fusefs_safe (bool): Set to NO by default. +# Set it to YES to wait for all write operations +# to finish before terminating. +# +# fusefs_safe_evil (bool): Set to NO by default. +# Set it to YES to pause the watchdog timer +# while waiting for write operations. +# . %%RC_SUBR%% @@ -46,14 +54,36 @@ case "$dev" in /dev/fuse[0-9]*) echo "fusefs: unmounting ${mountpoint}." - umount $mountpoint + umount -f $mountpoint ;; esac done - kldunload $kmod + if checkyesno "${name}_safe_evil"; then + if [ -n "$_rcshutdown_watchdog" ]; then + echo "fusefs: pausing watchdog timer." + kill -STOP "$_rcshutdown_watchdog" + fi + fi + if checkyesno "${name}_safe"; then + printf "fusefs: unloading $kmod... " + while ! kldunload $kmod 2> /dev/null; do + sleep 0.25 + done + echo "done." + else + kldunload $kmod + fi + if checkyesno "${name}_safe_evil"; then + if [ -n "$_rcshutdown_watchdog" ]; then + echo "fusefs: continuing watchdog timer." + kill -CONT "$_rcshutdown_watchdog" + fi + fi } load_rc_config $name : ${fusefs_enable="NO"} +: ${fusefs_safe="NO"} +: ${fusefs_safe_evil="NO"} run_rc_command "$1"
stefan 2008-12-12 15:10:52 UTC FreeBSD ports repository Modified files: sysutils/fusefs-kmod Makefile sysutils/fusefs-kmod/files fusefs.in Log: Add knobs to the rc.d script to safely wait until all data has been written on shutdown. (As this implies pausing rc.shutdown's shutdown watchdog, the knobs are off by default.) PR: 124901 Submitted by: Dominic Fandrey <kamikaze@bsdforen.de> Approved by: maintainer Revision Changes Path 1.25 +1 -1 ports/sysutils/fusefs-kmod/Makefile 1.7 +33 -3 ports/sysutils/fusefs-kmod/files/fusefs.in _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: feedback->closed Patch committed, thanks! It would probably be a good idea to discuss this problem with the software's author, though, so it can eventually be fixed upstream.