Revert "ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced()"
This reverts commit 4b3133e671
.
Users identified this commit as a possible source of data
corruption:
https://github.com/openzfs/zfs/issues/14753
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Issue #14753
Closes #14761
This commit is contained in:
parent
18edf7a3ba
commit
a969b1b22c
|
@ -1773,29 +1773,20 @@ dnode_try_claim(objset_t *os, uint64_t object, int slots)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Checks if the dnode might contain any uncommitted changes to data blocks.
|
* Checks if the dnode contains any uncommitted dirty records.
|
||||||
* Dirty metadata (e.g. bonus buffer) does not count.
|
|
||||||
*/
|
*/
|
||||||
boolean_t
|
boolean_t
|
||||||
dnode_is_dirty(dnode_t *dn)
|
dnode_is_dirty(dnode_t *dn)
|
||||||
{
|
{
|
||||||
mutex_enter(&dn->dn_mtx);
|
mutex_enter(&dn->dn_mtx);
|
||||||
|
|
||||||
for (int i = 0; i < TXG_SIZE; i++) {
|
for (int i = 0; i < TXG_SIZE; i++) {
|
||||||
list_t *list = &dn->dn_dirty_records[i];
|
if (multilist_link_active(&dn->dn_dirty_link[i])) {
|
||||||
for (dbuf_dirty_record_t *dr = list_head(list);
|
|
||||||
dr != NULL; dr = list_next(list, dr)) {
|
|
||||||
if (dr->dr_dbuf == NULL ||
|
|
||||||
(dr->dr_dbuf->db_blkid != DMU_BONUS_BLKID &&
|
|
||||||
dr->dr_dbuf->db_blkid != DMU_SPILL_BLKID)) {
|
|
||||||
mutex_exit(&dn->dn_mtx);
|
|
||||||
return (B_TRUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (dn->dn_free_ranges[i] != NULL) {
|
|
||||||
mutex_exit(&dn->dn_mtx);
|
mutex_exit(&dn->dn_mtx);
|
||||||
return (B_TRUE);
|
return (B_TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_exit(&dn->dn_mtx);
|
mutex_exit(&dn->dn_mtx);
|
||||||
|
|
||||||
return (B_FALSE);
|
return (B_FALSE);
|
||||||
|
@ -2667,9 +2658,7 @@ dnode_next_offset(dnode_t *dn, int flags, uint64_t *offset,
|
||||||
rw_enter(&dn->dn_struct_rwlock, RW_READER);
|
rw_enter(&dn->dn_struct_rwlock, RW_READER);
|
||||||
|
|
||||||
if (dn->dn_phys->dn_nlevels == 0) {
|
if (dn->dn_phys->dn_nlevels == 0) {
|
||||||
if (!(flags & DNODE_FIND_HOLE)) {
|
|
||||||
error = SET_ERROR(ESRCH);
|
error = SET_ERROR(ESRCH);
|
||||||
}
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue