Revert "Revert "Fix unlink/xattr deadlock""
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 17 Jan 2013 18:05:42 +0000 (10:05 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 17 Jan 2013 19:24:20 +0000 (11:24 -0800)
commit7973e464de4f93b6e669f7f04a316e013767224e
treef1c1911ebd701749d2b3dc3dfaeebe9cc3edf386
parent7b3e34ba5a7ee8d0fda44d214f6f11eb16cdb26f
Revert "Revert "Fix unlink/xattr deadlock""

This reverts commit 53c7411919a64d6f0889aa0d6974610f6cd35744
effectively reinstating the asynchronous xattr cleanup code.

These Linux changes were reverted because after testing
and careful contemplation I was convinced that due to the
89260a1c8851ce05ea04b23606ba438b271d890 commit they were no
longer required.

Unfortunately, the deadlock described in #1176  was a case
which wasn't considered.  At mount zfs_unlinked_drain() can
occur which will unlink a list of znodes in effectively a
random order which isn't safe.  The only reason it was safe
to originally revert this change was the we could guarantee
that the VFS would always prune the xattr leaves before the
parents.

Therefore, until we can cleanly resolve this deadlock for
all cases we need to keep this change in spite of the xattr
unlink performance penalty associated with it.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1176
Issue #457
module/zfs/zfs_dir.c
module/zfs/zfs_vfsops.c