kern/92292: Heavy IO on a md-backed filesystem on a snapshotted filesystem will block

John Kozubik john at kozubik.com
Tue Jan 24 22:10:04 PST 2006


>Number:         92292
>Category:       kern
>Synopsis:       Heavy IO on a md-backed filesystem on a snapshotted filesystem will block
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 25 06:10:03 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     John Kozubik
>Release:        6.0-RELEASE
>Organization:
www.kozubik.com
>Environment:
FreeBSD test 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Wed Nov 30 13:35:22 PST 2005     user at test:/usr/src/sys/i386/compile/test  i386
>Description:
If you create a filesystem backed by an md device, and the backing store and mount point for that md-backed filesystem exist on a filesystem that has a snapshot on it, the underlying filesystem will block.

First, the IO process will become stuck in the biowr state, then the mount point of the md-backed filesystem will block against all requests, and eventually the entire underlying snapshotted filesystem will block against all requests.

The snapshot cannot be removed at this point because you cannot access the filesystem it exists on, and the IO process cannot be killed.  The system itself seems to remain responsive, with the exception of that entire filesystem.               
>How-To-Repeat:
create a snapshot on a filesystem:

mksnap_ffs /mnt/fs1 /mnt/fs1/.snap/snapshot

Create a md-backed, mounted filesystem, on the same filesystem you just snapshotted:

dd if=/dev/zero of=/mnt/fs1/file bs=1k count=2100000
mkdir /mnt/fs1/dir
mdconfig -a -t vnode -f /mnt/fs1/file -u 0
disklabel -r -w md0 auto
newfs /dev/md0c
mount /dev/md0c /mnt/fs1/dir

Do some IO inside of the md-backed filesystem:

cp -R /usr/ports/* /mnt/fs1/dir

(above behavior ensues)
>Fix:
Do not run md-backed filesystems on top of filesystems that have been snapshotted.              
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list