Skip to content

Commit 5a2540f

Browse files
author
Mete Durlu
committed
scsi: zfcp: Clarify zfcp_port refcount ownership during "link" test
JIRA: https://issues.redhat.com/browse/RHEL-73492 commit 32574fe Author: Steffen Maier <maier@linux.ibm.com> Date: Thu Dec 5 15:19:31 2024 +0100 scsi: zfcp: Clarify zfcp_port refcount ownership during "link" test Reviewed-by: Benjamin Block <bblock@linux.ibm.com> Signed-off-by: Steffen Maier <maier@linux.ibm.com> Signed-off-by: Nihar Panda <niharp@linux.ibm.com> Link: https://lore.kernel.org/r/20241205141932.1227039-3-niharp@linux.ibm.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Mete Durlu <mdurlu@redhat.com>
1 parent 32b8eff commit 5a2540f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/s390/scsi/zfcp_fc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,11 @@ static void zfcp_fc_adisc_handler(void *data)
537537
/* port is still good, nothing to do */
538538
out:
539539
atomic_andnot(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
540+
/*
541+
* port ref comes from get_device() in zfcp_fc_test_link() and
542+
* work item zfcp_fc_link_test_work() passes ref via
543+
* zfcp_fc_adisc() to here, if zfcp_fc_adisc() could send ADISC
544+
*/
540545
put_device(&port->dev);
541546
kmem_cache_free(zfcp_fc_req_cache, fc_req);
542547
}
@@ -603,7 +608,7 @@ void zfcp_fc_link_test_work(struct work_struct *work)
603608

604609
retval = zfcp_fc_adisc(port);
605610
if (retval == 0)
606-
return;
611+
return; /* port ref passed to zfcp_fc_adisc(), no put here */
607612

608613
/* send of ADISC was not possible */
609614
atomic_andnot(ZFCP_STATUS_PORT_LINK_TEST, &port->status);

0 commit comments

Comments
 (0)