summaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorMike Christie <mchristi@redhat.com>2018-07-23 21:07:48 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2018-07-31 05:17:53 +0200
commitdc335a995527fb1ee9ec5649162b22cd1ce728ee (patch)
treefddd0e53cc084e2a212e498a23db2cc76a11317c /drivers/target
parentscsi: tcmu: check if dev is configured before block/reset (diff)
downloadlinux-dc335a995527fb1ee9ec5649162b22cd1ce728ee.tar.xz
linux-dc335a995527fb1ee9ec5649162b22cd1ce728ee.zip
scsi: tcmu: unmap if dev is configured
The tcmu dev is added to the list of tcmu devices during configuration. At this time the tcmu setup has completed, but lio core has not completed its setup. The device is not yet usable so do not try to unmap blocks from it Signed-off-by: Mike Christie <mchristi@redhat.com> Reviewed-by: Xiubo Li <xiubli@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_user.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index d6b402203b20..31cfe8345ef3 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -2581,6 +2581,11 @@ static void find_free_blocks(void)
list_for_each_entry(udev, &root_udev, node) {
mutex_lock(&udev->cmdr_lock);
+ if (!target_dev_configured(&udev->se_dev)) {
+ mutex_unlock(&udev->cmdr_lock);
+ continue;
+ }
+
/* Try to complete the finished commands first */
tcmu_handle_completions(udev);