UFS snapshots and dump/restore

From: Sad Clouds <cryintothebluesky_at_gmail.com>
Date: Fri, 29 Mar 2024 12:15:41 UTC
Hello, I have questions about dump/restore which seem to ignore the
nodump flag for UFS snapshots:

Create snapshot:
# snapshot="/data/.snap/latest"
# mksnap_ffs ${snapshot} && chflags nodump ${snapshot}

Restore snapshot:
# snapshot="/data/.snap/latest"
# cd $(dirname ${snapshot})/../ &&
dump -0 -a -h 0 -C 16 -b 64 -f - ${snapshot} | restore -xuvf -
...
extract file ./.snap/latest
...

Despite the nodump flag, /data/.snap/latest is still dumped and
restored. This causes /data/.snap/latest to be reset to 0 bytes after
running restore and the snapshot is lost. Any idea why such behaviour?

What happens to the snapshot if I restore specific files, i.e.

# dump -0 -a -h 0 -C 16 -b 64 -f - ${snapshot} | restore -xuvf - ./file1 ./file2 ...etc

Can this cause inode numbers to change for those files in unpredictable
ways and cause corruption of the snapshot, or is this completely safe?

Thanks.