]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
format: skipping re-read partition for same lbaf or All NS
authorSteven Seungcheol Lee <sc108.lee@samsung.com>
Fri, 15 May 2020 09:54:53 +0000 (18:54 +0900)
committerKeith Busch <kbusch@kernel.org>
Fri, 15 May 2020 14:39:28 +0000 (08:39 -0600)
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index a38e5587f2862e5def510fd1bed670ae5d7f62c9..735d9477f15baeab7bf9152e8538c4cf12a05786 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -2874,7 +2874,7 @@ static int format(int argc, char **argv, struct command *cmd, struct plugin *plu
                nvme_show_status(err);
        else {
                printf("Success formatting namespace:%x\n", cfg.namespace_id);
-               if (ioctl(fd, BLKRRPART) < 0) {
+               if (cfg.lbaf != prev_lbaf && ioctl(fd, BLKRRPART) < 0) {
                        fprintf(stderr, "failed to re-read partition table\n");
                        err = -errno;
                        goto close_fd;