[patch 19/23] knfsd: query filesystem for NFSv4 getattr of FATTR4_MAXNAME

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg KH
Date: Friday, February 22, 2008 - 2:40 pm

2.6.22-stable review patch.  If anyone has any objections, please let us
know.

------------------

From: J. Bruce Fields <bfields@citi.umich.edu>

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>

---
 fs/nfsd/nfs4xdr.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1453,7 +1453,8 @@ nfsd4_encode_fattr(struct svc_fh *fhp, s
 	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)

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/23] 2.6.22-stable review, Greg KH, (Fri Feb 22, 2:39 pm)
[patch 01/23] cciss: fix memory leak, Greg KH, (Fri Feb 22, 2:39 pm)
[patch 04/23] PCI: Fix fakephp deadlock, Greg KH, (Fri Feb 22, 2:40 pm)
[patch 10/23] Intel_agp: really fix 945/965GME, Greg KH, (Fri Feb 22, 2:40 pm)
[patch 16/23] NFS: Fix nfs_reval_fsid(), Greg KH, (Fri Feb 22, 2:40 pm)
[patch 19/23] knfsd: query filesystem for NFSv4 getattr of ..., Greg KH, (Fri Feb 22, 2:40 pm)
Re: [patch 00/23] 2.6.22-stable review, Greg KH, (Fri Feb 22, 2:44 pm)
Re: [patch 00/23] 2.6.22-stable review, Oliver Pinter, (Fri Feb 22, 2:59 pm)
Re: [patch 00/23] 2.6.22-stable review, Oliver Pinter, (Fri Feb 22, 3:03 pm)
Re: [patch 00/23] 2.6.22-stable review, Greg KH, (Fri Feb 22, 3:32 pm)
Re: [patch 00/23] 2.6.22-stable review, Willy Tarreau, (Sat Feb 23, 1:47 am)