2007-11-29 16:45:05

by Eric Paris

[permalink] [raw]
Subject: 2.6.24-rc3 unable to mount something which should use nohide

NFS server "paris" (some 2.6.18 based kernel):

[root@paris ~]# mount | grep storage
/dev/mapper/StorageVG01-LogVol00 on /export/storage type ext3 (rw)
/dev/mapper/KernelVG01-LogVol00 on /export/storage/kernel type ext3 (rw)
[root@paris ~]# cat /etc/exports
/export/storage *(rw,sync,all_squash,anonuid=500,anongid=500)
/export/storage/kernel *(rw,sync,all_squash,anonuid=500,anongid=500,nohide)

On my clients x86_64 running an almost clean-from-git 2.6.24-rc3 kernel:

[root@dhcp231-145 ~]# mount -o noatime paris:/export/storage /storage
[root@dhcp231-145 ~]# ls /storage/kernel
ls: cannot access /storage/kernel: Stale NFS file handle

(notice /storage/kernel should be triggering that nohide mount
for /export/storage/kernel) so I figured maybe that automatic nohide
stuff was broken. I'll try by hand:

[root@dhcp231-145 ~]# mount paris:/export/storage/kernel /storage/kernel
mount.nfs: Stale NFS file handle

Same thing. Nothing in dmesg or /var/log/messages. I know this worked
not long ago....

-Eric



2007-11-29 17:41:40

by Trond Myklebust

[permalink] [raw]
Subject: Re: 2.6.24-rc3 unable to mount something which should use nohide

commit 72e40add4adad50613083f1fda117fd74aa875ac
Author: Trond Myklebust <[email protected]>
Date: Thu Nov 29 12:39:46 2007 -0500

NFS: Fix NFS mountpoint crossing...

The check that was added to nfs_xdev_get_sb() to work around broken
servers, works fine for NFSv2, but causes mountpoint crossing on NFSv3 to
always return ESTALE.

Signed-off-by: Trond Myklebust <[email protected]>

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 2426e71..ea92920 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1475,7 +1475,7 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
error = PTR_ERR(mntroot);
goto error_splat_super;
}
- if (mntroot->d_inode->i_op != &nfs_dir_inode_operations) {
+ if (mntroot->d_inode->i_op != server->nfs_client->rpc_ops->dir_inode_ops) {
dput(mntroot);
error = -ESTALE;
goto error_splat_super;


Attachments:
fix_mountpoint_crossing.dif (907.00 B)

2007-11-29 18:03:25

by Eric Paris

[permalink] [raw]
Subject: Re: 2.6.24-rc3 unable to mount something which should use nohide

On Thu, 2007-11-29 at 12:41 -0500, Trond Myklebust wrote:
> On Thu, 2007-11-29 at 11:44 -0500, Eric Paris wrote:
> >
> > [root@dhcp231-145 ~]# mount paris:/export/storage/kernel /storage/kernel
> > mount.nfs: Stale NFS file handle
> >
> > Same thing. Nothing in dmesg or /var/log/messages. I know this worked
> > not long ago....
>
> Yep. I think the following patch ought to fix it.
>
> Cheers
> Trond

Worked like a charm, thanks!

-Eric