Re: nfs weirdness

From: Neil Brown (
Date: Tue Jul 24 2001 - 05:54:14 EST

On Monday July 23, wrote:
> yesterday cleanly installed a system that is known to export three dirs
> without problems with NFS on 2.2.16.
> The system is at 2.4.4 (SuSE) and while the same exports file is used, I
> get a problem that is identified with exportfs.
> using knfsd, exports looks like :
> /cdrom
> /windows
> /udf
> exportfs -av with :
> /dev/hdd on /udf type udf; /dev/hdc on /media/cdrom type iso9660 and
> /windows is NOT mounted.
> exporting
> exporting
> exporting
> reexporting to kernel
> reexporting to kernel
> reexporting to kernel
> looks good. remote mounts als shows no error :
> toshiba:/cdrom 575506 575506 0 100% /tcdrom
> toshiba:/windows 976216 895820 30804 97% /windows
> toshiba:/udf 545984 530948 15036 98% /udf
> except that /windows was NOT mounted so should be empty. it in fact
> reflects the fs size, free etc of the root FS of toshiba. ls /windows on
> shows no files.
> now, if I mount /windows on toshiba, there are files. all ok, however,
> exporting it causes :
> reexporting to kernel
> Invalid argument
> (/dev/hda1 on /windows type vfat)
> and mounting via nfs :
> mount: toshiba:/windows failed, reason given by server: Permission
> denied
> /v/l/m shows :
> rpc.mountd: authenticated mount request from for /windows (/windows)
> rpc.mountd: getfh failed: Operation not permitted
> I'm lost, completely now. it worked with the old kernel/setup, now it
> doesn't.

What you describe is exactly what I would expect. It might work
differently with unfsd - the user space nfs server, but this is all
correct for knfsd.

knfsd exports filesystems, or parts there-of. It doesn't export
'parts of the visible namespace'.

If you ask to export "/windows" and nothing is mounted on "/windows",
then you are asking to export part of the root filesystem starting at
"/windows". If you subsequently mount something on /windows, then you
haven't asked for that to be exported so it won't be, and mountd will
get confused.
You should always mount filesystems before trying to export them.

Now I appreciate that this could all be a bit more transparent, but
unfortunately it isn't and probably won't be for a while.

Possible changes to reduce the confusion:

1/ Don't allow a directory that is exported to be mounted on.
2/ Have a "mountpoint" export option which means "only export this
    directory if it is a mountpoint".

Patches welcome.....


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:15 EST