mirror_zfs/cmd
Low-power 34118eac06
Make mount.zfs(8) calling zfs_mount_at for legacy mounts as well
Commit 329e2ffa4bca456e65c3db7f5c5c04931c551b61 has made mount.zfs(8) to
call libzfs function 'zfs_mount_at', in order to propagate dataset
properties into mount options. This fix however, is limited to a special
use case where mount.zfs(8) is used in initrd with option '-o zfsutil'.
If either initrd or the user need to use mount.zfs(8) to mount a file
system with 'mountpoint' set to 'legacy', '-o zfsutil' can't be used and
the original issue #7947 will still happen.

Since the existing code already excluded the possibility of calling
'zfs_mount_at' when it was invoked as a helper program from zfs(8), by
checking 'ZFS_MOUNT_HELPER' environment variable, it makes no sense to
avoid calling 'zfs_mount_at' without '-o zfsutil'.

An exception however, is when mount.zfs(8) was invoked with '-o remount'
to update the mount options for an existing mount point. In this case
call mount(2) directly without modifying the mount options passed from
command line.

Furthermore, don't run mount.zfs(8) helper for automounting snapshot.
The above change to make mount.zfs(8) to call 'zfs_mount_at'
apparently caused it to trigger an automount for the snapshot
directory. When the helper was invoked as a result of a snapshot
automount, an infinite recursion will occur.

Since the need of invoking user mode mount(8) for automounting was to
overcome that the 'vfs_kern_mount' being GPL-only, just run mount(8)
without the mount.zfs(8) helper by adding option '-i'.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: WHR <whr@rivoreo.one>
Closes #16393
2024-08-23 10:39:09 -07:00
..
raidz_test RAID-Z expansion feature 2023-11-08 10:19:41 -08:00
zdb compress: change zio_compress API to use ABDs 2024-08-22 16:22:24 -07:00
zed zed: Add deadman-slot_off.sh zedlet 2024-05-29 10:46:41 -07:00
zfs JSON output support for zpool get 2024-08-06 12:47:00 -07:00
zinject Parallel pool import 2024-04-22 09:42:38 -07:00
zpool JSON: Fix class values for mirrored special vdevs 2024-08-06 12:47:58 -07:00
zpool_influxdb Do not report bytes skipped by scan as issued. 2023-06-30 08:47:13 -07:00
zstream zstream recompress: fix zero recompressed buffer and output 2024-08-22 16:22:24 -07:00
arc_summary Once more refactor arc_summary output 2024-08-05 09:22:51 -07:00
arcstat.in Fix arcstats for FreeBSD after zfetch support 2024-04-29 13:28:50 -07:00
dbufstat.in Consider dnode_t allocations in dbuf cache size accounting 2023-11-17 13:25:53 -08:00
fsck.zfs.in cmd: move single-file binaries up, extract udev programs to udev/ 2022-05-10 10:20:34 -07:00
Makefile.am config: use -Wno-format-truncation globally 2024-02-26 12:23:55 -08:00
mount_zfs.c Make mount.zfs(8) calling zfs_mount_at for legacy mounts as well 2024-08-23 10:39:09 -07:00
zfs_ids_to_path.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zgenhostid.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zhack.c Provide macros for setting and getting blkptr birth times 2024-03-25 15:01:54 -07:00
zilstat.in zil: add stats for commit failure/fallback (#16315) 2024-07-25 16:53:59 -07:00
ztest.c ddt: add support for prefetching tables into the ARC 2024-07-26 09:16:18 -07:00
zvol_wait zvol_wait logic may terminate prematurely 2022-10-11 12:12:04 -07:00