cvs commit: src/sys/fs/msdosfs msdosfs_vnops.c

Bruce Evans bde at
Tue Aug 7 03:35:28 PDT 2007

bde         2007-08-07 10:35:27 UTC

  FreeBSD src repository

  Modified files:
    sys/fs/msdosfs       msdosfs_vnops.c 
  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)
  Revision  Changes    Path
  1.178     +21 -12    src/sys/fs/msdosfs/msdosfs_vnops.c

More information about the cvs-src mailing list