# HG changeset patch # User Franz Glasner # Date 1727623372 -7200 # Node ID 83ec66c64f47ae344d0571e0daf17ccc39af8123 # Parent bc418b122fc9e72846791a0de3aa75439ddeaea8 ftjail: Also check in {check-}freebsd-update that no "unionfs" type filesystems are mounted. "unionfs"-type filesystems can not automatically re-mounted properly because there is not enough information for a proper mount in the requested fstab. diff -r bc418b122fc9 -r 83ec66c64f47 sbin/ftjail --- a/sbin/ftjail Sun Sep 29 16:27:22 2024 +0200 +++ b/sbin/ftjail Sun Sep 29 17:22:52 2024 +0200 @@ -1054,15 +1054,26 @@ [ "${_root_origin}" = '-' ] && farray_append _errors "the root dataset is not a ZFS clone" fi # - # Check for open files on all the mounted filesystems. - # If snapshots are requested check that they are related somehow to - # mounted filesystems. + # 1. Check for open files on all the mounted filesystems. + # 2. Check for mounted filesystems that cannot re-mounted successfuly + # because the fstab does not contain all the needed informations + # (e.g. unionfs). + # 3. If snapshots are requested check that they are related somehow to + # mounted filesystems. # _sn_ds_related='' while IFS=$'\t' read -r _mnt_device _mnt_mountpoint _mnt_type _mnt_options _line; do if ! _check_no_open_files_on_filesystem "${_mnt_mountpoint}" ; then farray_append _errors "There are open files or memory mapping on file system \`${_mnt_mountpoint}'" fi + case "${_mnt_type}" in + unionfs) + farray_append _errors "A \`${_mnt_type}' filesystem is mounted at \`${_mnt_mountpoint}' which cannot re-mounted properly" + ;; + *) + true + ;; + esac _idx=1 while falist_tryget_key_at_index _sn_ds _opt_snapshots ${_idx}; do case "${_mnt_device}" in @@ -1256,13 +1267,25 @@ [ "${_root_origin}" = '-' ] && { echo "ERROR: the root dataset is not a ZFS clone" 1>&2; return 1; } fi # - # Check for open files on all the mounted filesystems + # 1. Check for open files on all the mounted filesystems. + # 2. Check for mounted filesystems that cannot re-mounted successfuly + # because the fstab does not contain all the needed informations + # (e.g. unionfs). # while IFS=$'\t' read -r _mnt_device _mnt_mountpoint _mnt_type _mnt_options _line; do if ! _check_no_open_files_on_filesystem "${_mnt_mountpoint}" ; then err "There are open files or memory mapping on file system \`${_mnt_mountpoint}'" return 1 fi + case "${_mnt_type}" in + unionfs) + err "A \`${_mnt_type}' filesystem is mounted at \`${_mnt_mountpoint}' which cannot re-mounted properly" + return 1 + ;; + *) + true + ;; + esac done <