diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-04-06 06:04:30 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-04-06 06:04:30 +0000 |
commit | e360cb3f39a4ad8344800acb9176475222428ff7 (patch) | |
tree | fab9bac17592f72c39e86c80e62ff144c6e415f8 /sys/arch | |
parent | 24309dd0e19ff47a39b4904ed69d744845217a1f (diff) |
correct labelsector confusion
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/arc/arc/disksubr.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/i386/disksubr.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/arch/arc/arc/disksubr.c b/sys/arch/arc/arc/disksubr.c index 105ba2c8acc..cebc0712135 100644 --- a/sys/arch/arc/arc/disksubr.c +++ b/sys/arch/arc/arc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.9 1997/04/05 21:56:04 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.10 1997/04/06 06:04:29 deraadt Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -410,12 +410,12 @@ bounds_check_with_label(bp, lp, wlabel) struct disklabel *lp; int wlabel; { +#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE)) struct partition *p = lp->d_partitions + DISKPART(bp->b_dev); - int labelsector = lp->d_partitions[RAW_PART].p_offset + LABELSECTOR; + int labelsector = blockpersec(lp->d_partitions[RAW_PART].p_offset, lp) + + LABELSECTOR; int sz = howmany(bp->b_bcount, DEV_BSIZE); -#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE)) - if (bp->b_blkno + sz > blockpersec(p->p_size, lp)) { sz = blockpersec(p->p_size, lp) - bp->b_blkno; if (sz == 0) { diff --git a/sys/arch/i386/i386/disksubr.c b/sys/arch/i386/i386/disksubr.c index 130a49574da..8343d0f6fd8 100644 --- a/sys/arch/i386/i386/disksubr.c +++ b/sys/arch/i386/i386/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.18 1997/04/05 21:56:02 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.19 1997/04/06 06:04:26 deraadt Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -410,12 +410,12 @@ bounds_check_with_label(bp, lp, wlabel) struct disklabel *lp; int wlabel; { +#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE)) struct partition *p = lp->d_partitions + DISKPART(bp->b_dev); - int labelsector = lp->d_partitions[RAW_PART].p_offset + LABELSECTOR; + int labelsector = blockpersec(lp->d_partitions[RAW_PART].p_offset, lp) + + LABELSECTOR; int sz = howmany(bp->b_bcount, DEV_BSIZE); -#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE)) - if (bp->b_blkno + sz > blockpersec(p->p_size, lp)) { sz = blockpersec(p->p_size, lp) - bp->b_blkno; if (sz == 0) { |