File 0043-flush-Use-device-NSID-if-issuing-through-block-devic.patch of Package nvme-cli.11415

From 869b7b51344afa505e36575d63d6fd238aa7155a Mon Sep 17 00:00:00 2001
From: Keith Busch <keith.busch@intel.com>
Date: Mon, 5 Feb 2018 13:19:40 -0700
Subject: [PATCH] flush: Use device NSID if issuing through block device

Signed-off-by: Keith Busch <keith.busch@intel.com>
---
 nvme.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/nvme.c b/nvme.c
index aa2b8ec..35581fb 100644
--- a/nvme.c
+++ b/nvme.c
@@ -2941,6 +2941,8 @@ static int flush(int argc, char **argv, struct command *cmd, struct plugin *plug
 	if (fd < 0)
 		return fd;
 
+	if (S_ISBLK(nvme_stat.st_mode))
+		cfg.namespace_id = get_nsid(fd);
 	err = nvme_flush(fd, cfg.namespace_id);
 	if (err < 0)
 		perror("flush");
-- 
2.16.4

openSUSE Build Service is sponsored by