Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Aug 2007 10:35:27 +0000 (UTC)
From:      Bruce Evans <bde@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/fs/msdosfs msdosfs_vnops.c
Message-ID:  <200708071035.l77AZR3v049422@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
bde         2007-08-07 10:35:27 UTC

  FreeBSD src repository

  Modified files:
    sys/fs/msdosfs       msdosfs_vnops.c 
  Log:
  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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708071035.l77AZR3v049422>