Merge tag 'for-5.4/block-2019-09-16' of git://git.kernel.dk/linux-block
[linux.git] / drivers / nvme / host / multipath.c
index af831d3d15d072339b20ef297b197bae939b4d55..30de7efef00357f5231ebdee06953aa341aac6fc 100644 (file)
@@ -509,14 +509,16 @@ static int nvme_update_ana_state(struct nvme_ctrl *ctrl,
 
        down_write(&ctrl->namespaces_rwsem);
        list_for_each_entry(ns, &ctrl->namespaces, list) {
-               if (ns->head->ns_id != le32_to_cpu(desc->nsids[n]))
+               unsigned nsid = le32_to_cpu(desc->nsids[n]);
+
+               if (ns->head->ns_id < nsid)
                        continue;
-               nvme_update_ns_ana_state(desc, ns);
+               if (ns->head->ns_id == nsid)
+                       nvme_update_ns_ana_state(desc, ns);
                if (++n == nr_nsids)
                        break;
        }
        up_write(&ctrl->namespaces_rwsem);
-       WARN_ON_ONCE(n < nr_nsids);
        return 0;
 }
 
This page took 0.031945 seconds and 4 git commands to generate.