kern/67545: NFS Diskless Mount problem

Sergey V. Efimoff risky at stabilis.ru
Thu Jun 3 13:10:31 PDT 2004


>Number:         67545
>Category:       kern
>Synopsis:       NFS Diskless Mount Option Suggestion
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 03 13:10:28 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Sergey V. Efimoff
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
Stabilis Systems Ltd.
>Environment:
System: FreeBSD mordor.stabilis.ltd 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Sun Apr 18 12:17:12 MSD 2004 risky at mordor.stabilis.ltd:/usr/src/sys/i386/compile/MORDOR i386
 
 
>Description:
While implementing remote boot of FreeBSD operating system,
I figured out some problem. The server was functioning under
control of Linux Slackware (don't mention it, it was
necessary due to hardware compatibility), client OS was
5.2-CURRENT. Root file system was mounted over NFS.
  
The client OS booted well, but then some software tried
to use flock() syscall, which is not supported over NFS
even with rpc.lockd (I don't know if it is connected with
BSD vs System V problem or with incompatibility of
BSD and Linux implementations of rpc.lockd). When lockd
is not loaded, flock() fails, otherwise it hangs.
  
mount_nfs() has '-L' option which allows to forward lock
requests to a local system thus making rpc.lockd use
sensless and, therefore, allows to avoid incompatibility
problems. But, as far as I know, it is useful only during
initial mount, not when changing mount options later.
As for inital root NFS mount, the kernel does not set
NFSMNT_NOLOCKD flag when mounting remote file system,
so rpc.lockd use becomes mandatory.
  
I had to apply some cheat on nfs_vfsopts.c in order to
disable lockd calls; it was simply code line like
args->flags |= NFSMNT_NOLOCKD. Then I thought that it
probably would not be a bad idea to include kernel option
into LINT which would allow user to decide if he wants
to use NFS root with rpc.lockd or without it.
>How-To-Repeat:
Simply try passwd(1) on diskless station regardless of rpc.lockd
presence with Slackware NFS server.
>Fix:
The code line mentioned above works fine being inserted
into nfs_mountdiskless() before mountnfs() (nfsclient/nfs_vfsopts.c).
The best solution (as for my point of view) is kernel option.
 

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


More information about the freebsd-bugs mailing list