md deadlocks on wdrain. Was: [Re: quota and snapshots in 6.1-RELEASE]

Kostik Belousov kostikbel at gmail.com
Sat Jul 1 03:49:30 UTC 2006


On Fri, Jun 30, 2006 at 02:31:43PM -0400, Mike Jakubik wrote:
> Kostik Belousov wrote:
> >Second, I am really curious what you do. My understanding follows: you
> >have set up vnode-backed md device (md0a) on sparce file, created ufs2
> >on it, mounted it with quotas, and run background fsck on that fs. At
> >the same time, you did rm for the snapshot file created by fsck. Right ?
> >  
> 
> This is the procedure i followed, while i have quota enabled, it was not 
> set on the test filesystem.
> 
> 1) dd if=/dev/zero of=/usr/bigfile bs=1024 seek=209715200 count=0
> 2) mdconfig -a -t vnode -f /usr/bigfile
> 3) bsdlabel -w md0 auto
> 4) newfs -U md0a
> 5) fsck -v /dev/md0a # ^C this after a second or so, this makes the FS dirty
> 6) mount /dev/md0a /mnt
> 7) fsck -v -B /dev/md0a
> 
> in another window:
> 8) while true; do ls -al /mnt/.snap;sleep 1;done
Thanks for description.
> 
> FYI, -CURRENT passes this test without locking up, so the fix is already 
> there somewhere.

May be. May be not, and other issues just prevent complete exhausting
of the buffer run space on CURRENT. Did you test it on CURRENT
many times, or only once. The same question for STABLE - does it
locks every time your do that ?

Please, try this patch, and report the results.

? sys/dev/md/.arch-ids
Index: sys/dev/md/md.c
===================================================================
RCS file: /usr/local/arch/ncvs/src/sys/dev/md/md.c,v
retrieving revision 1.164
diff -u -r1.164 md.c
--- sys/dev/md/md.c	28 Mar 2006 21:25:11 -0000	1.164
+++ sys/dev/md/md.c	1 Jul 2006 03:48:41 -0000
@@ -650,6 +650,8 @@
 	mtx_lock_spin(&sched_lock);
 	sched_prio(curthread, PRIBIO);
 	mtx_unlock_spin(&sched_lock);
+	if (sc->type == MD_VNODE)
+		curthread->td_pflags |= TDP_NORUNNINGBUF;
 
 	for (;;) {
 		mtx_lock(&sc->queue_mtx);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20060701/d2051cf2/attachment.pgp


More information about the freebsd-fs mailing list