RFC: Temporary property and mount handling design changes needed to address multiple issues. #7452
TemptorSent
started this conversation in
Ideas
Replies: 2 comments
-
This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
REQUEST FOR COMMENTS / DESIGN DISCUSSION
Temporary properties, mount handling, and VFS
This issue is a request for comments and discussion regarding how to go about fixing some design issues deep in the handling of properties, mounting, and the VFS.
I began digging into issue #985 a while back, intending to simply add a couple more temporary properties for mountpoint and canmount, but after perusing the code at length, quickly came to the realization that a simple change would not be possible due to some deep design details in the property handling code, mount code, and VFS stub layer.
The following is a brief overview, which I will expand upon as time allows. A number of us have been discussing these issues on #zfsonlinux and elsewhere on irc, and have concluded that discussion on the design is needed before moving forward and it's not something that most individual developers would want to tackle without input from the subject-matter experts for the ioctl, props handling, and mount/VFS guts.
At present, temporary properties are very minimally implemented using a stub VFS layer within ZFS. Only a select number of specific mount-time properties are handled, and these do not interface with the rest of the property handling code in any meaningful way. They can not be set using the normal zfs_ioc_set_prop ioctl, and are generally implemented as an inflexible special case.
The mount interface is the primary means of setting the temporary properties, but because of the use of the system mount helper and the fact that properties are not handled internal to zfs, but rather read from /proc/mounts or /etc/mtab, there are many issues with inconsistent handling, overwritten or ignored flags, and wrong paths being displayed.
One of the major causes for the above problem and many related issues is the combined use of the mount(8) system binary and the zfs_util hack to mount filesystems, which fail to follow the expected semantics of either zfs or linux. It appears that libmount may provide a more appropriate interface.
My initial thought is that temporary properties should be handled through the same infrastructure as normal properties, either changing the existing zfs_ioc_set_prop ioctl interface or adding a new one that either allows specifying the property source, or explicitly sets a temporary property.
Mount handling should be able to handle any property for which it would be valid to be set on a temporary basis; additionally, adding a flag to zfs set or a new sub command ( zfs set-temp ) to allow setting properties would be useful and follow logically.
One of the more important uses for temporary properties is allowing mountpoint to be set to '/' at boot time for the bootfs, while leaving it's permanent mountpoint property set to something that has no namespace conflicts with other BEs.
This, plus allowing the filesystem to be mounted to a different location than the mountpoint property, would allow proper boot-time handling of mounts from within the initramfs environment before pivot_root takes place.
I have started a list of related issues, including some which are closed, but contain relevant discussion below, please let me know what other issues to include for reference:
Temporary property issues:
#7449 - mount -tzfs -ozfsutils does not respect readonly property
#7374 - zfs-mount ignores noauto for zvols in fstab
#4553 - Can't override 'mountpoint' when mounting a filesystem
#4470 - Temporary relatime=on acts like relatime=off
#4101 - Mount option mode
#3519 - Mounting with -o noatime succeeds and shows in /proc/mounts, but is not authoritative
#1078 -
zfs mount
inside a chroot on a pool imported with -R can result in a double prefix#985 - Add temporary mount point properties
Other mount handling and VFS issues:
#7385 - zfs mount fails silently, when /etc/fstab has a conflicting entry
#7346 - etc/init.d/zfs-mount tries to mount swap zvol
#7294 - Adding --no-canonicalize prevents user mounts
#7128 - Mounting a dataset as read-only "alters" it and incremental snapshot receiving made impossible
#4366 - Add dirsync support
#4300 - Support simplified initramfs/initramfs-less boot
#3942 - Nested data sets don't inherit ACLs from parents despite "aclinherit=passthrough"
#3812 - mountpoint=legacy and fstab
#3159 - Utilize the 'zoned' property in Linux
#3098 - Feature: new dataset flag 'chroot' - don't mount sub-datasets automatically
#2771 -
zfs mount
doesn't handle options with embeddedremount
properly.#2653 - readonly property returned incorrectly
#2503 - Add 'overlay' dataset property
#2201 - "zfs inherit" should remount datasets
#2114 - zfs-initramfs prevents multiple bootfs swaps
#1917 - strictatime, not relatime
#1504 - cannot set rootcontext on non-legacy mountpoints by default
#1478 - Linux: /etc/fstab and filesystems on ZVOL
#1457 - zfs is ignoring umask
#1035 - Retire the zpool.cache file
#971 - bind mounts in fstab work improperly when pointing to ZFS
#872 - Kernels with builtin ZFS support lack a way to mount a ZFS dataset as a rootfs without an initramfs
#744 - zfs inherit or set mountpoint attempts to remount even when it would be a noop
#667 - mount on non-emtpy mountpoint: default -O for 'zfs mount'
#526 - zfs mount is not namespace aware
#434 - Support ZFS delegations
#260 - Support freeze/thaw
#224 - Direct IO
#119 - ZFS mount behavior
#101 - "zfs mount -a" adds incorrect device/dataset entry to /etc/mtab when current directory is "/"
Beta Was this translation helpful? Give feedback.
All reactions