aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2025-09-08 21:09:49 +0000
committerWarner Losh <imp@FreeBSD.org>2025-09-08 21:09:49 +0000
commit952ce991ec6c699ef59528731a9af75152767ef0 (patch)
tree3dc74bb8f9700e62ff40f4df08172f312c6e682d
parent614e9b33bf5594d9d09b5d296afa4f3aa6971823 (diff)
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
-rw-r--r--sys/dev/nvme/nvme_ctrlr.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c
index fc912c1342f4..3a1894bf754d 100644
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/sys/dev/nvme/nvme_ctrlr.c
@@ -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,