Hi.

I'm currently implementing something around ZFS dedup and I run across
the following panic:

        ASSERT(dde->dde_loaded);

in ddt_sync_entry():996.

This is because I make heavy use of ddt_lookup() function, which marks
DDT entry as loading and drops ddt_lock by calling ddt_exit().
I see nothing which would stop ddt_sync() -> ddt_sync_table() ->
ddt_sync_entry() from operating on DDT entry which is being loaded by
ddt_lookup(). It is not even protected by the ddt_lock, so I think it is
also possible that DDT entry can be removed and freed from under us.

The following patch fixes the problem(s) for me. Note that I don't use
avl_destroy_nodes() anymore, so we pay the cost of rebalancing the tree
during avl_remove(), not sure what I can do about that.

The patch adds ddt_lock protection around ddt_sync_table(), checks for
entries that are being loaded, wait for them and continues the process.

        http://people.freebsd.org/~pjd/patches/ddt.c.patch

Am I missing something in my analysis?

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
[email protected]                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

Attachment: pgpzE07Kw35Q2.pgp
Description: PGP signature

_______________________________________________
zfs-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/zfs-code

Reply via email to