diff options
author | dfr <dfr@FreeBSD.org> | 1997-06-06 08:12:17 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1997-06-06 08:12:17 +0000 |
commit | 387269f8b234cd5fcb8b4d127a4c26d87790b2d6 (patch) | |
tree | b253905c28e9ef3c42380f0c66f80038dcd30560 /sys/nfs/nfs_bio.c | |
parent | eb1ddf1705a718f3c9be583fcb1a106a2262ebd5 (diff) | |
download | FreeBSD-src-387269f8b234cd5fcb8b4d127a4c26d87790b2d6.zip FreeBSD-src-387269f8b234cd5fcb8b4d127a4c26d87790b2d6.tar.gz |
Fix a problem caused by removing large numbers of files from a directory
which could cause a bad size to be given to uiomove, causing a page fault.
Diffstat (limited to 'sys/nfs/nfs_bio.c')
-rw-r--r-- | sys/nfs/nfs_bio.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c index a6320b4..f2e8316 100644 --- a/sys/nfs/nfs_bio.c +++ b/sys/nfs/nfs_bio.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95 - * $Id: nfs_bio.c,v 1.38 1997/05/19 14:36:47 dfr Exp $ + * $Id: nfs_bio.c,v 1.39 1997/06/03 09:42:36 dfr Exp $ */ @@ -448,7 +448,11 @@ again: } } } - n = min(uio->uio_resid, NFS_DIRBLKSIZ - bp->b_resid - on); + /* + * Make sure we use a signed variant of min() since + * the second term may be negative. + */ + n = lmin(uio->uio_resid, NFS_DIRBLKSIZ - bp->b_resid - on); break; default: printf(" nfs_bioread: type %x unexpected\n",vp->v_type); |