]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
[SCSI] libsas: fix failure to revalidate domain for anything but the first expander...
authorMark Salyzyn <mark_salyzyn@us.xyratex.com>
Thu, 1 Sep 2011 13:11:17 +0000 (06:11 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Thu, 22 Sep 2011 07:23:56 +0000 (11:23 +0400)
In an enclosure model where there are chaining expanders to a large body
of storage, it was discovered that libsas, responding to a broadcast
event change, would only revalidate the domain of first child expander
in the list.

The issue is that the pointer value to the discovered source device was
used to break out of the loop, rather than the content of the pointer.

This still remains non-compliant as the revalidate domain code is
supposed to loop through all child expanders, and not stop at the first
one it finds that reports a change count. However, the design of this
routine does not allow multiple device discoveries and that would be a
more complicated set of patches reserved for another day. We are fixing
the glaring bug rather than refactoring the code.

Signed-off-by: Mark Salyzyn <msalyzyn@us.xyratex.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/libsas/sas_expander.c

index f84084bba2f0ea19f19b5f073120fc8ff34612d0..c9e3dc024bc3c2a1248e91c6b34bb47d43688b6b 100644 (file)
@@ -1721,7 +1721,7 @@ static int sas_find_bcast_dev(struct domain_device *dev,
        list_for_each_entry(ch, &ex->children, siblings) {
                if (ch->dev_type == EDGE_DEV || ch->dev_type == FANOUT_DEV) {
                        res = sas_find_bcast_dev(ch, src_dev);
-                       if (src_dev)
+                       if (*src_dev)
                                return res;
                }
        }