summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-07-29 08:24:23 +0000
committerbde <bde@FreeBSD.org>1998-07-29 08:24:23 +0000
commit1d3cccd9296101f3adcc39556cb9708da8e1ea8d (patch)
treeaf71ea5b2ad6ab9b010773b18baa329a6d383954
parent603410cec4c3561c55432d21b8b3e495e1eb1fcf (diff)
downloadFreeBSD-src-1d3cccd9296101f3adcc39556cb9708da8e1ea8d.zip
FreeBSD-src-1d3cccd9296101f3adcc39556cb9708da8e1ea8d.tar.gz
Use the slice-relative blkno in all parts of the label write
protection checks. Using the partition-relative blkno in some parts broke the write protection for partitions at unusual offsets (only for partitions at offset 1 on i386's).
-rw-r--r--sys/kern/subr_diskslice.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c
index 8dde7d6..164ed29 100644
--- a/sys/kern/subr_diskslice.c
+++ b/sys/kern/subr_diskslice.c
@@ -43,7 +43,7 @@
* from: wd.c,v 1.55 1994/10/22 01:57:12 phk Exp $
* from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
* from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $
- * $Id: subr_diskslice.c,v 1.52 1998/07/20 14:35:27 bde Exp $
+ * $Id: subr_diskslice.c,v 1.53 1998/07/28 19:39:09 bde Exp $
*/
#include "opt_devfs.h"
@@ -197,7 +197,7 @@ if (labelsect != 0) Debugger("labelsect != 0 in dscheck()");
/* XXX should also protect bootstrap in first 8K */
if (blkno <= LABELSECTOR + labelsect &&
#if LABELSECTOR != 0
- bp->b_blkno + sz > LABELSECTOR + labelsect &&
+ blkno + sz > LABELSECTOR + labelsect &&
#endif
(bp->b_flags & B_READ) == 0 && sp->ds_wlabel == 0) {
bp->b_error = EROFS;
@@ -238,7 +238,7 @@ if (labelsect != 0) Debugger("labelsect != 0 in dscheck()");
*/
if (blkno <= LABELSECTOR + labelsect
#if LABELSECTOR != 0
- && bp->b_blkno + sz > LABELSECTOR + labelsect
+ && blkno + sz > LABELSECTOR + labelsect
#endif
&& sp->ds_offset != 0) {
struct iodone_chain *ic;
OpenPOWER on IntegriCloud