summaryrefslogtreecommitdiff
path: root/sys-fs/zfs-kmod/files/0.8.0_revert_Report_holes.patch
blob: f8d67ccc7cefc099e301b0c380c5f8d4d90bf0c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From: Georgy Yakovlev <gyakovlev@gentoo.org>
Date: Wed, 29 May 2019 14:38:15 -0700
Subject: Revert [PATCH] Report holes when there are only metadata changes

This reverts ec4f9b8f30391a3fb46c8d4a31c2dc9250dca1bb
Issue: https://github.com/zfsonlinux/zfs/issues/8816
Bug: https://bugs.gentoo.org/635002
---
--- b/module/zfs/dmu.c
+++ a/module/zfs/dmu.c
@@ -2366,39 +2366,14 @@
 		return (err);
 
 	/*
+	 * Check if dnode is dirty
-	 * 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.
 	 */
-	mutex_enter(&dn->dn_mtx);
 	for (i = 0; i < TXG_SIZE; i++) {
 		if (multilist_link_active(&dn->dn_dirty_link[i])) {
+			clean = B_FALSE;
+			break;
-
-			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)
-			break;
 	}
-	mutex_exit(&dn->dn_mtx);
 
 	/*
 	 * If compatibility option is on, sync any current changes before