mirror_zfs/include/sys
Alexander Motin 4ae8bf406b Allow physical rewrite without logical
During regular block writes ZFS sets both logical and physical
birth times equal to the current TXG.  During dedup and block
cloning logical birth time is still set to the current TXG, but
physical may be copied from the original block that was used.
This represents the fact that logically user data has changed,
but the physically it is the same old block.

But block rewrite introduces a new situation, when block is not
changed logically, but stored in a different place of the pool.
From ARC, scrub and some other perspectives this is a new block,
but for example for user applications or incremental replication
it is not.  Somewhat similar thing happen during remap phase of
device removal, but in that case space blocks are still acounted
as allocated at their logical birth times.

This patch introduces a new "rewrite" flag in the block pointer
structure, allowing to differentiate physical rewrite (when the
block is actually reallocated at the physical birth time) from
the device reval case (when the logical birth time is used).

The new functionality is not used at this point, and the only
expected change is that error log is now kept in terms of physical
physical birth times, rather than logical, since if a block with
logged error was somehow rewritten, then the previous error does
not matter any more.

This change also introduces a new TRAVERSE_LOGICAL flag to the
traverse code, allowing zfs send, redact and diff to work in
context of logical birth times, ignoring physical-only rewrites.
It also changes nothing at this point due to lack of those writes,
but they will come in a following patch.

Reviewed-by: Rob Norris <robn@despairlabs.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <alexander.motin@TrueNAS.com>
Closes #17565
2025-08-06 10:36:07 -07:00
..
crypto SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
fm events: include zio type in IO error reports 2025-05-30 10:29:29 -04:00
fs Introduce zfs rewrite subcommand (#17246) 2025-05-12 10:22:17 -07:00
lua SPDX: license tags: MIT 2025-03-13 17:56:54 -07:00
sysevent SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zstd SPDX: license tags: BSD-3-Clause 2025-03-13 17:56:50 -07:00
abd_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
abd.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
aggsum.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
arc_impl.h enforce arc_dnode_limit 2025-07-21 10:32:01 -07:00
arc.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
asm_linkage.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
avl_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
avl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
bitmap.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
bitops.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
blake3.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
blkptr.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
bplist.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
bpobj.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
bptree.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
bqueue.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
brt_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
brt.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
btree.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dataset_kstats.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dbuf.h ARC: Notify dbuf cache about target size reduction 2025-05-14 10:34:14 -04:00
ddt_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
ddt.h Handle interaction between gang blocks, copies, and FDT. 2025-04-21 11:26:30 -04:00
dmu_impl.h Wire O_DIRECT also to Uncached I/O (#17218) 2025-05-13 14:26:55 -07:00
dmu_objset.h Relax special_small_blocks restrictions 2025-07-02 11:11:37 -07:00
dmu_recv.h cred: properly pass and test creds on other threads (#17273) 2025-04-29 16:27:48 -07:00
dmu_redact.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dmu_send.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dmu_traverse.h Allow physical rewrite without logical 2025-08-06 10:36:07 -07:00
dmu_tx.h dmu_tx: break tx assign/wait when pool suspends 2025-05-28 10:28:51 -07:00
dmu_zfetch.h Wire O_DIRECT also to Uncached I/O (#17218) 2025-05-13 14:26:55 -07:00
dmu.h Add TXG timestamp database 2025-08-06 10:31:21 -07:00
dnode.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_bookmark.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_crypt.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_dataset.h dsl_dataset: rename dmu_objset_clone* to dsl_dataset_clone* 2025-06-10 14:52:43 -07:00
dsl_deadlist.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_deleg.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_destroy.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_dir.h cred: properly pass and test creds on other threads (#17273) 2025-04-29 16:27:48 -07:00
dsl_pool.h Unified allocation throttling (#17020) 2025-03-24 09:25:01 -07:00
dsl_prop.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_scan.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_synctask.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_userhold.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
edonr.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
efi_partition.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
frame.h Linux build: silence objtool warnings 2025-06-04 17:40:09 -07:00
hkdf.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
metaslab_impl.h range_tree: Provide more debug details upon unexpected add/remove 2025-07-31 10:44:42 -04:00
metaslab.h metaslab: don't pass whole zio to throttle reserve APIs 2025-07-04 23:22:22 -04:00
mmp.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
mntent.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
multilist.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
nvpair_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
nvpair.h nvlist: Add nvlist_snprintf() and zfs_dbgmsg_nvlist() 2025-04-18 09:22:16 -04:00
objlist.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
pathname.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
qat.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
range_tree.h range_tree: Provide more debug details upon unexpected add/remove 2025-07-31 10:44:42 -04:00
rrwlock.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
sa_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
sa.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
sha2.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
skein.h SPDX: license tags: LicenseRef-OpenZFS-ThirdParty-PublicDomain 2025-03-13 17:57:31 -07:00
spa_checkpoint.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
spa_checksum.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
spa_impl.h Add TXG timestamp database 2025-08-06 10:31:21 -07:00
spa_log_spacemap.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
spa.h Allow physical rewrite without logical 2025-08-06 10:36:07 -07:00
space_map.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
space_reftree.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
sysevent.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
txg_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
txg.h txg_wait_synced_flags: add TXG_WAIT_SUSPEND flag to not wait if pool suspended 2025-05-28 10:27:46 -07:00
u8_textprep_data.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
u8_textprep.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
uberblock_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
uberblock.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
uio_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
unique.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
uuid.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_disk.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_draid.h Implement allocation size ranges and use for gang leaves (#17111) 2025-05-02 15:32:18 -07:00
vdev_file.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_impl.h Fix dynamic gang block headers on raidz and mirror devices 2025-08-06 09:50:58 -07:00
vdev_indirect_births.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_indirect_mapping.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_initialize.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_raidz_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_raidz.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_rebuild.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_removal.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_trim.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev.h Fix dynamic gang block headers on raidz and mirror devices 2025-08-06 09:50:58 -07:00
xvattr.h Add support for FreeBSD's Solaris style extended attribute interface 2025-07-30 09:49:43 -07:00
zap_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zap_leaf.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zap.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zcp_global.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zcp_iter.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zcp_prop.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zcp_set.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zcp.h cred: properly pass and test creds on other threads (#17273) 2025-04-29 16:27:48 -07:00
zfeature.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_acl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_bootenv.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_chksum.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_context.h Skip dbuf_evict_one() from dbuf_evict_notify() for reclaim thread 2025-08-01 16:47:41 -07:00
zfs_debug.h nvlist: Add nvlist_snprintf() and zfs_dbgmsg_nvlist() 2025-04-18 09:22:16 -04:00
zfs_delay.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_file.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_fuid.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_ioctl_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_ioctl.h zfs_cmd: reorganise zfs_cmd_t to match original size 2025-05-27 20:01:06 -04:00
zfs_onexit.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_project.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_quota.h Show default quotas in zfs userspace tools 2025-04-03 10:36:45 -07:00
zfs_racct.h Wire O_DIRECT also to Uncached I/O (#17218) 2025-05-13 14:26:55 -07:00
zfs_ratelimit.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_refcount.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_rlock.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_sa.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_stat.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_sysfs.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_vfsops.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_vnops.h Introduce zfs rewrite subcommand (#17246) 2025-05-12 10:22:17 -07:00
zfs_znode.h Linux: sync: remove async/sync accounting 2025-08-06 09:54:30 -07:00
zil_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zil.h Allow and prefer special vdevs as ZIL 2025-07-18 18:44:14 -07:00
zio_checksum.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zio_compress.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zio_crypt.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zio_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zio.h Implement dynamic gang header sizes 2025-07-09 14:02:53 -07:00
zrlock.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zthr.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zvol_impl.h ZVOL: Unify zvol minors operations and improve error handling 2025-08-06 10:10:52 -04:00
zvol.h ZVOL: Unify zvol minors operations and improve error handling 2025-08-06 10:10:52 -04:00