Revert "ANDROID: dm-bow: Fix Race Condition in dm_bow_tablestatus()"
This reverts commit 0259eef8a0.
Reason for revert: http://b/533165921#comment5
Change-Id: I36ce0268cc35c8a3e9915c397d69f1ed0b6b3af3
Signed-off-by: Vova Sharaienko <sharaienko@google.com>
This commit is contained in:
1 parent
0259eef8a0
commit
8a66e2bdde
1 file changed
+4
-4
+4
-4
@@ -1202,28 +1202,28 @@ static void dm_bow_tablestatus(struct dm_target *ti, char *result,
|
|||||||
return;
|
return;
|
||||||
result[0] = 0;
|
result[0] = 0;
|
||||||
|
|
||||||
mutex_lock(&bc->ranges_lock);
|
|
||||||
list_for_each_entry(br, &bc->trimmed_list, trimmed_list)
|
list_for_each_entry(br, &bc->trimmed_list, trimmed_list)
|
||||||
if (br->type == TRIMMED) {
|
if (br->type == TRIMMED) {
|
||||||
++trimmed_list_length;
|
++trimmed_list_length;
|
||||||
} else {
|
} else {
|
||||||
scnprintf(result, end - result,
|
scnprintf(result, end - result,
|
||||||
"ERROR: non-trimmed entry in trimmed_list");
|
"ERROR: non-trimmed entry in trimmed_list");
|
||||||
goto unlock;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rb_first(&bc->ranges)) {
|
if (!rb_first(&bc->ranges)) {
|
||||||
scnprintf(result, end - result, "ERROR: Empty ranges");
|
scnprintf(result, end - result, "ERROR: Empty ranges");
|
||||||
goto unlock;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (container_of(rb_first(&bc->ranges), struct bow_range, node)
|
if (container_of(rb_first(&bc->ranges), struct bow_range, node)
|
||||||
->sector) {
|
->sector) {
|
||||||
scnprintf(result, end - result,
|
scnprintf(result, end - result,
|
||||||
"ERROR: First range does not start at sector 0");
|
"ERROR: First range does not start at sector 0");
|
||||||
goto unlock;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mutex_lock(&bc->ranges_lock);
|
||||||
for (i = rb_first(&bc->ranges); i; i = rb_next(i)) {
|
for (i = rb_first(&bc->ranges); i; i = rb_next(i)) {
|
||||||
struct bow_range *br = container_of(i, struct bow_range, node);
|
struct bow_range *br = container_of(i, struct bow_range, node);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user