[PATCH] nvme-cli: bug-fix: use right file name for perror.

Chaitanya Kulkarni chaitanya.kulkarni at hgst.com
Sat Feb 25 23:07:03 PST 2017


Use right file descriptor while printing an error, when
--metadata option is used for read/write commands.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at hgst.com>
---
 nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nvme.c b/nvme.c
index e693914..1d74b50 100644
--- a/nvme.c
+++ b/nvme.c
@@ -2283,7 +2283,7 @@ static int submit_io(int opcode, char *command, const char *desc,
 	if (strlen(cfg.metadata)){
 		mfd = open(cfg.metadata, flags, mode);
 		if (mfd < 0) {
-			perror(cfg.data);
+			perror(cfg.metadata);
 			return EINVAL;
 		}
 	}
-- 
1.9.1




More information about the Linux-nvme mailing list