Skip to contentSkip to conversation

scsi: ses: fix devices attaching to different hosts

PATCH Applied Tomas Henzl 2 participants 3 messages Feb 10 – Feb 24 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: ses: fix devices attaching to different hosts

On a multipath SAS scsi system some devices don't end up with enclosure symlinks from a scsi device to its enclosure. Scsi devices which have enclosures linked to them are linked to enclosures on different scsi hosts.
In ses_match_to_enclosure is being called enclosure_for_each_device which iterates over all enclosures not just enclosures on the current host. Fix this by replacing this call with ses_enclosure_find_by_addr.

---
 drivers/scsi/ses.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/ses.c +2 -3
index 789b170da652..98a7367d2f20 100644
@@ -528,9 +528,8 @@ struct efd {
 };
 
 static int ses_enclosure_find_by_addr(struct enclosure_device *edev,
-				      void *data)
+				      struct efd *efd)
 {
-	struct efd *efd = data;
 	int i;
 	struct ses_component *scomp;
 
@@ -683,7 +682,7 @@ static void ses_match_to_enclosure(struct enclosure_device *edev,
 	if (efd.addr) {
 		efd.dev = &sdev->sdev_gendev;
 
-		enclosure_for_each_device(ses_enclosure_find_by_addr, &efd);
+		ses_enclosure_find_by_addr(edev, &efd);
 	}
 }
 
Signature · 1 line
2.52.0
#1 lore raw

Tomas,

Quoted 4 lines

On a multipath SAS scsi system some devices don't end up with enclosure symlinks from a scsi device to its enclosure. Scsi devices which have enclosures linked to them are linked to enclosures on different scsi hosts.

Applied to 7.0/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen
#2 lore raw
In reply to Tomas Henzl
Quoted 9 lines · Tomas Henzl

On a multipath SAS scsi system some devices don't end up with enclosure symlinks from a scsi device to its enclosure. Scsi devices which have enclosures linked to them are linked to enclosures on different scsi hosts.
In ses_match_to_enclosure is being called enclosure_for_each_device which iterates over all enclosures not just enclosures on the current host. Fix this by replacing this call with ses_enclosure_find_by_addr.

[...]

Applied to 7.0/scsi-fixes, thanks!

[1/1] scsi: ses: fix devices attaching to different hosts

      https://git.kernel.org/mkp/scsi/c/70ca8caa96ce
Signature · 1 line
Martin K. Petersen