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:
parent
3e23dae445
commit
2d1500e4de
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=26469
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user