Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Jul 2006 11:18:34 +0300
From:      Danny Braniss <danny@cs.huji.ac.il>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/99873: mountd reload fails
Message-ID:  <E1FylXm-000Dfo-VU@bsd.cs.huji.ac.il>
Resent-Message-ID: <200607070820.k678KDdi064770@freefall.freebsd.org>

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

>Number:         99873
>Category:       bin
>Synopsis:       mountd reload fails
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 07 08:20:13 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Danny Braniss
>Release:        FreeBSD 6.1-STABLE
>Organization:
>Environment:
System: FreeBSD bsd 6.1-STABLE FreeBSD 6.1-STABLE #6: Fri Jun 16 12:50:38 IDT 2006 danny@bsd:/r+d/obj/bsd/r+d/6.1/src/sys/HUJI amd64

>Description:
	/usr/src/usr.sbin/mountd/mountd.c
	in get_exportlist():
	The loop to un-export all exported file systems does not
	increment the fsp pointer when continue is called, thus
	not realy unexporting all files, causing problems when
	updating. This uncovered another problem, with the very
	first if(..) in the loop.
>How-To-Repeat:
	the problem appears when you have a nfs mounted file system
	preferably before local file systems, hence on a nfs-root
	it's immediately noticed.
	type '/etc/rc.d/mountd reload' and see your local exported
	files/filesystems unexported.
>Fix:
	one suggestion:

--- /r+d/6.1/src/usr.sbin/mountd/mountd.c       Fri Jun 16 09:42:42 2006
+++ ./mountd.c  Fri Jul  7 11:03:40 2006
@@ -1012,7 +1012,7 @@
                build_iovec(&iov, &iovlen, "export", &export, sizeof(export));
        }
 
-       for (i = 0; i < num; i++) {
+       for (i = 0; i < num; i++, fsp++) {
                if (getvfsbyname(fsp->f_fstypename, &vfc) != 0) {
                        syslog(LOG_ERR, "getvfsbyname() failed for %s",
                            fsp->f_fstypename);
@@ -1049,7 +1049,6 @@
                            "can't delete exports for %s: %m",
                            fsp->f_mntonname);
                }
-               fsp++;
        }
 
        if (iov != NULL) {
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1FylXm-000Dfo-VU>