Pawel,

We only call ddt_lookup() from syncing context and by the time we're in ddt_sync_table() there aren't any other threads which can manipulate the entries we're about to sync.

It might be helpful to better understand how you're trying to use this interface.

Thanks,
George

Pawel Jakub Dawidek wrote:
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?



------------------------------------------------------------------------

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

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

Reply via email to