Skip to content

Commit 70ca8ca

Browse files
thenzlmartinkpetersen
authored andcommitted
scsi: ses: Fix devices attaching to different hosts
On a multipath SAS system some devices don't end up with correct symlinks from the SCSI device to its enclosure. Some devices even have enclosure links pointing to enclosures attached to different SCSI hosts. ses_match_to_enclosure() calls enclosure_for_each_device() which iterates over all enclosures on the system, not just enclosures attached to the current SCSI host. Replace the iteration with a direct call to ses_enclosure_find_by_addr(). Reviewed-by: David Jeffery <djeffery@redhat.com> Signed-off-by: Tomas Henzl <thenzl@redhat.com> Link: https://patch.msgid.link/20260210191850.36784-1-thenzl@redhat.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 2e6b5cd commit 70ca8ca

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/scsi/ses.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,8 @@ struct efd {
528528
};
529529

530530
static int ses_enclosure_find_by_addr(struct enclosure_device *edev,
531-
void *data)
531+
struct efd *efd)
532532
{
533-
struct efd *efd = data;
534533
int i;
535534
struct ses_component *scomp;
536535

@@ -683,7 +682,7 @@ static void ses_match_to_enclosure(struct enclosure_device *edev,
683682
if (efd.addr) {
684683
efd.dev = &sdev->sdev_gendev;
685684

686-
enclosure_for_each_device(ses_enclosure_find_by_addr, &efd);
685+
ses_enclosure_find_by_addr(edev, &efd);
687686
}
688687
}
689688

0 commit comments

Comments
 (0)