From: Keith Busch Date: Mon, 5 Feb 2018 20:19:40 +0000 (-0700) Subject: flush: Use device NSID if issuing through block device X-Git-Tag: v1.6~97 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=869b7b51344afa505e36575d63d6fd238aa7155a;p=users%2Fhch%2Fnvme-cli.git flush: Use device NSID if issuing through block device Signed-off-by: Keith Busch --- 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");