ref: 580605615f869d7c188816a796edf1386a23dacf
parent: 13b1ea74932158069ab1f4c584db81477d9f3551
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Aug 15 17:32:44 EDT 2023
nusb/disk: advertise the correct iounit for disk files. dossrv(4) issues i/o requests spanning multiple sectors and will error on partial results. the splitting into multiple i/o's is handled by devmnt, but it needs to know the effective i/o unit. the Maxiosize constant in nusb/disk was derived from the 8k default 9p i/o unit, but with the recent change it was increased to 32k, so now nudb/disk would return partial i/o results as it gets the large read and then ceils it at the Maxiosize constant. This change returns the effective i/o unit on open for raw, data and partition files making it work with larger than 8k 9p i/o unit.
--- a/sys/src/cmd/nusb/disk/disk.c
+++ b/sys/src/cmd/nusb/disk/disk.c
@@ -652,6 +652,10 @@
lun->phase = Pcmd;
qunlock(lun);
srvacquire(req->srv);
+ /* wet floor */
+ case Qdata:
+ case Qpart:
+ req->ofcall.iounit = Maxiosize;
break;
}
respond(req, nil);