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?