On Tue, Jul 29, 2008 at 12:41:16PM +0200, Pawel Jakub Dawidek wrote: > Hi. > > We're testing the most recent ZFS version from OpenSolaris ported to > FreeBSD. Kris (CCed) observed strange situation. In function arc_read() > he had a panic on assertion that we try to unlock a lock which is not > beeing held: > > rw_enter(&pbuf->b_hdr->b_datalock, RW_READER); > > err = arc_read_nolock(pio, spa, bp, done, private, priority, > flags, arc_flags, zb); > > rw_exit(&pbuf->b_hdr->b_datalock); <--- THIS ONE > > The only possiblity was that b_hdr for pbuf was changed somewhere. We > diagnozed this further and the b_hdr field is changed in arc_release() > function, here: > > buf->b_hdr = nhdr; [...]
We have a simple test case to reproduce that and a patch that seems to work for us. I don't really understand the code well enough to be able to prepare the right fix. The patch is here: http://people.freebsd.org/~pjd/patches/arc.patch Script to reproduce it: #!/bin/sh fs=tank/$$ while true; do zfs clone tank/boom at boom $fs find /$fs > /dev/null zfs destroy $fs done To use it, you first need to create pool tank and tank/boom dataset, then put some files into /tank/boom/ (we had FreeBSD source tree in there), then take a snapshot tank/boom at boom and: # cp boom.sh /tank/ # cd /tank # ./boom.sh &; ./boom.sh &; ./boom.sh &; ./boom.sh & You'll need SMP machine to reproduce that. We tried to reproduce it on recent OpenSolaris, but we have only one CPU in there and we weren't able to reproduce it. Maybe it is FreeBSD-specific problem, but it doesn't look like that. Could you guys at least try to reproduce it on some SMP OpenSolaris machine? Thanks in advance! -- Pawel Jakub Dawidek http://www.wheel.pl pjd at FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available URL: <http://mail.opensolaris.org/pipermail/zfs-code/attachments/20080816/4affb003/attachment.bin>