fix(v4.0.0): three defects -- a refused device write, a failed starting state, a case that QUITs
A block write the device refuses after the kernel has taken the node's copy: the node was told "Storage refused" while the kernel's cache kept the new data, to be read back and perhaps written later. The kernel now puts its own copy back as it was. Tested with a device whose writes can be made to fail; it failed first. POST's runner: a case whose starting state could not be set says so, with what the node said, where it showed nothing; and a case that ends with QUIT fails, as it did when the cases were a capsule, where the runner had taken it for a completed line. Both tests failed first. The v4 boot says "Artemis: virtio-blk attached" only when the attach worked. make -C v4 test, sanitize and hosted-check pass; amd64, aarch64 and riscv64 boot, POST 538 of 538, dict_hash 0x5f0a949a6fc8ef2b on all six: logs/20261007-135741, -140004, -140329. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
bc6deab3f5
commit
193523d873
+10
-4
@@ -44,13 +44,16 @@ int v4_post_run(const v4_post_host *h, const v4_post_case *cases, unsigned count
|
||||
for (i = 0; i < count; i++) {
|
||||
const v4_post_case *c = &cases[i];
|
||||
unsigned kept = 0, total = 0, len = 0, depth;
|
||||
int errored = 0, came_back = 1, lost = 0, ok, how;
|
||||
int errored = 0, came_back = 1, lost = 0, no_state = 0, quit = 0, ok, how;
|
||||
|
||||
/* every case starts from the same state */
|
||||
v4_dstack_reset(&h->n->ds);
|
||||
how = h->line(h->self, state_line, (unsigned)sizeof state_line - 1u, out, 0u, &len);
|
||||
how = h->line(h->self, state_line, (unsigned)sizeof state_line - 1u, out, V4_POST_OUT, &len);
|
||||
if (how < 0) lost = 1;
|
||||
if (how != V4_TEXT_COMPLETED) came_back = 0;
|
||||
if (how != V4_TEXT_COMPLETED) { /* what the node said of it is what is shown */
|
||||
came_back = 0; no_state = 1;
|
||||
total = len; kept = len < V4_POST_OUT ? len : V4_POST_OUT;
|
||||
}
|
||||
v4_dstack_reset(&h->n->ds);
|
||||
|
||||
for (k = 0; came_back && k < c->line_count; k++) {
|
||||
@@ -58,6 +61,7 @@ int v4_post_run(const v4_post_host *h, const v4_post_case *cases, unsigned count
|
||||
how = h->line(h->self, c->lines[k], length(c->lines[k]), out + kept, V4_POST_OUT - kept, &len);
|
||||
if (how < 0) { came_back = 0; lost = 1; break; }
|
||||
if (how == V4_TEXT_ERROR) errored = 1;
|
||||
if (how == V4_TEXT_QUIT) quit = 1; /* it went back to the terminal: it did not complete */
|
||||
total += len;
|
||||
kept = total < V4_POST_OUT ? total : V4_POST_OUT;
|
||||
}
|
||||
@@ -70,7 +74,7 @@ int v4_post_run(const v4_post_host *h, const v4_post_case *cases, unsigned count
|
||||
}
|
||||
v4_dstack_reset(&h->n->ds);
|
||||
|
||||
if (!came_back) {
|
||||
if (!came_back || quit) {
|
||||
ok = 0;
|
||||
} else if (c->expect == V4_POST_ERROR) {
|
||||
ok = errored;
|
||||
@@ -92,6 +96,8 @@ int v4_post_run(const v4_post_host *h, const v4_post_case *cases, unsigned count
|
||||
if (ok) { tally->pass++; continue; }
|
||||
tally->fail++;
|
||||
say(h, "POST FAIL: "); say(h, c->name);
|
||||
if (no_state) say(h, " could not be put in its starting state:");
|
||||
if (quit) say(h, " ended with QUIT:");
|
||||
say(h, " out<"); h->say(h->self, out, kept < SHOWN_OUT ? kept : SHOWN_OUT);
|
||||
say(h, "> stack<");
|
||||
for (k = depth < SHOWN_STACK ? depth : SHOWN_STACK; k-- > 0; ) { say_number(h, (long long)left[k]); say(h, " "); }
|
||||
|
||||
Reference in New Issue
Block a user