mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 00:12:52 +00:00
libiscsi calls the check_protection transport handler only if SCSI-Respose is received. So, the handler is never called if iSCSI task is completed for some other reason like a timeout or error handling. And this behavior looks correct. But the iSER does not handle this case properly because it puts a non-checked signature MR to the free pool. Then the error occurs at reusing the MR because it is not allowed to invalidate a signature MR without checking. This commit adds an extra check to iser_unreg_mem_fastreg(), which is a part of the task cleanup flow. Now the signature MR is checked there if it is needed. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sergey Gorenko <[email protected]> Reviewed-by: Max Gurtovoy <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>