summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-11-15 10:19:32 -0800
committerGitHub <[email protected]>2017-11-15 10:19:32 -0800
commit454365bbaacc153f98d2a3adaf33b13a6183d45d (patch)
treee8fcacf20a9a146d37c093496348fa1852ec1180 /module
parent13589da974e4e808b16d7dd280744277bb8d079b (diff)
Fix dirty check in dmu_offset_next()
The correct way to determine if a dnode is dirty is to check if any of the dn->dn_dirty_link's are active. Relying solely on the dn->dn_dirtyctx can result in the dnode being mistakenly reported as clean. Reviewed-by: Chunwei Chen <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #3125 Closes #6867
Diffstat (limited to 'module')
-rw-r--r--module/zfs/dmu.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c
index 4bf9b1a5b..108dfe157 100644
--- a/module/zfs/dmu.c
+++ b/module/zfs/dmu.c
@@ -2250,12 +2250,10 @@ dmu_offset_next(objset_t *os, uint64_t object, boolean_t hole, uint64_t *off)
/*
* Check if dnode is dirty
*/
- if (dn->dn_dirtyctx != DN_UNDIRTIED) {
- for (i = 0; i < TXG_SIZE; i++) {
- if (!list_is_empty(&dn->dn_dirty_records[i])) {
- clean = B_FALSE;
- break;
- }
+ for (i = 0; i < TXG_SIZE; i++) {
+ if (list_link_active(&dn->dn_dirty_link[i])) {
+ clean = B_FALSE;
+ break;
}
}