Repository navigation
js: reject more disks than the kernel takes, instead of dropping them - #184
Open
mannlohchab wants to merge 1 commit into
Open
mannlohchab wants to merge 1 commit into
mannlohchab wants to merge 1 commit into
Conversation
The kernel's kwblk driver takes 16 disks (/dev/wda to /dev/wdp), and BlockHost kept the first 16 of what it was given, so createKernel() with more booted without a word and the guest found the rest missing. createKernel() now rejects that with a BootError that gives the count and the limit, after closing the disks it opened, and the README and the SDK's disks page state the limit. Fixes pithings#182
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #182.
The kernel's kwblk driver takes 16 disks (
KWBLK_MAX_DEVS,/dev/wdato/dev/wdp), andBlockHostkept the first 16 of what it was given (disks.slice(0, MAX_DEVS)), socreateKernel()with more booted without a word and the guest found the rest missing.createKernel()counts the disks after building them (the distro image included, optional specs that were left out not counted) and rejects more than 16 with aBootError, e.g.disks: 31 disks (the distro image included), and the kernel takes at most 16. It closes the disks it opened first; the caller's ownBlockDeviceobjects are left alone. Worker mode goes through the same path.MAX_DEVSis exported fromblock.tsfor this; theslicestays as a backstop for directKernelusers.Testing
test/api.test.ts: 17BlockDeviceobjects inline and 17 file specs in a worker both reject with theBootError, the caller's disks are not closed, and 16 file disks boot with 16wd*devices in/sys/block. Without the change the 17-disk kernels boot and the test does not settle.pnpm typecheckpasses.pnpm test:apiagainst the v0.3.0-261202-b033dc7 release bundle (UNKERNEL_TEST_KERNEL, concurrency 2): 142 pass, 27 skipped, 1 fail. The failure is "worker mode rejects device objects", which loadsjs/unkernel.wasm, a bundle I have not built locally.pnpm test:blockpasses. One HTTP read-ahead timing test failed once while the API suite was loading the machine; on its own it passes, with and without this change.