Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jun 2008 08:41:23 +0200
From:      Dominic Fandrey <kamikaze@bsdforen.de>
To:        Anish Mistry <amistry@am-productions.biz>
Cc:        csaba-ml@creo.hu, freebsd-hackers@freebsd.org
Subject:   Re: FreeBSD fusefs-kmod shutdown problem workaround
Message-ID:  <485F4593.9050807@bsdforen.de>
In-Reply-To: <200806221615.50498.amistry@am-productions.biz>
References:  <485EAE11.2050808@bsdforen.de> <200806221615.50498.amistry@am-productions.biz>

next in thread | previous in thread | raw e-mail | index | archive | help
Anish Mistry wrote:
> On Sunday 22 June 2008, Dominic Fandrey wrote:
>> I know these are desperate mesures, but the problem that fusefs
>> doesn't write everything back to the disk before a shutdown is
>> completed remains, because the rc script is often shot down by
>> the shutdown watchdog.
>>
>> Hence I have extended my workaround to force stop the watchdog
>> until everything is written to the media.
>>
>> Regards,
>> Dominic
>>
>> 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-06-22
>> 21:35:27.000000000 +0200 +++
>> ports/sysutils/fusefs-kmod/files/fusefs.in	2008-06-22
>> 21:44:34.000000000 +0200 @@ -50,9 +50,18 @@
>>  			;;
>>  		esac
>>  	done
>> +
>> +	# This is an evil yet necessary hack to give fuse the time to
>> +	# write all data to the media before the system is shut down.
>> +	if [ -n "$rcshutdown_timeout" -a -n "$_rcshutdown_watchdog" ]; then
>> +		/bin/kill -STOP "$_rcshutdown_watchdog"
>> +	fi
>>  	until kldunload $kmod; do
>>  		/bin/sleep 0.25
>>  	done
>> +	if [ -n "$rcshutdown_timeout" -a -n "$_rcshutdown_watchdog" ]; then
>> +		/bin/kill -CONT "$_rcshutdown_watchdog"
>> +	fi
>>  }
>>  load_rc_config $name
> Please open a PR, this is out of my comfort zone by doing "evil" stuff 
> during shutdown.  It would probably be helpful to bring up this on 
> hackers/current by showing your patch.  Hopefully we can get some 
> attention and get the necessary changes in the base/kernel to do 
> this "right".  It does look like there is a solution in Csaba's 
> development version.
> Did you take a look at Csaba's message on hackers at the beginning of 
> January?
> 

Thanks for the pointer. Unfortunately it seems that Csaba's patch only
allows you to stall shutdown for 10 seconds. After heavy writing
more than a minute can be necessary to prevent data loss.

I have created a problem report: ports/124901
http://www.freebsd.org/cgi/query-pr.cgi?pr=124901

I hope this will make it. To me data loss and file system corruption
are the worst case scenario and to me it's worth stalling shutdown
for as long as it takes to write the data.

Regards,
Dominic



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?485F4593.9050807>