Subject: Should PUTPUBFH and PUTROOTFH check that fh is a dir

From: Carl Burnett <[email-masked]>
Date: Tue, 19 Nov 2002 06:41:12 -0600

It seems that it would be a good idea for PUTPUBFH and PUTROOTFH to check 
that the provided filehandle represents a directory . If not, then these 
ops would return NFS4ERR_NOTDIR. The spec currently does not show these as 
error returns for these operations.

What do people think?

Carl

Carl Burnett
AIX Kernel Architecture - Distributed File Systems
(512) 838-8498, TL 678-8498
(please reply to [email-masked])

---

From: David Robinson <[email-masked]>
Date: Tue, 19 Nov 2002 11:15:45 -0600

> error returns for these operations.

In many common NFS server solutions it is possible to export just a
single file, not a directory.  The old SunOS 4.x diskless swap
files used this feature. Would this interpretation force a
server that wanted to export just a single file to also export its
parent directory as well?

	-David

---

From: "Haynes, Tom" <[email-masked]>
Date: Tue, 19 Nov 2002 09:31:38 -0800 (PST)

> parent directory as well?

In the case of PUTROOTFH, you cannot export a single file - you need 
to provide a root of a pseudo-fs from the spec.  This root need
not be the parent of the single file, indeed it would be more flexible
to build a pseudo-directory chain from the top of the fs.

As for the PUTPUBFH, yes it can be a FH to a file and not a
directory, at least as the spec states:

   Unlike the ROOT filehandle, the PUBLIC filehandle may be bound 
   or represent an arbitrary filesystem object at the server.

Most implementations may chose to map the PUTPUBFH to the
PUTROOTFH, but assuming that it is the PUTROOTFH violates the
spec.

Also, assuming it is a directory also violates the spec as written.

-- 
Tom Haynes, cfb
[email-masked]

---

From: Eric Werme USG <[email-masked]>
Date: Tue, 19 Nov 2002 12:46:22 -0500

In many common NFS server solutions it is possible to export just a
   single file, not a directory.

Another use for exporting files is to export people's mail file.
E.g. /var/spool/mail/werme could be exported to my workstation.
locking via hard links or other separate lock file is rather ineffective,
so users would have to use "proper" locking.

	-Ric Werme

-- 
Eric (Ric) Werme         |  [email-masked], [email-masked]
Hewlett-Packard Co.      |  http://ewerme.home.attbi.com/

---

From: Spencer Shepler <[email-masked]>
Date: Tue, 19 Nov 2002 14:06:03 -0800

These two operations do not take a parameter/filehandle and therefore
there should be no concern about checking of a filehandle.

It may not be perfectly clear but the expectation is that the server
will provide a filehandle that is a directory as the current filehandle
or result of these two operations.  That is the current assumption.