Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Apr 2008 11:23:31 GMT
From:      Dominic Fandrey <kamikaze@bsdforen.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/122907: [patch] sysutils/fusefs-kmod dataloss on write shortly (e.g. 15 minutes) before shutdown
Message-ID:  <200804191123.m3JBNVw3098534@www.freebsd.org>
Resent-Message-ID: <200804191130.m3JBU1Ju068441@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         122907
>Category:       ports
>Synopsis:       [patch] sysutils/fusefs-kmod dataloss on write shortly (e.g. 15 minutes) before shutdown
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 19 11:30:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Dominic Fandrey
>Release:        RELENG_7
>Organization:
private
>Environment:
FreeBSD mobileKamikaze.norad 7.0-STABLE FreeBSD 7.0-STABLE #0: Sat Apr 19 01:05:43 CEST 2008     root@mobileKamikaze.norad:/usr/obj/HP6510b/amd64/usr/src/sys/HP6510b  amd64

>Description:
Fusefs mounts can loose data written shortly before shutdown and cause file system corruption.

The problem is that the cache gets written back when the systems are unmounted. But the short timespan between stopping and thus unmounting and the system reset/powerdown often does not suffice to write all data back.

This will change the rc script so that it hangs around until all data has safely been written back.

It can still be shot by the watchdog, but it greatly reduces the risk of data corruption.
>How-To-Repeat:
Use fusefs-ntfs or something similar, write some data (~100M split into a couple of files should do) to a mount and immediately run 'shutdown -p now'. The data will be (partly) missing upon the next boot.
>Fix:
--- ports/sysutils/fusefs-kmod/files/fusefs.in.orig	2008-04-19 13:08:43.000000000 +0200
+++ ports/sysutils/fusefs-kmod/files/fusefs.in	2008-04-19 13:09:51.000000000 +0200
@@ -50,7 +50,9 @@
 			;;
 		esac
 	done
-	kldunload $kmod
+	until kldunload $kmod; do
+		/bin/sleep 0.25
+	done
 }
 load_rc_config $name

>Release-Note:
>Audit-Trail:
>Unformatted:



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