ports/126633: Snapshot Utiity on a UFS-only System loads zfs kld

Cy Schubert cy at FreeBSD.org
Mon Aug 18 21:10:02 UTC 2008


>Number:         126633
>Category:       ports
>Synopsis:       Snapshot Utiity on a UFS-only System loads zfs kld
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 18 21:10:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Cy Schubert
>Release:        FreeBSD-2.0
>Organization:
FreeBSD
>Environment:
System: FreeBSD cwsys 7.0-STABLE FreeBSD 7.0-STABLE #0: Sun Jul 13 14:50:29 PDT 2008 root at cwsys:/export/obj/opt/src/svn-stable7/sys/KOMQUATS i386


	
>Description:
The snapshot utility is a great application. I have a patch that would be 
helpful on UFS-only systems. When snapshot is run it issues zfs commands 
which automatically kldload the ZFS kld. Though I use ZFS on one of my 
servers, the rest of my systems don't use it yet and I have no plans to use 
it on my laptop FreeBSD system. Here is a patch that would only perform ZFS 
snapshot operations if the ZFS kernel module is loaded.
>How-To-Repeat:
Run snapshot or periodic-snapshot on a UFS-only system.
>Fix:

--- /usr/local/sbin/snapshot	2008-01-04 10:36:18.000000000 -0800
+++ snapshot.new	2008-05-15 15:08:02.000000000 -0700
@@ -142,7 +142,7 @@
                 fi
             fi
         fi
-        if (zfs list $fs_dir) >/dev/null 2>&1; then
+        if (kldstat -q -m zfs && zfs list $fs_dir) >/dev/null 2>&1; then
             #   ZFS filesystem
             fs_type="zfs"
             zfs=`zfs list -H -o name $fs_dir`
@@ -263,7 +263,7 @@
     fi
 
     #   operate on filesystem
-    if (zfs list $fs_dir) >/dev/null 2>&1; then
+    if (kldstat -q -m zfs && zfs list $fs_dir) >/dev/null 2>&1; then
         #   ZFS filesystem
         fs_name=`zfs list -H -o name $fs_dir`
 
@@ -357,7 +357,7 @@
     parseFTG "$fs"
 
     #   operate on filesystem
-    if (zfs list $fs_dir) >/dev/null 2>&1; then
+    if (kldstat -q -m zfs && zfs list $fs_dir) >/dev/null 2>&1; then
         #   ZFS filesystem
 
         #   check for existence of snapshot
@@ -420,7 +420,7 @@
     parseFTG "$fs"
 
     #   operate on filesystem
-    if (zfs list $fs_dir) >/dev/null 2>&1; then
+    if (kldstat -q -m zfs && zfs list $fs_dir) >/dev/null 2>&1; then
         #   ZFS filesystem
 
         #   check for existence of snapshot
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list