Do not attempt to write to read-only softraid
authorkn <kn@openbsd.org>
Tue, 25 Apr 2023 14:00:35 +0000 (14:00 +0000)
committerkn <kn@openbsd.org>
Tue, 25 Apr 2023 14:00:35 +0000 (14:00 +0000)
commitdfac96a9afdf26d1faceea0d9ccaf74d702515d6
treebc5d106c9ab0ce611a8b716077f454ce36390a1e
parentc1729c40788967aa8f85d17d2c7dd41b829a98b5
Do not attempt to write to read-only softraid

Bootloaders have no write support for softraid volumes, which manifests in,
e.g. /bsd.upgrade not being stripped of its 'x' permission bit to prevent
sysupgrade loops in case of upgrade failure.

Set a no-write flag handled by libsa to bail out early in write calls.
There should be no real behaviour change, writes just fail earlier now.

sparc64 ofwboot.  Crank minor.
Tested on T4-2 guest domain with root on softraid.
sys/arch/sparc64/stand/ofwboot/ofdev.c
sys/arch/sparc64/stand/ofwboot/vers.c