NFS: file too large

Rick Macklem rmacklem at uoguelph.ca
Thu Jan 13 23:38:36 UTC 2011


> > > I'm getting 'File too large' when copying via NFS(v3, tcp/udp) a
> > > file
> > > that is larger than 1T. The server is ZFS which has no problem
> > > with
> > > large
> > > files.
> > >
> > > Is this fixable?
> > >
> > As I understand it, there is no FreeBSD VFSop that returns the
> > maximum
> > file size supported. As such, the NFS servers just take a guess.
> >
> > You can either switch to the experimental NFS server, which guesses
> > the
> > largest size expressed in 64bits.
> > OR
> > You can edit sys/nfsserver/nfs_serv.c and change the assignment of a
> > value to
> >     maxfsize = XXX;
> > at around line #3671 to a larger value.
> >
> > I didn't check to see if there are additional restrictions in the
> > clients. (They should believe what the server says it can support.)
> >
> > rick
> 
> well, after some more experimentation, it sees to be a FreeBSD client
> issue.
> if the client is linux there is no problem.
> 

Try editting line #1226 of sys/nfsclient/nfs_vfsops.c, where
it sets nm_maxfilesize = (u_int64_t)0x80000000 * DEV_BSIZE - 1; and make it
something larger.

I have no idea why the limit is set that way? (I'm guessing it was the
limit for UFS.) Hopefully not some weird buffer cache restriction or
similar, but you'll find out when you try increasing it.:-)

I think I'll ask freebsd-fs@ about increasing this for NFSv3 and 4, since
the server does provide a limit. (The client currently only reduces 
nm_maxfilesize from the above initial value using the server's limit.)

Just "grep nm_maxfilesize *.c" in sys/nfsclient and you'll see it.

> BTW, I 'think' I'm using the experimental server, but how can I be
> sure?
> I have the -e set for both nfs_server and mountd, I don't have option
> NFSD,
> but the nfsd.ko gets loaded.
You can check by:
# nfsstat -s
# nfsstat -e -s
and see which one reports non-zero RPC counts.

If you happen to be running the regular server (probably not, given the
above), you need to edit the server code as well as the client side.

Good luck with it, rick


More information about the freebsd-hackers mailing list