nvme: Linux compat: don't filter & 0x3.

Strictly speaking, opc & 0x3 == 3 is input and output at the same
time. This is undefined, in general. But for vendor commands, it's
vendor specific. Linux allows it generally and treats it as a read,
which is what we do too, so remove this check to be more compatible with
Linux's behavior (which we're trying to emulate).

Sponsored by:		Netflix
This commit is contained in:
Warner Losh
2025-09-08 15:09:49 -06:00
parent 614e9b33bf
commit 952ce991ec
-8
View File
@@ -1417,14 +1417,6 @@ nvme_ctrlr_linux_passthru_cmd(struct nvme_controller *ctrlr,
npc->data_len, ctrlr->max_xfer_size);
return (EIO);
}
/*
* We only support data out or data in commands, but not both at
* once. However, there's some comands with lower bit cleared
* that are really read commands, so we should filter & 3 == 0,
* but don't.
*/
if ((npc->opcode & 0x3) == 3)
return (EINVAL);
if (is_user) {
ret = nvme_user_ioctl_req(npc->addr, npc->data_len,
npc->opcode & 0x1, upages, nitems(upages), &npages,