]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: target: alua: Do not report emtpy port group
authorDmitry Bogdanov <d.bogdanov@yadro.com>
Mon, 12 Sep 2022 21:45:49 +0000 (00:45 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 16 Sep 2022 01:42:44 +0000 (21:42 -0400)
commitf3748cb510551603fe4980d3270853729a711829
treef8b7d92c93b02e76bef267ebd25c6dd19a6c7ed7
parent7743ee53eaf52cea8ac4556ceb955b7c1a02470a
scsi: target: alua: Do not report emtpy port group

The default target port group is always returned in the list of port
groups, even if the behaviour is unwanted, i.e. it has no members and
non-default port groups are primary port groups.

That violates SPC-4 "6.37 REPORT TARGET PORT GROUPS command":

  Every target port group shall contain at least one target port. The
  target port group descriptor shall include one target port descriptor for
  each target port in the target port group.

This patch hides port groups with no ports in REPORT TARGET PORT GROUPS
response.

Link: https://lore.kernel.org/r/20220912214549.27882-1-d.bogdanov@yadro.com
Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_alua.c