mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-07 22:42:04 +00:00
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>
This commit is contained in:
parent
5bdd4a8e5c
commit
f04e47e770
@ -164,6 +164,9 @@ target_emulate_report_target_port_groups(struct se_cmd *cmd)
|
||||
spin_lock(&dev->t10_alua.tg_pt_gps_lock);
|
||||
list_for_each_entry(tg_pt_gp, &dev->t10_alua.tg_pt_gps_list,
|
||||
tg_pt_gp_list) {
|
||||
/* Skip empty port groups */
|
||||
if (!tg_pt_gp->tg_pt_gp_members)
|
||||
continue;
|
||||
/*
|
||||
* Check if the Target port group and Target port descriptor list
|
||||
* based on tg_pt_gp_members count will fit into the response payload.
|
||||
|
Loading…
Reference in New Issue
Block a user