Re: [PATCH] fix: scsi: srp_reconnect_rport: unbalanced scsi_block_targets/scsi_target_unblock
From: James Bottomley
Date: Fri Jun 26 2026 - 12:54:41 EST
On Sat, 2026-06-27 at 00:14 +0800, WenTao Liang wrote:
> In srp_reconnect_rport(), scsi_block_targets() is called only when
> rport->state is not FAIL_FAST and not LOST. However,
> scsi_target_unblock() is called unconditionally on the success path
> and on some error paths, causing an extra kref_put on sdev_gendev
> when block was never called.
I don't believe this is true: block and unblock calls don't have an
unbalanced kref in them (by design, since you're supposed to be able to
have unblock called on a running device and be a no-op).
Regards,
James