Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Mar 2006 07:03:20 GMT
From:      John Kozubik <john@kozubik.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/94769: Multiple file deletions on multi-snapshotted filesystems causes hang
Message-ID:  <200603210703.k2L73KeK078299@www.freebsd.org>
Resent-Message-ID: <200603210710.k2L7AFWk074925@freefall.freebsd.org>

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

>Number:         94769
>Category:       kern
>Synopsis:       Multiple file deletions on multi-snapshotted filesystems causes hang
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 21 07:10:15 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     John Kozubik
>Release:        FreeBSD 6.1-BETA4
>Organization:
www.kozubik.com
>Environment:
FreeBSD test.kozubik.com 6.1-BETA4 FreeBSD 6.1-BETA4 #0: Tue Mar 14 13:59:38 UTC 2006     root@wv1u.samsco.home:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
If you have a UFS2 filesystem with multiple snapshots on it, and commence several processes of rapid file deletions on that filesystem, the system will hang.

I first produced this problem on a system that had a filesystem with six snapshots enabled on it.  I proceeded to start three concurrent `rm` processes of directories with large numbers of files in them (on that filesystem).  The system hung as a result.

Further testing showed that in the exact same environment, three such `rm` processes did not hang a system when the filesystem in question only had two snapshots.  I incremented the number of snapshots to 3, and the system hung when the same three `rm` processes were performed.

It is possible that any ratio of a large number of snapshots to a large number of intensive file deletions on the filesystem that is snapshotted will cause the system to hang.  For instance, one snapshot and ten file deletion processes, or perhaps ten snapshots and two file deletion processes.  I have not tested any further combinations than the ones listed above.

I am highly confident that this behavior exists and is reproducible.  I have reproduced this behavior on both 6.0 and 6.1.
>How-To-Repeat:

(assume a filesystem mounted on /mnt/data1)

cp -R /usr/src /mnt/data1/test1
cp -R /usr/src /mnt/data1/test2
cp -R /usr/src /mnt/data1/test3

mksnap_ffs /mnt/data1 /mnt/data1/.sync/snap1
mksnap_ffs /mnt/data1 /mnt/data1/.sync/snap2
mksnap_ffs /mnt/data1 /mnt/data1/.sync/snap3

rm -rf /mnt/data1/test1 &
rm -rf /mnt/data1/test2 &
rm -rf /mnt/data1/test3 &

(system will hang)

>Fix:
Do not use UFS2 snapshots.  It is unreasonable to assume that concurrent rapid file deletions will not occur on a filesystem that has snapshots on it.
>Release-Note:
>Audit-Trail:
>Unformatted:



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