HomeFreeBSD

Set UFS/FFS file type to snapshot before changing its block pointers.

Description

Set UFS/FFS file type to snapshot before changing its block pointers.

A UFS/FFS snapshot file is identified with the SF_SNAPSHOT
flag to identify it as a snapshot. This flag needs to be
set before setting some of its block pointers to the special
values BLK_SNAP and BLK_NOCOPY. If the snapshot creation fails
and we call VOP_REMOVE(), the SF_SNAPSHOT flag will let the
remove routine know that the special block pointer values need
to be rolled back before attempting deletion of the file.

Also ensure that an fsck is required after setting superblock
values in the ffs_checkcgintegrity() routine.

Reported-by: Peter Holm
Tested-by: Peter Holm
MFC-after: 1 week
Sponsored-by: The FreeBSD Foundation

Details

Provenance
mckusickAuthored on Aug 12 2023, 6:20 PM
Parents
rGb1a39c31a356: vlan: Respect IFCAP_LRO mask
Branches
Unknown
Tags
Unknown