freebsd-nq/sys/fs/msdosfs
Bruce Evans a4e6807c49 In msdosfs_read() and msdosfs_write(), don't check explicitly for
(uio_offset < 0) since this can't happen.  If this happens, then the
general code handles the problem safely (better than before for reading,
returning 0 (EOF) instead of the bogus errno EINVAL, and the same as
before for writing, returning EFBIG).

In msdosfs_read(), don't check for (uio_resid < 0).  msdosfs_write()
already didn't check.

In msdosfs_read(), document in a comment our assumptions that the caller
passed a valid uio_offset and uio_resid.  ffs checks using KASSERT(),
and that is enough sanity checking.  In the same comment, partly document
there is no need to check for the EOVERFLOW case, unlike in ffs where this
case can happen at least in theory.

In msdosfs_write(), add a comment about why the checking of
(uio_resid == 0) is explicit, unlike in ffs.

In msdosfs_write(), check for impossibly large final offsets before
checking if the file size rlimit would be exceeded, so that we don't
have an overflow bug in the rlimit check and are consistent with ffs.
We now return EFBIG instead of EFBIG plus a SIGXFSZ signal if the final
offset would be impossibly large but not so large as to cause overflow.
Overflow normally gave the benign behaviour of no signal.

Approved by:	re (kensmith) (blanket)
2007-08-07 10:35:27 +00:00
..
bootsect.h Remove checks for BOOTSIG[23] from FAT32 bootblocks. 2005-09-29 14:09:46 +00:00
bpb.h Fix some bugs involving the fsinfo block (many remain unfixed). This is 2007-07-12 16:09:07 +00:00
denode.h Fix some style bugs (some whitespace errors only). 2007-08-07 03:22:10 +00:00
direntry.h Replace slightly crummy fattime<->timespec conversion functions. 2006-10-24 11:14:05 +00:00
fat.h /* -> /*- for copyright notices, minor format tweaks as necessary 2005-01-06 18:10:42 +00:00
msdosfs_conv.c Remove unused include(s). 2007-08-07 02:11:16 +00:00
msdosfs_denode.c Fix some style bugs (don't assume that off_t == int64_t; fix some comments; 2007-08-07 03:59:49 +00:00
msdosfs_fat.c Fix some style bugs (some whitespace errors only). 2007-08-07 03:22:10 +00:00
msdosfs_fileno.c Remove unused include(s). 2007-08-07 02:08:06 +00:00
msdosfs_iconv.c Remove unused include(s). 2007-08-07 02:08:06 +00:00
msdosfs_lookup.c Remove unused include(s). 2007-08-07 02:08:06 +00:00
msdosfs_vfsops.c Fix some style bugs (mainly some whitespace errors). 2007-08-07 03:38:36 +00:00
msdosfs_vnops.c In msdosfs_read() and msdosfs_write(), don't check explicitly for 2007-08-07 10:35:27 +00:00
msdosfsmount.h Fix some bugs involving the fsinfo block (many remain unfixed). This is 2007-07-12 16:09:07 +00:00