* [PATCH] nfsd: export proper maximum file size to the client
@ 2013-11-14 13:50 Christoph Hellwig
2013-11-14 14:18 ` J. Bruce Fields
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2013-11-14 13:50 UTC (permalink / raw)
To: bfields; +Cc: linux-nfs
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>
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 9423522..a3c9347 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2488,7 +2488,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)
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] nfsd: export proper maximum file size to the client
2013-11-14 13:50 [PATCH] nfsd: export proper maximum file size to the client Christoph Hellwig
@ 2013-11-14 14:18 ` J. Bruce Fields
0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2013-11-14 14:18 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-nfs
On Thu, Nov 14, 2013 at 05:50:10AM -0800, Christoph Hellwig wrote:
> 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.
Thanks, applying.--b.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 9423522..a3c9347 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -2488,7 +2488,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)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-14 14:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-14 13:50 [PATCH] nfsd: export proper maximum file size to the client Christoph Hellwig
2013-11-14 14:18 ` J. Bruce Fields
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).