nfsd: export proper maximum file size to the client
authorChristoph Hellwig <hch@infradead.org>
Thu, 14 Nov 2013 13:50:10 +0000 (05:50 -0800)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 14 Nov 2013 20:18:47 +0000 (15:18 -0500)
I noticed that we export a way to high value for the maxfilesize
attribute when debugging a client issue.  The issue didn't turn
out to be related to it, but I think we should export it, so that
clients can limit what write sizes they accept before hitting
the server.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4xdr.c

index 9d76ee3..088de13 100644 (file)
@@ -2391,7 +2391,7 @@ out_acl:
        if (bmval0 & FATTR4_WORD0_MAXFILESIZE) {
                if ((buflen -= 8) < 0)
                        goto out_resource;
-               WRITE64(~(u64)0);
+               WRITE64(exp->ex_path.mnt->mnt_sb->s_maxbytes);
        }
        if (bmval0 & FATTR4_WORD0_MAXLINK) {
                if ((buflen -= 4) < 0)