]> git.proxmox.com Git - mirror_zfs.git/commit - tests/zfs-tests/tests/Makefile.am
Enforce "-F" flag on resuming recv of full/newfs on existing dataset
authorJitendra Patidar <53164267+jsai20@users.noreply.github.com>
Tue, 27 Sep 2022 23:34:27 +0000 (05:04 +0530)
committerGitHub <noreply@github.com>
Tue, 27 Sep 2022 23:34:27 +0000 (16:34 -0700)
commit3ed9d6883bcf3c55f92cdaaa6bf1aee2e6fb4115
treed0b40df5a492cf0801a2c79ea8769b9e66664c11
parenta2163a96ae8708bb083e8da7658c02a7047516ba
Enforce "-F" flag on resuming recv of full/newfs on existing dataset

When receiving full/newfs on existing dataset, then it should be done
with "-F" flag. Its enforced for initial receive in checks done in
zfs_receive_one function of libzfs. Similarly, on resuming full/newfs
recv on existing dataset, it should be done with "-F" flag.

When dataset doesn't exist, then full/new recv is done on newly created
dataset and it's marked INCONSISTENT. But when receiving on existing
dataset, recv is first done on %recv and its marked INCONSISTENT.
Existing dataset is not marked INCONSISTENT. Resume of full/newfs
receive with dataset not INCONSISTENT indicates that its resuming newfs
on existing dataset. So, enforce "-F" flag in this case.

Also return an error from dmu_recv_resume_begin_check() in zfs kernel,
when its resuming full/newfs recv without force.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Chunwei Chen <david.chen@nutanix.com>
Signed-off-by: Jitendra Patidar <jitendra.patidar@nutanix.com>
Closes #13856
Closes #13857
contrib/pyzfs/libzfs_core/_constants.py
include/libzfs.h
include/sys/fs/zfs.h
lib/libzfs/libzfs_sendrecv.c
lib/libzfs/libzfs_util.c
module/zfs/dmu_recv.c
tests/runfiles/common.run
tests/zfs-tests/tests/Makefile.am
tests/zfs-tests/tests/functional/rsend/rsend_030_pos.ksh [new file with mode: 0755]