]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
default flush to use block device nsid
authorKeith Busch <kbusch@kernel.org>
Tue, 1 Jun 2021 14:01:44 +0000 (07:01 -0700)
committerKeith Busch <kbusch@kernel.org>
Tue, 1 Jun 2021 14:01:44 +0000 (07:01 -0700)
Kernel 5.13 added checks to ensure the ioctl path can't be abused to
access a different namespace than the one user space has permission to
open. This unfortunately breaks the all-nsid flush usage, so user
tooling needs to default to the device's namespace id.

Link: https://lore.kernel.org/linux-nvme/20210518144249.GE2709569@dhcp-10-100-145-180.wdc.com/T/#t
Link: https://github.com/linux-nvme/nvme-cli/issues/1066
Signed-off-by: Keith Busch <kbusch@kernel.org>
nvme.c

diff --git a/nvme.c b/nvme.c
index 87e1a827f7f9aadbf8243589ed58d0433e956f4a..1666ba55d69cd5e10a7fdcf04d0c71e3f9d1543a 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -4384,7 +4384,7 @@ static int flush(int argc, char **argv, struct command *cmd, struct plugin *plug
        };
 
        struct config cfg = {
-               .namespace_id = NVME_NSID_ALL,
+               .namespace_id = 0,
        };
 
        OPT_ARGS(opts) = {