diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2007-09-28 16:45:51 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2007-10-09 18:31:57 -0400 |
commit | a16e92edcd0a2846455a30823e1bac964e743baa (patch) | |
tree | 50893238dcccb1bcfc6c1160c3db4887d2f08eea /fs/nfsd | |
parent | cfdcad4da1903720b9b8c1f176e46a0ebf546be3 (diff) |
knfsd: query filesystem for NFSv4 getattr of FATTR4_MAXNAME
Without this we always return 2^32-1 as the the maximum namelength.
Thanks to Andreas Gruenbacher for bug report and testing.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: Andreas Gruenbacher <agruen@suse.de>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 9cf900740c76..e15f2cf8ac15 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -1475,7 +1475,8 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, | |||
1475 | err = vfs_getattr(exp->ex_mnt, dentry, &stat); | 1475 | err = vfs_getattr(exp->ex_mnt, dentry, &stat); |
1476 | if (err) | 1476 | if (err) |
1477 | goto out_nfserr; | 1477 | goto out_nfserr; |
1478 | if ((bmval0 & (FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL)) || | 1478 | if ((bmval0 & (FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL | |
1479 | FATTR4_WORD0_MAXNAME)) || | ||
1479 | (bmval1 & (FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | | 1480 | (bmval1 & (FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | |
1480 | FATTR4_WORD1_SPACE_TOTAL))) { | 1481 | FATTR4_WORD1_SPACE_TOTAL))) { |
1481 | err = vfs_statfs(dentry, &statfs); | 1482 | err = vfs_statfs(dentry, &statfs); |
@@ -1721,7 +1722,7 @@ out_acl: | |||
1721 | if (bmval0 & FATTR4_WORD0_MAXNAME) { | 1722 | if (bmval0 & FATTR4_WORD0_MAXNAME) { |
1722 | if ((buflen -= 4) < 0) | 1723 | if ((buflen -= 4) < 0) |
1723 | goto out_resource; | 1724 | goto out_resource; |
1724 | WRITE32(~(u32) 0); | 1725 | WRITE32(statfs.f_namelen); |
1725 | } | 1726 | } |
1726 | if (bmval0 & FATTR4_WORD0_MAXREAD) { | 1727 | if (bmval0 & FATTR4_WORD0_MAXREAD) { |
1727 | if ((buflen -= 8) < 0) | 1728 | if ((buflen -= 8) < 0) |