<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 accessing file or directory.<BR>
<BR>
My /etc/exports file:<BR>
<BR>
/mnt/storage_pool/testnfs00 *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs01 *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs02 *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs03 *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs04 *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs05 *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs06 *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs07 *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs08 *(rw,sync,no_root_squash)<BR>
/mnt/storage_pool/testnfs09 *(rw,sync,no_root_squash)<BR>
<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 <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 *(rw,no_root_squash,sync,wdelay,no_subtree_check,uuid=0000fd02:00000000:00000000:00000000)<BR>/mnt/storage_pool/testnfs04 *(rw,no_root_squash,sync,wdelay,no_subtree_check,uuid=0000fd04:00000000:00000000:00000000)<B
R>/mnt/storage_pool/testnfs00 *(rw,no_root_squash,sync,wdelay,no_subtree_check,uuid=0000fd00:00000000:00000000:00000000)<BR>/mnt/storage_pool/testnfs05 *(rw,no_root_squash,sync,wdelay,no_subtree_check,uuid=0000fd05:00000000:00000000:00000000)<BR>/mnt/storage_pool/testnfs01 *(rw,no_root_squash,sync,wdelay,no_subtree_check,uuid=0000fd01:00000000:00000000:00000000)<BR>/mnt/storage_pool/testnfs03 *(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/ <BR>channel content flush <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>
<BR>
When I mount "/mnt/storage_pool/testnfs07" which does not appear in the proc info , problem happens, I can not even mount from local machine.<BR>
<BR>
More info: <BR>
1. I use tcpdump and find that STALE returns when FSINFO call during mount procdure, please check the attached screenshot.<BR>
2. I debug nfsd, and find that FSINFO fail stack:<BR>
cache_check() return -ENOENT or -EAGAIN<BR>
exp_find_key()<BR>
exp_find()<BR>
rqst_exp_find()<BR>
nfsd_set_fh_dentry()<BR>
fh_verify()<BR>
nfsd3_proc_fsinfo()<BR>
<BR>
Please help me, my kernel is still 2.6.35.6.<BR>
Looking forward for your reply!<BR>
<BR>
Thanks!<BR> <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> <BR>
<DIV>> Date: Mon, 28 Nov 2011 06:19:47 -0500<BR>> From: hch@infradead.org<BR>> To: ygq51@hotmail.com<BR>> Subject: Re: xfs: validate inode numbers in file handles correctly<BR>> CC: linux-xfs@oss.sgi.com; pengxihan@gmail.com<BR>> <BR>> Guoquan and hank,<BR>> <BR>> are you using 32-bit or 64-bit kernels? I just noticed we have a<BR>> problem with exporting 64-bit inodes on 32-bit kernel because the<BR>> VFS i_ino field is just 32-bits long. The patch below would fix<BR>> that issue.<BR>> <BR>> --- xfs.orig/fs/xfs/linux-2.6/xfs_export.c 2011-11-28 12:11:08.923630697 +0100<BR>> +++ xfs/fs/xfs/linux-2.6/xfs_export.c 2011-11-28 12:13:21.766244360 +0100<BR>> @@ -61,6 +61,8 @@ xfs_fs_encode_fh(<BR>> struct fid *fid = (struct fid *)fh;<BR>> struct xfs_fid64 *fid64 = (struct xfs_fid64 *)fh;<BR>> struct inode *inode = dentry->d_inode;<BR>> + struct inode *parent;<BR>> + struct xfs_inode *ip = XFS_I(inode);<BR>> int fi
leid_ type;<BR>> int len;<BR>> <BR>> @@ -98,22 +100,24 @@ xfs_fs_encode_fh(<BR>> switch (fileid_type) {<BR>> case FILEID_INO32_GEN_PARENT:<BR>> spin_lock(&dentry->d_lock);<BR>> - fid->i32.parent_ino = dentry->d_parent->d_inode->i_ino;<BR>> - fid->i32.parent_gen = dentry->d_parent->d_inode->i_generation;<BR>> + parent = dentry->d_parent->d_inode;<BR>> + fid->i32.parent_ino = XFS_I(parent)->i_ino;<BR>> + fid->i32.parent_gen = parent->i_generation;<BR>> spin_unlock(&dentry->d_lock);<BR>> /*FALLTHRU*/<BR>> case FILEID_INO32_GEN:<BR>> - fid->i32.ino = inode->i_ino;<BR>> + fid->i32.ino = ip->i_ino;<BR>> fid->i32.gen = inode->i_generation;<BR>> break;<BR>> case FILEID_INO32_GEN_PARENT | XFS_FILEID_TYPE_64FLAG:<BR>> spin_lock(&dentry->d_lock);<BR>> - fid64->parent_ino = dentry->d_parent->d_inode->i_ino;<BR>> - fid64->parent_
gen = dentry->d_parent->d_inode->i_generation;<BR>> + parent = dentry->d_parent->d_inode;<BR>> + fid64->parent_ino = XFS_I(parent)->i_ino;<BR>> + fid64->parent_gen = parent->i_generation;<BR>> spin_unlock(&dentry->d_lock);<BR>> /*FALLTHRU*/<BR>> case FILEID_INO32_GEN | XFS_FILEID_TYPE_64FLAG:<BR>> - fid64->ino = inode->i_ino;<BR>> + fid64->ino = ip->i_ino;<BR>> fid64->gen = inode->i_generation;<BR>> break;<BR>> }<BR>> <BR>> _______________________________________________<BR>> xfs mailing list<BR>> xfs@oss.sgi.com<BR>> 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>