HomeFreeBSD

Fix empty xattr dir causing lockup

Description

Fix empty xattr dir causing lockup

During zfs_rmnode on a xattr dir, if the system crash just after
dmu_free_long_range, we would get empty xattr dir in delete queue. This would
cause blkid=0 be passed into zap_get_leaf_byblk when doing zfs_purgedir during
mount, and would try to do rw_enter on a wrong structure and cause system
lockup.

We fix this by returning ENOENT when blkid is zero in zap_get_leaf_byblk.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4114
Closes #4052
Closes #4006
Closes #3018
Closes #2861

Details

Provenance
Chunwei Chen <david.chen@osnexus.com>Authored on Dec 18 2015, 7:39 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Dec 28 2015, 5:41 PM
Parents
rG2ebc7b72b398: Fix z_xattr_lock/z_teardown_lock inversion
Branches
Unknown
Tags
Unknown