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

Chaitanya Kulkarni chaitanya.kulkarni at hgst.com
Sun Mar 12 16:13:24 PDT 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 4971683..17318b4 100644
--- a/nvme.c
+++ b/nvme.c
@@ -2282,7 +2282,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