aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
authorPeter Staubach <staubach@redhat.com>2007-08-16 12:10:07 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2007-10-09 18:31:57 -0400
commit40ee5dc6af351c1b3de245abed4bd8e6a4a5646a (patch)
tree5558d5f2b3df23e745b152c439e731a7aeff7ab6 /fs/nfsd/nfs4xdr.c
parent21fcd02be34f73bbc94db267b4db6ccd7332923d (diff)
knfsd: 64 bit ino support for NFS server
Modify the NFS server code to support 64 bit ino's, as appropriate for the system and the NFS protocol version. The gist of the changes is to query the underlying file system for attributes and not just to use the cached attributes in the inode. For this specific purpose, the inode only contains an ino field which unsigned long, which is large enough on 64 bit platforms, but is not large enough on 32 bit platforms. I haven't been able to find any reason why ->getattr can't be called while i_mutex. The specification indicates that i_mutex is not required to be held in order to invoke ->getattr, but it doesn't say that i_mutex can't be held while invoking ->getattr. I also haven't come to any conclusions regarding the value of lease_get_mtime() and whether it should or should not be invoked by fill_post_wcc() too. I chose not to change this because I thought that it was safer to leave well enough alone. If we decide to make a change, it can be done separately. Signed-off-by: Peter Staubach <staubach@redhat.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Acked-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 8ef0964179bc..9cf900740c76 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1679,7 +1679,7 @@ out_acl:
1679 if (bmval0 & FATTR4_WORD0_FILEID) { 1679 if (bmval0 & FATTR4_WORD0_FILEID) {
1680 if ((buflen -= 8) < 0) 1680 if ((buflen -= 8) < 0)
1681 goto out_resource; 1681 goto out_resource;
1682 WRITE64((u64) stat.ino); 1682 WRITE64(stat.ino);
1683 } 1683 }
1684 if (bmval0 & FATTR4_WORD0_FILES_AVAIL) { 1684 if (bmval0 & FATTR4_WORD0_FILES_AVAIL) {
1685 if ((buflen -= 8) < 0) 1685 if ((buflen -= 8) < 0)
@@ -1821,16 +1821,15 @@ out_acl:
1821 WRITE32(stat.mtime.tv_nsec); 1821 WRITE32(stat.mtime.tv_nsec);
1822 } 1822 }
1823 if (bmval1 & FATTR4_WORD1_MOUNTED_ON_FILEID) { 1823 if (bmval1 & FATTR4_WORD1_MOUNTED_ON_FILEID) {
1824 struct dentry *mnt_pnt, *mnt_root;
1825
1826 if ((buflen -= 8) < 0) 1824 if ((buflen -= 8) < 0)
1827 goto out_resource; 1825 goto out_resource;
1828 mnt_root = exp->ex_mnt->mnt_root; 1826 if (exp->ex_mnt->mnt_root->d_inode == dentry->d_inode) {
1829 if (mnt_root->d_inode == dentry->d_inode) { 1827 err = vfs_getattr(exp->ex_mnt->mnt_parent,
1830 mnt_pnt = exp->ex_mnt->mnt_mountpoint; 1828 exp->ex_mnt->mnt_mountpoint, &stat);
1831 WRITE64((u64) mnt_pnt->d_inode->i_ino); 1829 if (err)
1832 } else 1830 goto out_nfserr;
1833 WRITE64((u64) stat.ino); 1831 }
1832 WRITE64(stat.ino);
1834 } 1833 }
1835 *attrlenp = htonl((char *)p - (char *)attrlenp - 4); 1834 *attrlenp = htonl((char *)p - (char *)attrlenp - 4);
1836 *countp = p - buffer; 1835 *countp = p - buffer;