summaryrefslogtreecommitdiffstats
path: root/sys/dev/vn
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1998-05-06 22:14:48 +0000
committerjulian <julian@FreeBSD.org>1998-05-06 22:14:48 +0000
commit0cb054bfeab729f000a87716a669b995215502fc (patch)
treef0dd71a43184ebf7ebaf3423df86fdafb6633e4b /sys/dev/vn
parent719d62b3b0b317b7bd93f23baf86382fc6c6969f (diff)
downloadFreeBSD-src-0cb054bfeab729f000a87716a669b995215502fc.zip
FreeBSD-src-0cb054bfeab729f000a87716a669b995215502fc.tar.gz
Add dump support to the DEVFS/slice code.
now we can actually catch our crashes :-) Submitted by: Luoqi Chen <luoqi@chen.ml.org> (the man who's everywhere)
Diffstat (limited to 'sys/dev/vn')
-rw-r--r--sys/dev/vn/vn.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/vn/vn.c b/sys/dev/vn/vn.c
index 0ee8871..516a9f8 100644
--- a/sys/dev/vn/vn.c
+++ b/sys/dev/vn/vn.c
@@ -38,7 +38,7 @@
* from: Utah Hdr: vn.c 1.13 94/04/02
*
* from: @(#)vn.c 8.6 (Berkeley) 4/1/94
- * $Id: vn.c,v 1.57 1998/04/22 10:25:12 julian Exp $
+ * $Id: vn.c,v 1.58 1998/04/24 07:53:59 julian Exp $
*/
/*
@@ -114,6 +114,7 @@ static sl_h_IO_req_t nvsIOreq; /* IO req downward (to device) */
static sl_h_ioctl_t nvsioctl; /* ioctl req downward (to device) */
static sl_h_open_t nvsopen; /* downwards travelling open */
/*static sl_h_close_t nvsclose; */ /* downwards travelling close */
+static sl_h_dump_t nvsdump; /* core dump req downward */
static struct slice_handler slicetype = {
"vn",
@@ -128,7 +129,8 @@ static struct slice_handler slicetype = {
NULL, /* revoke */
NULL, /* claim */
NULL, /* verify */
- NULL /* upconfig */
+ NULL, /* upconfig */
+ &nvsdump
};
#endif
@@ -448,6 +450,14 @@ nvsIOreq(void *private ,struct buf *bp)
bn = bp->b_pblkno;
bp->b_resid = bp->b_bcount;/* XXX best place to set this? */
sz = howmany(bp->b_bcount, DEV_BSIZE);
+ if (bn < 0 || bn + sz > vn->sc_size) {
+ if (bn != vn->sc_size) {
+ bp->b_error = EINVAL;
+ bp->b_flags |= B_ERROR;
+ }
+ biodone(bp);
+ return;
+ }
if( (bp->b_flags & B_PAGING) == 0) {
aiov.iov_base = bp->b_data;
@@ -936,5 +946,10 @@ nvsioctl( void *private, int cmd, caddr_t addr, int flag, struct proc *p)
return(vnioctl(makedev(0,vn->mynor), cmd, addr, flag, p));
}
+static int
+nvsdump(void *private, int32_t blkoff, int32_t blkcnt)
+{
+ return (ENODEV);
+}
#endif
#endif
OpenPOWER on IntegriCloud