Being able to make image backups of your whole disk, not to mention not

causing certain ata disks to lock up by reading beyond the last block,
beats catering to broken devices.

bounds_check_with_label() RAW_PART too.
This commit is contained in:
bad 2003-01-23 00:00:32 +00:00
parent d1567e06c2
commit f4aacfe9fc
3 changed files with 9 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wd.c,v 1.235 2003/01/20 05:30:04 simonb Exp $ */
/* $NetBSD: wd.c,v 1.236 2003/01/23 00:00:32 bad Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.235 2003/01/20 05:30:04 simonb Exp $");
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.236 2003/01/23 00:00:32 bad Exp $");
#ifndef WDCDEBUG
#define WDCDEBUG
@ -495,8 +495,7 @@ wdstrategy(bp)
* Do bounds checking, adjust transfer. if error, process.
* If end of partition, just return.
*/
if (WDPART(bp->b_dev) != RAW_PART &&
bounds_check_with_label(bp, wd->sc_dk.dk_label,
if (bounds_check_with_label(bp, wd->sc_dk.dk_label,
(wd->sc_flags & (WDF_WLABEL|WDF_LABELLING)) != 0) <= 0)
goto done;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cd.c,v 1.175 2003/01/20 05:30:09 simonb Exp $ */
/* $NetBSD: cd.c,v 1.176 2003/01/23 00:00:33 bad Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.175 2003/01/20 05:30:09 simonb Exp $");
__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.176 2003/01/23 00:00:33 bad Exp $");
#include "rnd.h"
@ -584,8 +584,7 @@ cdstrategy(bp)
* Do bounds checking, adjust transfer. if error, process.
* If end of partition, just return.
*/
if (CDPART(bp->b_dev) != RAW_PART &&
bounds_check_with_label(bp, lp,
if (bounds_check_with_label(bp, lp,
(cd->flags & (CDF_WLABEL|CDF_LABELLING)) != 0) <= 0)
goto done;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sd.c,v 1.193 2003/01/06 20:30:38 wiz Exp $ */
/* $NetBSD: sd.c,v 1.194 2003/01/23 00:00:33 bad Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.193 2003/01/06 20:30:38 wiz Exp $");
__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.194 2003/01/23 00:00:33 bad Exp $");
#include "opt_scsi.h"
#include "opt_bufq.h"
@ -631,8 +631,7 @@ sdstrategy(bp)
* Do bounds checking, adjust transfer. if error, process.
* If end of partition, just return.
*/
if (SDPART(bp->b_dev) != RAW_PART &&
bounds_check_with_label(bp, lp,
if (bounds_check_with_label(bp, lp,
(sd->flags & (SDF_WLABEL|SDF_LABELLING)) != 0) <= 0)
goto done;