Commit 2ff717cd authored by Cathy Avery's avatar Cathy Avery Committed by Martin K. Petersen

scsi: target: tcmu: wait for nl reply only if there are listeners or during an add

genlmsg_multicast_allns now returns the correct statuses when a message is
sent to a listener. However in the case of adding a device we want to wait
for the listener otherwise we may miss the the device during startup.
Signed-off-by: default avatarCathy Avery <cavery@redhat.com>
Acked-by: default avatarMike Christie <mchristi@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 3722e6a5
...@@ -1764,11 +1764,12 @@ static int tcmu_netlink_event_send(struct tcmu_dev *udev, ...@@ -1764,11 +1764,12 @@ static int tcmu_netlink_event_send(struct tcmu_dev *udev,
ret = genlmsg_multicast_allns(&tcmu_genl_family, skb, 0, ret = genlmsg_multicast_allns(&tcmu_genl_family, skb, 0,
TCMU_MCGRP_CONFIG, GFP_KERNEL); TCMU_MCGRP_CONFIG, GFP_KERNEL);
/* We don't care if no one is listening */
if (ret == -ESRCH) /* Wait during an add as the listener may not be up yet */
ret = 0; if (ret == 0 ||
if (!ret) (ret == -ESRCH && cmd == TCMU_CMD_ADDED_DEVICE))
ret = tcmu_wait_genl_cmd_reply(udev); return tcmu_wait_genl_cmd_reply(udev);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment