Author: jimharris
Date: Mon Mar 17 21:45:08 2014
New Revision: 263274
URL: http://svnweb.freebsd.org/changeset/base/263274

Log:
  MFC r254303:
  
    If a controller fails to initialize, do not notify consumers (nvd) of its
    namespaces.
  
  Sponsored by: Intel

Modified:
  stable/9/sys/dev/nvme/nvme.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/nvme/nvme.c
==============================================================================
--- stable/9/sys/dev/nvme/nvme.c        Mon Mar 17 21:42:31 2014        
(r263273)
+++ stable/9/sys/dev/nvme/nvme.c        Mon Mar 17 21:45:08 2014        
(r263274)
@@ -284,6 +284,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-stable-9@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to