Patch "scsi: target: tcmu: Return from tcmu_handle_completions() if cmd_id not found" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    scsi: target: tcmu: Return from tcmu_handle_completions() if cmd_id not found

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scsi-target-tcmu-return-from-tcmu_handle_completions.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 64aeae2375895b2cd45740ee5a13eb11f63d2be7
Author: Bodo Stroesser <bostroesser@xxxxxxxxx>
Date:   Fri Apr 23 17:01:23 2021 +0200

    scsi: target: tcmu: Return from tcmu_handle_completions() if cmd_id not found
    
    [ Upstream commit 9814b55cde0588b6d9bc496cee43f87316cbc6f1 ]
    
    If tcmu_handle_completions() finds an invalid cmd_id while looping over cmd
    responses from userspace it sets TCMU_DEV_BIT_BROKEN and breaks the
    loop. This means that it does further handling for the tcmu device.
    
    Skip that handling by replacing 'break' with 'return'.
    
    Additionally change tcmu_handle_completions() from unsigned int to bool,
    since the value used in return already is bool.
    
    Link: https://lore.kernel.org/r/20210423150123.24468-1-bostroesser@xxxxxxxxx
    Signed-off-by: Bodo Stroesser <bostroesser@xxxxxxxxx>
    Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index 7d5814a95e1e..c6950f157b99 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -1391,7 +1391,7 @@ static int tcmu_run_tmr_queue(struct tcmu_dev *udev)
 	return 1;
 }
 
-static unsigned int tcmu_handle_completions(struct tcmu_dev *udev)
+static bool tcmu_handle_completions(struct tcmu_dev *udev)
 {
 	struct tcmu_mailbox *mb;
 	struct tcmu_cmd *cmd;
@@ -1434,7 +1434,7 @@ static unsigned int tcmu_handle_completions(struct tcmu_dev *udev)
 			pr_err("cmd_id %u not found, ring is broken\n",
 			       entry->hdr.cmd_id);
 			set_bit(TCMU_DEV_BIT_BROKEN, &udev->flags);
-			break;
+			return false;
 		}
 
 		tcmu_handle_completion(cmd, entry);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux