]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.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)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 12 Jan 2019 01:58:52 +0000 (20:58 -0500)
commita94a2572b97744d3a35a1996df0e5cf6b2461a4a
tree65f91fa95a66f54f0b065a0051b748196d6fed05
parentcc29a1b0a3f2597ce887d339222fa85b9307706d
scsi: tcmu: avoid cmd/qfull timers updated whenever a new cmd comes

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>
drivers/target/target_core_user.c