Module Name: src Committed By: mlelstv Date: Sat Nov 28 14:36:00 UTC 2015
Modified Files: src/sys/kern: subr_disk.c Log Message: Handle sector sizes other than DEV_BSIZE when reading labels. To generate a diff of this commit: cvs rdiff -u -r1.113 -r1.114 src/sys/kern/subr_disk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/subr_disk.c diff -u src/sys/kern/subr_disk.c:1.113 src/sys/kern/subr_disk.c:1.114 --- src/sys/kern/subr_disk.c:1.113 Thu May 14 17:31:24 2015 +++ src/sys/kern/subr_disk.c Sat Nov 28 14:36:00 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_disk.c,v 1.113 2015/05/14 17:31:24 chs Exp $ */ +/* $NetBSD: subr_disk.c,v 1.114 2015/11/28 14:36:00 mlelstv Exp $ */ /*- * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.113 2015/05/14 17:31:24 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.114 2015/11/28 14:36:00 mlelstv Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -421,7 +421,7 @@ int disk_read_sectors(void (*strat)(struct buf *), const struct disklabel *lp, struct buf *bp, unsigned int sector, int count) { - bp->b_blkno = sector; + bp->b_blkno = btodb((off_t)sector * lp->d_secsize); bp->b_bcount = count * lp->d_secsize; bp->b_flags = (bp->b_flags & ~B_WRITE) | B_READ; bp->b_oflags &= ~BO_DONE;