Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Apr 2008 21:34:56 GMT
From:      Leon Kos <leon.kos@lecad.fs.uni-lj.si>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/122833: mountd fails on nmount() after UFS snapshot creation with mount
Message-ID:  <200804162134.m3GLYuAO052842@www.freebsd.org>
Resent-Message-ID: <200804162140.m3GLe0SR016250@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         122833
>Category:       kern
>Synopsis:       mountd fails on nmount()  after UFS snapshot creation with mount
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 16 21:40:00 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Leon Kos
>Release:        RELENG_7
>Organization:
University of Ljubljana
>Environment:
FreeBSD cad.lecad.uni-lj.si 7.0-STABLE FreeBSD 7.0-STABLE #22: Wed Apr 16 10:41:55 CEST 2008     leon@cad.lecad.uni-lj.si:/usr/obj/usr/src/sys/CAD  i386

>Description:
After creating snapshot on filesystem mountd is unable to export under that tree.

Debugging /usr/src/usr.sbin/mountd/mountd.c shows that that it fails on nmount() when clearing exports list and also when creating it. 

dmesg -a shows

Apr 16 18:37:06 cad mountd[1207]: can't delete exports for /usr: Cross-device link 
Apr 16 18:37:06 cad mountd[1207]: can't export /usr/tmp 
Apr 16 18:37:06 cad mountd[1207]: bad exports list line /usr /usr/tmp -network 192.168 -mask 255.255.0.0
Apr 16 18:49:52 cad mountd[1938]: can't delete exports for /usr: Cross-device link 

Even tried mountd.c from trunk with no improvements.

When googling for "UFS snapshot weirdness" some users suggested that this is ipv6 issue. but from my experience it is not so.

>How-To-Repeat:
root@cad:~# showmount -e
Exports list on localhost:
/usr/tmp                           192.168.0.0 
/usr                               192.168.0.0 
/home/xlsvaje                      192.168.5.0 
/home                              192.168.5.0 
/tftpboot                          192.168.0.0 
root@cad:~# snapshot make /usr:daily
root@cad:~# showmount -e
Exports list on localhost:
/home/xlsvaje                      192.168.5.0 
/home                              192.168.5.0 
/tftpboot                          192.168.0.0 

>Fix:
Use command like:
root@cad:~# mksnap_ffs /usr /usr/.snap/daily.0

Do not use:
root@cad:~# mount -u -o snapshot   /usr/.snap/daily.0 /usr
or 
root@cad:~#snapshot make /usr:daily


When mountd fails to export only reboot helps.
Restarting mountd does not help. 
Removing created snapshot does not help.

Attached patch is only the fix for freebsd-snapshot utility and not the solution.

Beware there could also be dangling /usr/sbin/snapshot 

Patch attached with submission follows:

--- /usr/local/sbin/snapshot.orig       2008-04-16 19:42:15.000000000 +0200
+++ /usr/local/sbin/snapshot    2008-04-16 19:50:54.000000000 +0200
@@ -335,7 +335,7 @@
             done
 
             #   create new snapshot
-            system mount -u -o snapshot $fs_dir/.snap/$fs_tag.$fs_gen $fs_dir
+            system mksnap_ffs $fs_dir $fs_dir/.snap/$fs_tag.$fs_gen
         fi
     fi


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804162134.m3GLYuAO052842>