Page MenuHomeFreeBSD

ffs: fix mksnap_ffs
ClosedPublic

Authored by rew on Mar 15 2022, 1:52 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 10 2024, 2:04 AM
Unknown Object (File)
Dec 23 2023, 1:03 AM
Unknown Object (File)
Dec 20 2023, 3:01 AM
Unknown Object (File)
Dec 12 2023, 11:39 AM
Unknown Object (File)
Aug 30 2023, 3:03 AM
Unknown Object (File)
Jul 21 2023, 1:43 AM
Unknown Object (File)
Jul 4 2023, 5:57 PM
Unknown Object (File)
Jul 4 2023, 5:57 PM
Subscribers

Details

Summary

Take a snapshot of the filesystem as-is and return without altering
ro/rw, or any other options that may be passed in from mount.

This changes the behavior of mount. A specific example, is when trying
to upgrade from ro->rw and taking a snapshot at the same time.

mount -u -w -o snapshot /snapshot /

If breaking the above behavior is unacceptable, another approach I thought of
was to put the relevant namei/vnode bits behind if statements, something like:

if (!MNT_SNAPSHOT)
    /* do namei() stuff */

It seems a bit hacky, but wouldn't change current behavior, so that
approach might be preferable.

A third approach could be to revert the commit that introduced this
breakage, and solve the original bug in a different way.

Or...am I missing an obvious solution?

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rew requested review of this revision.Mar 15 2022, 1:52 AM

I have been running tests with this patch for 18 hours, without seeing any problems.

The main clients of making snapshots are dump(8), fsck_ffs(8), and mksnap_ffs(8) and none of them want to change any other attributes. Generally speaking, administrators do not use the mount(8) command directly to take snapshots. The one other change I would recommend is to document in the mount.8 manual page that when the "snapshot" option is specified, any other options will be ignored.

This revision is now accepted and ready to land.Mar 16 2022, 9:27 PM
This revision was automatically updated to reflect the committed changes.