summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2015-09-25 11:15:02 -0700
committerBrian Behlendorf <[email protected]>2015-09-25 12:50:24 -0700
commita3000f9358159d761bdf59bd1c4d318f7ec71815 (patch)
tree343101e2268a88e2cd739fd137e655c23d540102 /module
parent5592404784d3125cbeb6df002674867c009c8b48 (diff)
Revert "dmu_objset_userquota_get_ids uses dn_bonus unsafely"
This reverts commit 5f8e1e850522ee5cd37366427da4b4101a71c8a8. It was determined that this patch introduced the quota regression described in #3789. Signed-off-by: Tim Chase <[email protected]> Signed-off-by: Ned Bass <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #3443 Issue #3789
Diffstat (limited to 'module')
-rw-r--r--module/zfs/dmu_objset.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/module/zfs/dmu_objset.c b/module/zfs/dmu_objset.c
index 4d5baf8da..b3168a856 100644
--- a/module/zfs/dmu_objset.c
+++ b/module/zfs/dmu_objset.c
@@ -1342,7 +1342,6 @@ dmu_objset_userquota_get_ids(dnode_t *dn, boolean_t before, dmu_tx_t *tx)
int flags = dn->dn_id_flags;
int error;
boolean_t have_spill = B_FALSE;
- boolean_t have_bonus = B_FALSE;
if (!dmu_objset_userused_enabled(dn->dn_objset))
return;
@@ -1354,21 +1353,8 @@ dmu_objset_userquota_get_ids(dnode_t *dn, boolean_t before, dmu_tx_t *tx)
if (before && dn->dn_bonuslen != 0)
data = DN_BONUS(dn->dn_phys);
else if (!before && dn->dn_bonuslen != 0) {
- db = dn->dn_bonus;
- if (db != NULL) {
- if (!RW_WRITE_HELD(&dn->dn_struct_rwlock)) {
- have_bonus = dbuf_try_add_ref((dmu_buf_t *)db,
- dn->dn_objset, dn->dn_object,
- DMU_BONUS_BLKID, FTAG);
-
- /*
- * The hold will fail if the buffer is
- * being evicted due to unlink, in which
- * case nothing needs to be done.
- */
- if (!have_bonus)
- return;
- }
+ if (dn->dn_bonus) {
+ db = dn->dn_bonus;
mutex_enter(&db->db_mtx);
data = dmu_objset_userquota_find_data(db, tx);
} else {
@@ -1443,7 +1429,7 @@ dmu_objset_userquota_get_ids(dnode_t *dn, boolean_t before, dmu_tx_t *tx)
dn->dn_id_flags |= DN_ID_CHKED_BONUS;
}
mutex_exit(&dn->dn_mtx);
- if (have_spill || have_bonus)
+ if (have_spill)
dmu_buf_rele((dmu_buf_t *)db, FTAG);
}