<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:΢ÈíÑźÚ
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
NFS Stale File Handle Again, But this happens when mount operation not during&nbsp;accessing file or directory.<BR>
&nbsp;<BR>
My /etc/exports file:<BR>
&nbsp;<BR>
/mnt/storage_pool/testnfs00&nbsp;&nbsp;&nbsp;&nbsp; *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs01&nbsp;&nbsp;&nbsp;&nbsp; *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs02&nbsp;&nbsp;&nbsp;&nbsp; *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs03&nbsp;&nbsp;&nbsp;&nbsp; *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs04&nbsp;&nbsp;&nbsp;&nbsp; *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs05&nbsp;&nbsp;&nbsp;&nbsp; *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs06&nbsp;&nbsp;&nbsp;&nbsp; *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs07&nbsp;&nbsp;&nbsp;&nbsp; *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs08&nbsp;&nbsp;&nbsp;&nbsp; *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs09&nbsp;&nbsp;&nbsp;&nbsp; *(rw,sync,no_root_squash)<BR>
&nbsp;<BR>
Proc info as follows:<BR>
<A href="mailto:root@Dahua_Storage">root@Dahua_Storage</A>:~# cat /proc/net/rpc/nfsd<BR>rc 0 5428 3350<BR>fh 600 0 0 0 0<BR>io 0 1195819008<BR>th 8 0 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000<BR>ra 32 0 0 0 0 0 0 0 0 0 0 0<BR>net 8779 1 8771 1<BR>rpc 8778 0 0 0 0<BR>proc2 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0<BR>proc3 22 1 819 0 840 1432 0 0 4587 12 0 0 0 829 0 0 0 0 37 10 0 0 210<BR>proc4 2 0 0<BR>proc4ops 59 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0&nbsp;&nbsp;&nbsp; <BR><A href="mailto:root@Dahua_Storage">root@Dahua_Storage</A>:~# cat /proc/net/rpc/nfsd.export/content <BR>#path domain(flags)<BR>/mnt/storage_pool/testnfs02&nbsp;&nbsp;&nbsp;&nbsp; *(rw,no_root_squash,sync,wdelay,no_subtree_check,uuid=0000fd02:00000000:00000000:00000000)<BR>/mnt/storage_pool/testnfs04&nbsp;&nbsp;&nbsp;&nbsp; *(rw,no_root_squash,sync,wdelay,no_subtree_check,uuid=0000fd04:00000000:00000000:00000000)<B
 R>/mnt/storage_pool/testnfs00&nbsp;&nbsp;&nbsp;&nbsp; *(rw,no_root_squash,sync,wdelay,no_subtree_check,uuid=0000fd00:00000000:00000000:00000000)<BR>/mnt/storage_pool/testnfs05&nbsp;&nbsp;&nbsp;&nbsp; *(rw,no_root_squash,sync,wdelay,no_subtree_check,uuid=0000fd05:00000000:00000000:00000000)<BR>/mnt/storage_pool/testnfs01&nbsp;&nbsp;&nbsp;&nbsp; *(rw,no_root_squash,sync,wdelay,no_subtree_check,uuid=0000fd01:00000000:00000000:00000000)<BR>/mnt/storage_pool/testnfs03&nbsp;&nbsp;&nbsp;&nbsp; *(rw,no_root_squash,sync,wdelay,no_subtree_check,uuid=0000fd03:00000000:00000000:00000000)<BR><A href="mailto:root@Dahua_Storage">root@Dahua_Storage</A>:~# cat /proc/net/rpc/nfsd.fh/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>channel&nbsp; content&nbsp; flush&nbsp;&nbsp;&nbsp; <BR><A href="mailto:root@Dahua_Storage">root@Dahua_Storage</A>:~# cat /proc/net/rpc/nfsd.fh/content <BR>#domain fsidtype fsid [path]<BR>* 6 0x00fd0000000000000000000000000000 /mnt/storage_pool/
 testnfs00<BR>* 6 0x03fd0000000000000000000000000000 /mnt/storage_pool/testnfs03<BR>* 6 0x02fd0000000000000000000000000000 /mnt/storage_pool/testnfs02<BR>* 6 0x01fd0000000000000000000000000000 /mnt/storage_pool/testnfs01<BR># * 6 0x06fd0000000000000000000000000000<BR>* 6 0x05fd0000000000000000000000000000 /mnt/storage_pool/testnfs05<BR>* 6 0x04fd0000000000000000000000000000 /mnt/storage_pool/testnfs04<BR># * 6 0x09fd0000000000000000000000000000<BR># * 6 0x08fd0000000000000000000000000000<BR># * 6 0x07fd0000000000000000000000000000<BR>
&nbsp;<BR>
When I mount "/mnt/storage_pool/testnfs07"&nbsp;which does not appear in the proc info , problem happens, I can not even mount from local machine.<BR>
&nbsp;<BR>
More info: <BR>
1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I use tcpdump and find that STALE returns when FSINFO call during mount procdure, please check the attached screenshot.<BR>
2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I debug nfsd, and find that FSINFO fail stack:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cache_check() return -ENOENT or -EAGAIN<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exp_find_key()<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exp_find()<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rqst_exp_find()<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nfsd_set_fh_dentry()<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fh_verify()<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nfsd3_proc_fsinfo()<BR>
&nbsp;<BR>
Please help me, my kernel is still 2.6.35.6.<BR>
Looking forward for your reply!<BR>
&nbsp;<BR>
Thanks!<BR>&nbsp;<BR>
<DIV>
<DIV id=ecxSkyDrivePlaceholder></DIV>
<HR id=ecxstopSpelling>
From: ygq51@hotmail.com<BR>To: hch@infradead.org<BR>Subject: RE: xfs: validate inode numbers in file handles correctly<BR>Date: Sat, 3 Dec 2011 17:56:20 +0800<BR>CC: linux-xfs@oss.sgi.com; pengxihan@gmail.com<BR><BR>
<STYLE>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:\005fae\008f6f\0096c5\009ed1;}
</STYLE>

<DIV dir=ltr>I have tried this patch, And problem resolved!<BR>Thank you for your help!<BR><BR>&nbsp;<BR>
<DIV>&gt; Date: Mon, 28 Nov 2011 06:19:47 -0500<BR>&gt; From: hch@infradead.org<BR>&gt; To: ygq51@hotmail.com<BR>&gt; Subject: Re: xfs: validate inode numbers in file handles correctly<BR>&gt; CC: linux-xfs@oss.sgi.com; pengxihan@gmail.com<BR>&gt; <BR>&gt; Guoquan and hank,<BR>&gt; <BR>&gt; are you using 32-bit or 64-bit kernels? I just noticed we have a<BR>&gt; problem with exporting 64-bit inodes on 32-bit kernel because the<BR>&gt; VFS i_ino field is just 32-bits long. The patch below would fix<BR>&gt; that issue.<BR>&gt; <BR>&gt; --- xfs.orig/fs/xfs/linux-2.6/xfs_export.c 2011-11-28 12:11:08.923630697 +0100<BR>&gt; +++ xfs/fs/xfs/linux-2.6/xfs_export.c 2011-11-28 12:13:21.766244360 +0100<BR>&gt; @@ -61,6 +61,8 @@ xfs_fs_encode_fh(<BR>&gt; struct fid *fid = (struct fid *)fh;<BR>&gt; struct xfs_fid64 *fid64 = (struct xfs_fid64 *)fh;<BR>&gt; struct inode *inode = dentry-&gt;d_inode;<BR>&gt; + struct inode *parent;<BR>&gt; + struct xfs_inode *ip = XFS_I(inode);<BR>&gt; int fi
 leid_ type;<BR>&gt; int len;<BR>&gt; <BR>&gt; @@ -98,22 +100,24 @@ xfs_fs_encode_fh(<BR>&gt; switch (fileid_type) {<BR>&gt; case FILEID_INO32_GEN_PARENT:<BR>&gt; spin_lock(&amp;dentry-&gt;d_lock);<BR>&gt; - fid-&gt;i32.parent_ino = dentry-&gt;d_parent-&gt;d_inode-&gt;i_ino;<BR>&gt; - fid-&gt;i32.parent_gen = dentry-&gt;d_parent-&gt;d_inode-&gt;i_generation;<BR>&gt; + parent = dentry-&gt;d_parent-&gt;d_inode;<BR>&gt; + fid-&gt;i32.parent_ino = XFS_I(parent)-&gt;i_ino;<BR>&gt; + fid-&gt;i32.parent_gen = parent-&gt;i_generation;<BR>&gt; spin_unlock(&amp;dentry-&gt;d_lock);<BR>&gt; /*FALLTHRU*/<BR>&gt; case FILEID_INO32_GEN:<BR>&gt; - fid-&gt;i32.ino = inode-&gt;i_ino;<BR>&gt; + fid-&gt;i32.ino = ip-&gt;i_ino;<BR>&gt; fid-&gt;i32.gen = inode-&gt;i_generation;<BR>&gt; break;<BR>&gt; case FILEID_INO32_GEN_PARENT | XFS_FILEID_TYPE_64FLAG:<BR>&gt; spin_lock(&amp;dentry-&gt;d_lock);<BR>&gt; - fid64-&gt;parent_ino = dentry-&gt;d_parent-&gt;d_inode-&gt;i_ino;<BR>&gt; - fid64-&gt;parent_
 gen = dentry-&gt;d_parent-&gt;d_inode-&gt;i_generation;<BR>&gt; + parent = dentry-&gt;d_parent-&gt;d_inode;<BR>&gt; + fid64-&gt;parent_ino = XFS_I(parent)-&gt;i_ino;<BR>&gt; + fid64-&gt;parent_gen = parent-&gt;i_generation;<BR>&gt; spin_unlock(&amp;dentry-&gt;d_lock);<BR>&gt; /*FALLTHRU*/<BR>&gt; case FILEID_INO32_GEN | XFS_FILEID_TYPE_64FLAG:<BR>&gt; - fid64-&gt;ino = inode-&gt;i_ino;<BR>&gt; + fid64-&gt;ino = ip-&gt;i_ino;<BR>&gt; fid64-&gt;gen = inode-&gt;i_generation;<BR>&gt; break;<BR>&gt; }<BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; xfs mailing list<BR>&gt; xfs@oss.sgi.com<BR>&gt; http://oss.sgi.com/mailman/listinfo/xfs<BR></DIV></DIV><BR>_______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs</DIV>                                               </div></body>
</html>