That is true. I am working on it right now.
>
> 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.
>
I just added "struct knfs_fh fh" to "struct nfsd_netlink_callback".
mountd will check if xdev and xino from get_rootfh () match the
ones in "struct nfsd_netlink_callback".
> 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.
>
It doesn't work in my case. The problem happens
1. Server has a fs /home
2. Server exports /home/work/linux.
3. Client mount /home/work/linux
4. Server exports /home instead of /home/work/linux and restarts.
5. Client accesses /home/work/linux on server.
Now mountd cannot insert a negative entry due to the export rule in
the kernel. Client will hang in that case. I don't know what the
best fix is. Is that possible to get synchronous communication between
mountd and kernel?
For the time being, I am going to add a timeout to mountd callback. If
kernel doesn't get response from mountd within a few seconds, it will
tell the client that fh is stale.
> 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.
>
>
-- H.J. Lu (hjl@gnu.org)- 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/