svn commit: r254303 - head/sys/dev/nvme

Jim Harris jimharris at FreeBSD.org
Tue Aug 13 21:49:33 UTC 2013


Author: jimharris
Date: Tue Aug 13 21:49:32 2013
New Revision: 254303
URL: http://svnweb.freebsd.org/changeset/base/254303

Log:
  If a controller fails to initialize, do not notify consumers (nvd) of its
  namespaces.
  
  Sponsoredy by:	Intel
  Reviewed by:	carl
  MFC after:	3 days

Modified:
  head/sys/dev/nvme/nvme.c

Modified: head/sys/dev/nvme/nvme.c
==============================================================================
--- head/sys/dev/nvme/nvme.c	Tue Aug 13 21:47:08 2013	(r254302)
+++ head/sys/dev/nvme/nvme.c	Tue Aug 13 21:49:32 2013	(r254303)
@@ -278,6 +278,15 @@ nvme_notify_consumer(struct nvme_consume
 		else
 			ctrlr_cookie = NULL;
 		ctrlr->cons_cookie[cons->id] = ctrlr_cookie;
+		if (ctrlr->is_failed) {
+			if (cons->fail_fn != NULL)
+				(*cons->fail_fn)(ctrlr_cookie);
+			/*
+			 * Do not notify consumers about the namespaces of a
+			 *  failed controller.
+			 */
+			continue;
+		}
 		for (ns_idx = 0; ns_idx < ctrlr->cdata.nn; ns_idx++) {
 			ns = &ctrlr->ns[ns_idx];
 			if (cons->ns_fn != NULL)


More information about the svn-src-head mailing list