]> granicus.if.org Git - zfs/commitdiff
zfs-functions: skip lines where mntpnt is 'none'
authorGeorgy Yakovlev <168902+gyakovlev@users.noreply.github.com>
Fri, 30 Mar 2018 19:05:24 +0000 (11:05 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 30 Mar 2018 19:05:24 +0000 (12:05 -0700)
This fixes zfs-mount initscript trying to mount swap volumes
as filesystems or anything that has 'none' as a mountpoint
in /etc/fstab.  Additionally, fixes trying to mount swap volumes
as a filesystem on RHEL.  RHEL defines mountpoint for swap
as `swap`.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Georgy Yakovlev <ya@sysdump.net>
Closes #7346
Closes #7347

etc/init.d/zfs-functions.in

index 97f2ea039d7b0c57d477e513b448fa0103e6832f..f5b74d45824e5b764bdecfdd2cc9f9727ccc9dc3 100644 (file)
@@ -393,6 +393,8 @@ read_fstab()
        i=0
        while read -r fs mntpnt fstype opts; do
                echo "$fs" | egrep -qE '^#|^$' && continue
+               echo "$mntpnt" | egrep -qE '^none|^swap' && continue
+               echo "$fstype" | egrep -qE '^swap' && continue
 
                if echo "$fs $mntpnt $fstype $opts" | grep -qE "$match"; then
                        eval export FSTAB_dev_$i="$fs"