Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern pi_bsize must be at least pi_secsize



details:   https://anonhg.NetBSD.org/src/rev/81fbfc872269
branches:  trunk
changeset: 822069:81fbfc872269
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Tue Feb 28 00:33:36 2017 +0000

description:
pi_bsize must be at least pi_secsize

Allows block device accesses to 4KiB logical sector disks to function on the
vast majority of ports with 2KiB BLKDEV_IOSIZE.

diffstat:

 sys/kern/subr_disk.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f2a3ffa7088d -r 81fbfc872269 sys/kern/subr_disk.c
--- a/sys/kern/subr_disk.c      Mon Feb 27 23:52:05 2017 +0000
+++ b/sys/kern/subr_disk.c      Tue Feb 28 00:33:36 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_disk.c,v 1.116 2016/01/06 00:22:30 christos Exp $ */
+/*     $NetBSD: subr_disk.c,v 1.117 2017/02/28 00:33:36 jakllsch 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.116 2016/01/06 00:22:30 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.117 2017/02/28 00:33:36 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -573,7 +573,7 @@
                pi = data;
                memset(pi, 0, sizeof(*pi));
                pi->pi_secsize = dk->dk_geom.dg_secsize;
-               pi->pi_bsize = BLKDEV_IOSIZE;
+               pi->pi_bsize = MAX(BLKDEV_IOSIZE, pi->pi_secsize);
 
                if (DISKPART(dev) == RAW_PART) {
                        pi->pi_size = dk->dk_geom.dg_secperunit;



Home | Main Index | Thread Index | Old Index