Skip to contentSkip to conversation

tcmu: unmap if dev is configured

PATCH Applied Mike Christie 1 participant 1 message Jul 23, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 6/9 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

---
 drivers/target/target_core_user.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/target/target_core_user.c +5 -0
index d6b4022..31cfe83 100644
@@ -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);
 
Signature · 1 line
1.8.3.1