aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/dmu.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2019-05-30 17:13:18 -0700
committerGitHub <[email protected]>2019-05-30 17:13:18 -0700
commit2531ce372015a90f090176ae61105a9ea1a8f992 (patch)
treead0191b39ff6f785a86a137caa2b014245dafec4 /module/zfs/dmu.c
parent1608985a411a8fd7698a41f9150f4bb3543d7093 (diff)
Revert "Report holes when there are only metadata changes"
This reverts commit ec4f9b8f30 which introduced a narrow race which can lead to lseek(, SEEK_DATA) incorrectly returning ENXIO. Resolve the issue by revering this change to restore the previous behavior which depends solely on checking the dirty list. Reviewed-by: Olaf Faaland <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #8816 Closes #8834
Diffstat (limited to 'module/zfs/dmu.c')
-rw-r--r--module/zfs/dmu.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c
index a283b0622..2d6740576 100644
--- a/module/zfs/dmu.c
+++ b/module/zfs/dmu.c
@@ -2373,39 +2373,14 @@ dmu_offset_next(objset_t *os, uint64_t object, boolean_t hole, uint64_t *off)
return (err);
/*
- * Check if there are dirty data blocks or frees which have not been
- * synced. Dirty spill and bonus blocks which are external to the
- * object can ignored when reporting holes.
+ * Check if dnode is dirty
*/
- mutex_enter(&dn->dn_mtx);
for (i = 0; i < TXG_SIZE; i++) {
if (multilist_link_active(&dn->dn_dirty_link[i])) {
-
- if (dn->dn_free_ranges[i] != NULL) {
- clean = B_FALSE;
- break;
- }
-
- list_t *list = &dn->dn_dirty_records[i];
- dbuf_dirty_record_t *dr;
-
- for (dr = list_head(list); dr != NULL;
- dr = list_next(list, dr)) {
- dmu_buf_impl_t *db = dr->dr_dbuf;
-
- if (db->db_blkid == DMU_SPILL_BLKID ||
- db->db_blkid == DMU_BONUS_BLKID)
- continue;
-
- clean = B_FALSE;
- break;
- }
- }
-
- if (clean == B_FALSE)
+ clean = B_FALSE;
break;
+ }
}
- mutex_exit(&dn->dn_mtx);
/*
* If compatibility option is on, sync any current changes before