mirror of
https://github.com/schoebel/mars
synced 2025-04-01 22:58:34 +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) {
|
||||
struct mars_brick *brick;
|
||||
int count;
|
||||
int status;
|
||||
|
||||
if (use_dent_link) {
|
||||
brick = container_of(tmp, struct mars_brick, dent_brick_link);
|
||||
} else {
|
||||
@ -1496,6 +1498,10 @@ restart:
|
||||
if (!even_on && (brick->power.button || !brick->power.led_off)) {
|
||||
continue;
|
||||
}
|
||||
// only kill bricks which have no resources allocated
|
||||
count = atomic_read(&brick->mref_object_layout.alloc_count);
|
||||
if (count > 0)
|
||||
continue;
|
||||
/* Workaround FIXME:
|
||||
* 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.
|
||||
|
Loading…
Reference in New Issue
Block a user