[PATCH] 2.4.4-pre6 NFSv3 maximum filesize correction

From: Trond Myklebust (trond.myklebust@fys.uio.no)
Date: Mon Apr 23 2001 - 02:58:14 EST


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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Apr 23 2001 - 21:00:44 EST