mirror_zfs/lib/libzfs
Ryan Moeller 76a157f004 Add 'zfs rename -u' to rename without remounting
Allow to rename file systems without remounting if it is possible.
It is possible for file systems with 'mountpoint' property set to
'legacy' or 'none' - we don't have to change mount directory for them.
Currently such file systems are unmounted on rename and not even
mounted back.

This introduces layering violation, as we need to update
'f_mntfromname' field in statfs structure related to mountpoint (for
the dataset we are renaming and all its children).

In my opinion it is worth it, as it allow to update FreeBSD in even
cleaner way - in ZFS-only configuration root file system is ZFS file
system with 'mountpoint' property set to 'legacy'. If root dataset is
named system/rootfs, we can snapshot it (system/rootfs@upgrade), clone
it (system/oldrootfs), update FreeBSD and if it doesn't boot we can
boot back from system/oldrootfs and rename it back to system/rootfs
while it is mounted as /. Before it was not possible, because
unmounting / was not possible.

Authored by: Pawel Jakub Dawidek <pjd@FreeBSD.org>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported by: Matt Macy <mmacy@freebsd.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10839
2020-09-03 16:16:15 -07:00
..
os FreeBSD: Fix module autoloading when built in base 2020-08-11 13:49:50 -07:00
.gitignore Clean up lib dependencies 2020-07-10 14:26:00 -07:00
libzfs_changelist.c Add 'zfs rename -u' to rename without remounting 2020-09-03 16:16:15 -07:00
libzfs_config.c Use zfs_ioctl with zfs_cmd_t in libzfs 2019-10-23 17:29:43 -07:00
libzfs_crypto.c Fix typos 2020-06-09 21:24:09 -07:00
libzfs_dataset.c Add 'zfs rename -u' to rename without remounting 2020-09-03 16:16:15 -07:00
libzfs_diff.c Don't open zfs control device exclusively 2020-02-28 14:54:14 -08:00
libzfs_import.c Persistent L2ARC 2020-04-10 10:33:35 -07:00
libzfs_iter.c Mark functions as static 2020-06-18 12:20:38 -07:00
libzfs_mount.c Remove dependency on sharetab file and refactor sharing logic 2020-07-13 09:19:18 -07:00
libzfs_pool.c Remove unused zpool_is_bootable 2020-08-18 09:30:12 -07:00
libzfs_sendrecv.c zpool: Change base URL for ZFS messages to openzfs-docs 2020-08-27 16:06:57 -07:00
libzfs_status.c Import vdev ashift optimization from FreeBSD 2020-08-21 12:53:17 -07:00
libzfs_util.c Don't assert on nvlists larger than SPA_MAXBLOCKSIZE 2020-08-25 11:04:20 -07:00
libzfs.pc.in Clean up lib dependencies 2020-07-10 14:26:00 -07:00
Makefile.am Disable -Wl,-z,defs for ASAN builds 2020-07-14 12:17:44 -07:00
THIRDPARTYLICENSE.openssl Fix typos in lib/ 2019-09-02 17:53:27 -07:00
THIRDPARTYLICENSE.openssl.descrip Encryption patch follow-up 2017-10-11 16:54:48 -04:00