]> git.baikalelectronics.ru Git - kernel.git/commit
tcmu: fix unmap thread race
authorMike Christie <mchristi@redhat.com>
Tue, 28 Nov 2017 18:40:30 +0000 (12:40 -0600)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 12 Jan 2018 23:07:12 +0000 (15:07 -0800)
commitd33f1a2e4ada22c2da66fc7b25a99e11cf08645c
treeb112dbd69e692dbffe3f2acecc7c888fbfbce7ca
parenta7dfb3234a720b1e089248188d4d5087206cd71d
tcmu: fix unmap thread race

If the unmap thread has already run find_free_blocks
but not yet run prepare_to_wait when a wake_up(&unmap_wait)
call is done, the unmap thread is going to miss the wake
call. Instead of adding checks for if new waiters were added
this just has us use a work queue which will run us again
in this type of case.

Signed-off-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_user.c