Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aea240f4 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by J. Bruce Fields
Browse files

nfsd: export proper maximum file size to the client



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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 6ff40dec
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2391,7 +2391,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
	if (bmval0 & FATTR4_WORD0_MAXFILESIZE) {
	if (bmval0 & FATTR4_WORD0_MAXFILESIZE) {
		if ((buflen -= 8) < 0)
		if ((buflen -= 8) < 0)
			goto out_resource;
			goto out_resource;
		WRITE64(~(u64)0);
		WRITE64(exp->ex_path.mnt->mnt_sb->s_maxbytes);
	}
	}
	if (bmval0 & FATTR4_WORD0_MAXLINK) {
	if (bmval0 & FATTR4_WORD0_MAXLINK) {
		if ((buflen -= 4) < 0)
		if ((buflen -= 4) < 0)