Revert "ANDROID: dm-bow: Protect Ranges fetched and erased from the RB tree"
This reverts commit 2b9be6339b5f7fc37b81689d61f5fdbdd86d15fc.
Reason for revert: Needs rework - causes unforeseen deadlock.
Bug: 227141277
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ib754e231728361397d0f2441731fd325a8c06b07
diff --git a/drivers/md/dm-bow.c b/drivers/md/dm-bow.c
index 9137b61b..cac4459 100644
--- a/drivers/md/dm-bow.c
+++ b/drivers/md/dm-bow.c
@@ -236,7 +236,6 @@
(*br)->type = type;
- mutex_lock(&bc->ranges_lock);
if (next->type == type) {
if (type == TRIMMED)
list_del(&next->trimmed_list);
@@ -250,7 +249,6 @@
rb_erase(&(*br)->node, &bc->ranges);
kfree(*br);
}
- mutex_unlock(&bc->ranges_lock);
*br = NULL;
}
@@ -601,7 +599,6 @@
struct bow_context *bc = (struct bow_context *) ti->private;
struct kobject *kobj;
- mutex_lock(&bc->ranges_lock);
while (rb_first(&bc->ranges)) {
struct bow_range *br = container_of(rb_first(&bc->ranges),
struct bow_range, node);
@@ -609,8 +606,6 @@
rb_erase(&br->node, &bc->ranges);
kfree(br);
}
- mutex_unlock(&bc->ranges_lock);
-
if (bc->workqueue)
destroy_workqueue(bc->workqueue);
if (bc->bufio)
@@ -1186,7 +1181,6 @@
return;
}
- mutex_lock(&bc->ranges_lock);
for (i = rb_first(&bc->ranges); i; i = rb_next(i)) {
struct bow_range *br = container_of(i, struct bow_range, node);
@@ -1194,11 +1188,11 @@
readable_type[br->type],
(unsigned long long)br->sector);
if (result >= end)
- goto unlock;
+ return;
result += scnprintf(result, end - result, "\n");
if (result >= end)
- goto unlock;
+ return;
if (br->type == TRIMMED)
++trimmed_range_count;
@@ -1220,22 +1214,19 @@
if (!rb_next(i)) {
scnprintf(result, end - result,
"\nERROR: Last range not of type TOP");
- goto unlock;
+ return;
}
if (br->sector > range_top(br)) {
scnprintf(result, end - result,
"\nERROR: sectors out of order");
- goto unlock;
+ return;
}
}
if (trimmed_range_count != trimmed_list_length)
scnprintf(result, end - result,
"\nERROR: not all trimmed ranges in trimmed list");
-
-unlock:
- mutex_unlock(&bc->ranges_lock);
}
static void dm_bow_status(struct dm_target *ti, status_type_t type,