code: plan9front

Download patch

ref: fd2958b2cda8fed891c78542a032d9bee335192e
parent: 166e8b3cf8d2e087258eb47fdba7e890d6a8432a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Oct 8 14:56:47 EDT 2022

nusb/disk: always allow raw scsi request (even without media present)

--- a/sys/src/cmd/nusb/disk/disk.c
+++ b/sys/src/cmd/nusb/disk/disk.c
@@ -746,10 +746,6 @@
 	qlock(lun);
 	switch(path){
 	case Qraw:
-		if(lun->lbsize <= 0 && umscapacity(lun) < 0){
-			respond(req, "phase error");
-			break;
-		}
 		switch(lun->phase){
 		case Pcmd:
 			respond(req, "phase error");
@@ -853,10 +849,6 @@
 		free(s);
 		break;
 	case Qraw:
-		if(lun->lbsize <= 0 && umscapacity(lun) < 0){
-			respond(req, "phase error");
-			break;
-		}
 		switch(lun->phase){
 		case Pcmd:
 			if(count != 6 && count != 10 && count != 12 && count != 16){