Date: Fri, 14 Jan 2011 19:09:23 -0500 (EST) From: Rick Macklem <rmacklem@uoguelph.ca> To: Daniel Braniss <danny@cs.huji.ac.il> Cc: freebsd-hackers@freebsd.org Subject: Re: NFS: file too large Message-ID: <334773590.270506.1295050163687.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <E1PdfvR-000LQE-PM@kabab.cs.huji.ac.il>
next in thread | previous in thread | raw e-mail | index | archive | help
> > BTW, why not make away with the test altogether? > Well, since a server specifies the maximum file size it can handle, it seems good form to check for that in the client. (Although I'd agree that a server shouldn't crash if a read/write that goes beyond that limit.) Also, as Matt notes, off_t is signed. As such, it looks to me like the check could mess up if uio_offset it right near 0x7fffffffffffffff, so that uio->ui_offset + uio->uio_resid ends up negative. I think the check a little above that for uio_offset < 0 should also check uio_offset + uio_resid < 0 to avoid this. rick
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?334773590.270506.1295050163687.JavaMail.root>