]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: tcmu: avoid cmd/qfull timers updated whenever a new cmd comes
authorXiubo Li <xiubli@redhat.com>
Fri, 23 Nov 2018 01:15:30 +0000 (09:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:09:47 +0000 (10:09 +0100)
commit8771ff2745b6b489568c9b367d469ac9b36d76ed
treede5962863406d86df50eb71ecab16bdc1698c0b6
parentd9d768d21762106f6cea94aaca2f61a1a9e77746
scsi: tcmu: avoid cmd/qfull timers updated whenever a new cmd comes

[ Upstream commit a94a2572b97744d3a35a1996df0e5cf6b2461a4a ]

Currently there is one cmd timeout timer and one qfull timer for each udev,
and whenever any new command is coming in we will update the cmd timer or
qfull timer. For some corner cases the timers are always working only for
the ringbuffer's and full queue's newest cmd. That's to say the timer won't
be fired even if one cmd has been stuck for a very long time and the
deadline is reached.

This fix will keep the cmd/qfull timers to be pended for the oldest cmd in
ringbuffer and full queue, and will update them with the next cmd's
deadline only when the old cmd's deadline is reached or removed from the
ringbuffer and full queue.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
Acked-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/target/target_core_user.c