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)
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to