Revert "dmu_objset_userquota_get_ids uses dn_bonus unsafely"
This reverts commit 5f8e1e8505
. It
was determined that this patch introduced the quota regression
described in #3789.
Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #3443
Issue #3789
This commit is contained in:
parent
057b87c00a
commit
13e3c4be75
|
@ -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 flags = dn->dn_id_flags;
|
||||||
int error;
|
int error;
|
||||||
boolean_t have_spill = B_FALSE;
|
boolean_t have_spill = B_FALSE;
|
||||||
boolean_t have_bonus = B_FALSE;
|
|
||||||
|
|
||||||
if (!dmu_objset_userused_enabled(dn->dn_objset))
|
if (!dmu_objset_userused_enabled(dn->dn_objset))
|
||||||
return;
|
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)
|
if (before && dn->dn_bonuslen != 0)
|
||||||
data = DN_BONUS(dn->dn_phys);
|
data = DN_BONUS(dn->dn_phys);
|
||||||
else if (!before && dn->dn_bonuslen != 0) {
|
else if (!before && dn->dn_bonuslen != 0) {
|
||||||
|
if (dn->dn_bonus) {
|
||||||
db = dn->dn_bonus;
|
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;
|
|
||||||
}
|
|
||||||
mutex_enter(&db->db_mtx);
|
mutex_enter(&db->db_mtx);
|
||||||
data = dmu_objset_userquota_find_data(db, tx);
|
data = dmu_objset_userquota_find_data(db, tx);
|
||||||
} else {
|
} 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;
|
dn->dn_id_flags |= DN_ID_CHKED_BONUS;
|
||||||
}
|
}
|
||||||
mutex_exit(&dn->dn_mtx);
|
mutex_exit(&dn->dn_mtx);
|
||||||
if (have_spill || have_bonus)
|
if (have_spill)
|
||||||
dmu_buf_rele((dmu_buf_t *)db, FTAG);
|
dmu_buf_rele((dmu_buf_t *)db, FTAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue