diff options
-rw-r--r-- | sys/kern/kern_physio.c | 4 | ||||
-rw-r--r-- | sys/kern/subr_disk.c | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c index 01bc7f3..6bf3e7f 100644 --- a/sys/kern/kern_physio.c +++ b/sys/kern/kern_physio.c @@ -175,6 +175,10 @@ minphys(bp) u_int maxphys; maxphys = bp->b_dev->si_iosize_max; + if(!maxphys) { + printf("WARNING: %s maxphys = 0 ??", devtoname(bp->b_dev)); + maxphys = DFLTPHYS; + } if (bp->b_kvasize && (bp->b_kvasize < maxphys)) maxphys = bp->b_kvasize; diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index bfa3d89..9c53bde 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -115,8 +115,10 @@ diskopen(dev_t dev, int oflags, int devtype, struct proc *p) if (!dp) return (ENXIO); - if (!dsisopen(dp->d_slice)) + if (!dsisopen(dp->d_slice)) { + pdev->si_iosize_max = dev->si_iosize_max; error = dp->d_devsw->d_open(pdev, oflags, devtype, p); + } /* Inherit properties from the whole/raw dev_t */ dev->si_disk = pdev->si_disk; @@ -163,12 +165,12 @@ diskstrategy(struct buf *bp) dp = bp->b_dev->si_disk; if (!dp) { pdev = dkmodpart(dkmodslice(bp->b_dev, WHOLE_DISK_SLICE), RAW_PART); - dp = pdev->si_disk; + dp = bp->b_dev->si_disk = pdev->si_disk; bp->b_dev->si_drv1 = pdev->si_drv1; bp->b_dev->si_drv2 = pdev->si_drv2; - /* XXX: don't set bp->b_dev->si_disk (?) */ - } else { - pdev = dp->d_dev; + bp->b_dev->si_iosize_max = pdev->si_iosize_max; + bp->b_dev->si_bsize_phys = pdev->si_bsize_phys; + bp->b_dev->si_bsize_best = pdev->si_bsize_best; } if (!dp) { |