Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a16e92edcd0a2846455a30823e1bac964e743baa
Commit:     a16e92edcd0a2846455a30823e1bac964e743baa
Parent:     cfdcad4da1903720b9b8c1f176e46a0ebf546be3
Author:     J. Bruce Fields <[EMAIL PROTECTED]>
AuthorDate: Fri Sep 28 16:45:51 2007 -0400
Committer:  J. Bruce Fields <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 18:31:57 2007 -0400

    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 <[EMAIL PROTECTED]>
    Cc: Andreas Gruenbacher <[EMAIL PROTECTED]>
---
 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 9cf9007..e15f2cf 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,
        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);
@@ -1721,7 +1722,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)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to