diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2008-02-07 21:03:57 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-25 15:59:21 -0800 |
commit | ad14c9bb60583f9eac5e7b33c052d2a9614d113f (patch) | |
tree | 04f654a38297a2766ea275e876343afa4e88fcf4 | |
parent | 29301cef1b0106eb400d83c971bdccf7e5bd6d46 (diff) | |
download | lwn-ad14c9bb60583f9eac5e7b33c052d2a9614d113f.tar.gz lwn-ad14c9bb60583f9eac5e7b33c052d2a9614d113f.zip |
knfsd: query filesystem for NFSv4 getattr of FATTR4_MAXNAME
mainline: a16e92edcd0a2846455a30823e1bac964e743baa
Without this we always return 2^32-1 as the the maximum namelength.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
CC: Oliver Pinter <oliver.pntr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-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 15809dfd88a5..0898aecbfa38 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1453,7 +1453,8 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, err = vfs_getattr(exp->ex_mnt, dentry, &stat); if (err) goto out_nfserr; - if ((bmval0 & (FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL)) || + if ((bmval0 & (FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL | + FATTR4_WORD0_MAXNAME)) || (bmval1 & (FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | FATTR4_WORD1_SPACE_TOTAL))) { err = vfs_statfs(dentry, &statfs); @@ -1699,7 +1700,7 @@ out_acl: if (bmval0 & FATTR4_WORD0_MAXNAME) { if ((buflen -= 4) < 0) goto out_resource; - WRITE32(~(u32) 0); + WRITE32(statfs.f_namelen); } if (bmval0 & FATTR4_WORD0_MAXREAD) { if ((buflen -= 8) < 0) |