summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Ercolani <[email protected]>2016-07-08 16:51:50 -0400
committerBrian Behlendorf <[email protected]>2016-08-15 09:52:56 -0700
commit6d836e6f8b358270d55a57ad8e8868c957f15bf3 (patch)
tree5ffe235fe3b07ba1f339654181fec361d156cead
parente35c5a8265e791d5856ef24e567cde5879844dc5 (diff)
Add tunable to ignore hole_birth
Adds a module option which disables the hole_birth optimization which has been responsible for several recent bugs, including issue #4050. Original-patch: https://gist.github.com/pcd1193182/2c0cd47211f3aee623958b4698836c48 Signed-off-by: Rich Ercolani <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4833
-rw-r--r--man/man5/zfs-module-parameters.513
-rw-r--r--module/zfs/dmu_traverse.c6
2 files changed, 18 insertions, 1 deletions
diff --git a/man/man5/zfs-module-parameters.5 b/man/man5/zfs-module-parameters.5
index 41fc20deb..3e62a4436 100644
--- a/man/man5/zfs-module-parameters.5
+++ b/man/man5/zfs-module-parameters.5
@@ -27,6 +27,19 @@ Description of the different parameters to the ZFS module.
.sp
.ne 2
.na
+\fBignore_hole_birth\fR (int)
+.ad
+.RS 12n
+When set, the hole_birth optimization will not be used, and all holes will
+always be sent on zfs send. Useful if you suspect your datasets are affected
+by a bug in hole_birth.
+.sp
+Use \fB1\fR for on and \fB0\fR (default) for off.
+.RE
+
+.sp
+.ne 2
+.na
\fBl2arc_feed_again\fR (int)
.ad
.RS 12n
diff --git a/module/zfs/dmu_traverse.c b/module/zfs/dmu_traverse.c
index 0df12fac8..4c9459412 100644
--- a/module/zfs/dmu_traverse.c
+++ b/module/zfs/dmu_traverse.c
@@ -39,6 +39,7 @@
#include <sys/zfeature.h>
int32_t zfs_pd_bytes_max = 50 * 1024 * 1024; /* 50MB */
+int32_t ignore_hole_birth = 0;
typedef struct prefetch_data {
kmutex_t pd_mtx;
@@ -251,7 +252,7 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
*
* Note that the meta-dnode cannot be reallocated.
*/
- if ((!td->td_realloc_possible ||
+ if (!ignore_hole_birth && (!td->td_realloc_possible ||
zb->zb_object == DMU_META_DNODE_OBJECT) &&
td->td_hole_birth_enabled_txg <= td->td_min_txg)
return (0);
@@ -727,4 +728,7 @@ EXPORT_SYMBOL(traverse_pool);
module_param(zfs_pd_bytes_max, int, 0644);
MODULE_PARM_DESC(zfs_pd_bytes_max, "Max number of bytes to prefetch");
+
+module_param(ignore_hole_birth, int, 0644);
+MODULE_PARM_DESC(ignore_hole_birth, "Ignore hole_birth txg for send");
#endif