mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] 2.4.4-pre6 NFSv3 maximum filesize correction
@ 2001-04-23  7:58 Trond Myklebust
  0 siblings, 0 replies; only message in thread
From: Trond Myklebust @ 2001-04-23  7:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: NFS devel, Linux Kernel


Hi Linus,

  The current 2.4.4-pre series assumes that NFSv3 is always fully LFS
capable. This is of course not the case on 32bit architectures such as
the 2.2.x series.
  The following patch to fs/nfs/inode.c corrects this bug by using the
NFSPROC3_FSINFO call to provide the maximum supported filesize on the
filesystem in question. On NFSv2 it will be set to 0x7FFFFFFF.

  In doing this, I also noticed that knfsd was still supplying 4Gb as
its maximum supported filesize. The appended patch to
fs/nfsd/nfs3proc.c causes the FSINFO call to return sb->s_maxbytes to
the client.

Cheers,
  Trond

diff -u --recursive --new-file linux-2.4.4-pre6/fs/nfs/inode.c linux-2.4.4-maxfile/fs/nfs/inode.c
--- linux-2.4.4-pre6/fs/nfs/inode.c	Fri Apr 20 02:59:42 2001
+++ linux-2.4.4-maxfile/fs/nfs/inode.c	Fri Apr 20 14:50:25 2001
@@ -435,8 +435,7 @@
         if (server->namelen == 0 || server->namelen > maxlen)
                 server->namelen = maxlen;
 
-	if(version > 2)
-		sb->s_maxbytes = ~0ULL;	/* Unlimited on NFSv3 */
+	sb->s_maxbytes = fsinfo.maxfilesize;
 
 	/* Fire up the writeback cache */
 	if (nfs_reqlist_alloc(server) < 0) {
diff -u --recursive --new-file linux-2.4.4-pre6/fs/nfsd/nfs3proc.c linux-2.4.4-maxfile/fs/nfsd/nfs3proc.c
--- linux-2.4.4-pre6/fs/nfsd/nfs3proc.c	Fri Feb  9 20:29:44 2001
+++ linux-2.4.4-maxfile/fs/nfsd/nfs3proc.c	Fri Apr 20 14:49:38 2001
@@ -542,6 +542,7 @@
 		if (sb->s_magic == 0x4d44 /* MSDOS_SUPER_MAGIC */) {
 			resp->f_properties = NFS3_FSF_BILLYBOY;
 		}
+		resp->f_maxfilesize = sb->s_maxbytes;
 	}
 
 	fh_put(&argp->fh);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-04-23  7:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-23  7:58 [PATCH] 2.4.4-pre6 NFSv3 maximum filesize correction Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®