diff options
author | Prakash Surya <[email protected]> | 2015-03-27 13:03:22 +1100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-03-27 14:51:34 -0700 |
commit | a4069eef2e403a3b2a307b23b7500e2adc6ecae5 (patch) | |
tree | fdffc88b612ac92c8c4bdfc7641b0a1045171157 /module | |
parent | 9540be9b23fd6f8b5bf7d81853c251010d9b7205 (diff) |
Illumos 5695 - dmu_sync'ed holes do not retain birth time
5695 dmu_sync'ed holes do not retain birth time
Reviewed by: Matthew Ahrens <[email protected]>
Reviewed by: George Wilson <[email protected]>
Reviewed by: Christopher Siden <[email protected]>
Reviewed by: Bayard Bell <[email protected]>
Approved by: Dan McDonald <[email protected]>
References:
https://www.illumos.org/issues/5695
https://github.com/illumos/illumos-gate/commit/70163ac
Ported-by: Chris Dunlop <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #3229
Diffstat (limited to 'module')
-rw-r--r-- | module/zfs/dmu.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index 1501ae804..3b7bbefc2 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -1472,7 +1472,19 @@ dmu_sync_done(zio_t *zio, arc_buf_t *buf, void *varg) dr->dt.dl.dr_overridden_by = *zio->io_bp; dr->dt.dl.dr_override_state = DR_OVERRIDDEN; dr->dt.dl.dr_copies = zio->io_prop.zp_copies; - if (BP_IS_HOLE(&dr->dt.dl.dr_overridden_by)) + + /* + * Old style holes are filled with all zeros, whereas + * new-style holes maintain their lsize, type, level, + * and birth time (see zio_write_compress). While we + * need to reset the BP_SET_LSIZE() call that happened + * in dmu_sync_ready for old style holes, we do *not* + * want to wipe out the information contained in new + * style holes. Thus, only zero out the block pointer if + * it's an old style hole. + */ + if (BP_IS_HOLE(&dr->dt.dl.dr_overridden_by) && + dr->dt.dl.dr_overridden_by.blk_birth == 0) BP_ZERO(&dr->dt.dl.dr_overridden_by); } else { dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; |