I haven't actually down loaded 1.5.1 yet, but based on 1.5 plus these
patches, one thing that stands out is that creating negative export
entries will not work in general (Though they may work in many
specific situations).
An NFS file handle has xdev and xino entries which indicate which
export entry is being used. If mountd is to give an NFSEXP_NEGATIVE
entry to the kernel to reject a given file handle, it needs to know
this xdev/xino information somehow. Currently it doesn't (unless, by
luck, xdev/xino is the root file the filesystem).
It is only given the device, and the path to the actual file which is
being accessed.
How I would fix it (I wont be able to do it myself for about 2 weeks):
change find_fh_dentry to take a dev/ino/parentino triple instead of
a file handle, where the parentino is ignored if ino is a
directory (but start with my new find_fh_dentry from
http://www.cse.unsw.edu.au/~neilb/oss/knfsd/knfsd.1.4.7-patch-2a
if you haven't already).
change fh_verify to call it this way.
change nfsd_netlink_notify to pass xdev/xino/0 to the new
find_fh_dentry to get a dentry for the export point. Pass up to
mountd exactly the d_path for this dentry. No need for a separate
device name (and no need to make lookup_vfsmnt an exported symbol),
and no need for the path to the actual file being accessed.
make the (hopefully) obvious changes to mountd.
Actually, this is more of a symptomatic fix that a proper fix.
see
http://localhost/~neilb/oss/knfsd/mail/archive/0031.html
for my current thoughts on how it "should" work.
NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/