copy: safeguard start conditions

This commit is contained in:
Thomas Schoebel-Theuer 2022-06-15 23:48:36 +02:00
parent 2d5b708ff6
commit c9f1854f3c

View File

@ -528,8 +528,10 @@ restart:
/* This is the relgular starting state. /* This is the relgular starting state.
* It must be zero, automatically entered via memset() * It must be zero, automatically entered via memset()
*/ */
if ((unsigned long)READ_ONCE(st->table[0]) | if ((READ_ONCE(st->active[0]) |
(unsigned long)READ_ONCE(st->table[1])) { READ_ONCE(st->active[1])) ||
((unsigned long)READ_ONCE(st->table[0]) |
(unsigned long)READ_ONCE(st->table[1]))) {
MARS_ERR("index %u not startable at pos=%lld\n", MARS_ERR("index %u not startable at pos=%lld\n",
index, pos); index, pos);
progress = -EPROTO; progress = -EPROTO;