From: Chaitanya Kulkarni Date: Fri, 18 Mar 2022 01:24:08 +0000 (-0700) Subject: fabrics: keep the backward compatibility X-Git-Tag: v2.0-rc7~4 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=aeca69dcb807071545cee31d195c16fc6da23168;p=users%2Fsagi%2Fnvme-cli.git fabrics: keep the backward compatibility Don't print the message while disconnecting it is breaking blktests, see below without this patch :- nvme/005 (reset local loopback target) [failed] runtime 6.799s ... 6.814s --- tests/nvme/005.out 2021-08-29 01:09:20.287901783 -0700 +++ /mnt/data/blktests/results/nodev/nvme/005.out.bad 2022-03-17 18:11:16.198191553 -0700 @@ -1,2 +1,3 @@ Running nvme/005 +Disconnected nvme1 Test complete With this patch :- blktests (master) # ./check nvme/005 nvme/005 (reset local loopback target) [passed] runtime 6.807s ... 6.801s Signed-off-by: Chaitanya Kulkarni Signed-off-by: Daniel Wagner Link: https://lore.kernel.org/r/20220318012408.24779-1-kch@nvidia.com --- diff --git a/fabrics.c b/fabrics.c index 743d18b8..62960aa9 100644 --- a/fabrics.c +++ b/fabrics.c @@ -791,9 +791,7 @@ int nvmf_disconnect(const char *desc, int argc, char **argv) return errno; } ret = nvme_disconnect_ctrl(c); - if (!ret) - printf("Disconnected %s\n", p); - else + if (ret) fprintf(stderr, "Failed to disconnect %s: %s\n", p, nvme_strerror(errno));