diff options
author | sbruno <sbruno@FreeBSD.org> | 2013-08-14 15:50:34 +0000 |
---|---|---|
committer | sbruno <sbruno@FreeBSD.org> | 2013-08-14 15:50:34 +0000 |
commit | 521440b2991bdc998552fdaf12e9ba82e5c9c053 (patch) | |
tree | e39ee6b74a596d030327c57d95e5e4679aa18685 | |
parent | 2c42b706ab7a60a3ba0ab83d1d6682f9e2ab50bf (diff) | |
download | FreeBSD-src-521440b2991bdc998552fdaf12e9ba82e5c9c053.zip FreeBSD-src-521440b2991bdc998552fdaf12e9ba82e5c9c053.tar.gz |
If sys/param.h MAXPHYS has been tuned to exceed MFI_MAXPHYS, the mfi(4)
real JBOD mode (SYS PD) would fail fairly reliably during I/O.
Steal the mfi_disk.c check for this condition (indirectly) when establishing
d_maxsize.
Reviewed by: ambrisko@
MFC after: 4 weeks
Sponsored by: Yahoo! Inc.
-rw-r--r-- | sys/dev/mfi/mfi_syspd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/mfi/mfi_syspd.c b/sys/dev/mfi/mfi_syspd.c index 739b866..e9587dd 100644 --- a/sys/dev/mfi/mfi_syspd.c +++ b/sys/dev/mfi/mfi_syspd.c @@ -126,7 +126,8 @@ mfi_syspd_attach(device_t dev) sectors / (1024 * 1024 / secsize), sectors, sc->pd_id); sc->pd_disk = disk_alloc(); sc->pd_disk->d_drv1 = sc; - sc->pd_disk->d_maxsize = sc->pd_controller->mfi_max_io * secsize; + sc->pd_disk->d_maxsize = min(sc->pd_controller->mfi_max_io * secsize, + (sc->pd_controller->mfi_max_sge - 1) * PAGE_SIZE); sc->pd_disk->d_name = "mfisyspd"; sc->pd_disk->d_open = mfi_syspd_open; sc->pd_disk->d_close = mfi_syspd_close; |