mirror of
https://github.com/schoebel/mars
synced 2025-04-27 21:58:20 +00:00
infra: additionally safeguard race on brick resource deallocation
This commit is contained in:
parent
fa49247b8e
commit
802cc73b49
@ -1475,7 +1475,9 @@ restart:
|
|||||||
}
|
}
|
||||||
for (tmp = anchor->next; tmp != anchor; tmp = tmp->next) {
|
for (tmp = anchor->next; tmp != anchor; tmp = tmp->next) {
|
||||||
struct mars_brick *brick;
|
struct mars_brick *brick;
|
||||||
|
int count;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
if (use_dent_link) {
|
if (use_dent_link) {
|
||||||
brick = container_of(tmp, struct mars_brick, dent_brick_link);
|
brick = container_of(tmp, struct mars_brick, dent_brick_link);
|
||||||
} else {
|
} else {
|
||||||
@ -1496,6 +1498,10 @@ restart:
|
|||||||
if (!even_on && (brick->power.button || !brick->power.led_off)) {
|
if (!even_on && (brick->power.button || !brick->power.led_off)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// only kill bricks which have no resources allocated
|
||||||
|
count = atomic_read(&brick->mref_object_layout.alloc_count);
|
||||||
|
if (count > 0)
|
||||||
|
continue;
|
||||||
/* Workaround FIXME:
|
/* Workaround FIXME:
|
||||||
* only kill bricks which have not been touched during the current mars_dent_work() round.
|
* only kill bricks which have not been touched during the current mars_dent_work() round.
|
||||||
* some bricks like aio seem to have races between startup and termination of threads.
|
* some bricks like aio seem to have races between startup and termination of threads.
|
||||||
|
Loading…
Reference in New Issue
Block a user