svn commit: r254330 - head/sys/dev/mfi

Sean Bruno sbruno at FreeBSD.org
Wed Aug 14 15:50:35 UTC 2013


Author: sbruno
Date: Wed Aug 14 15:50:34 2013
New Revision: 254330
URL: http://svnweb.freebsd.org/changeset/base/254330

Log:
  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.

Modified:
  head/sys/dev/mfi/mfi_syspd.c

Modified: head/sys/dev/mfi/mfi_syspd.c
==============================================================================
--- head/sys/dev/mfi/mfi_syspd.c	Wed Aug 14 15:18:28 2013	(r254329)
+++ head/sys/dev/mfi/mfi_syspd.c	Wed Aug 14 15:50:34 2013	(r254330)
@@ -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;


More information about the svn-src-head mailing list