1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

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.
This commit is contained in:
Doug Rabson 1997-06-06 08:12:17 +00:00
parent 3e23dae445
commit 2d1500e4de
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=26469
2 changed files with 12 additions and 4 deletions

View File

@ -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 @@ nfs_bioread(vp, uio, ioflag, cred, getpages)
}
}
}
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);

View File

@ -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 @@ nfs_bioread(vp, uio, ioflag, cred, getpages)
}
}
}
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);