From 60eb9e88cafe07fd0a7922d8953f66b53d97b0cd Mon Sep 17 00:00:00 2001 From: Aurelien Degremont Date: Mon, 22 Jul 2013 13:57:27 +0200 Subject: [PATCH] LU-3634 llapi: Fix returned value of llapi_hsm_copy_start/end. Both function were doing a ioctl and were returning ioctl() return code instead of returning errno. Signed-off-by: Aurelien Degremont Change-Id: Ibd4c6f5188bb50e7fa8875e2d4fa3442c2c69888 Reviewed-on: http://review.whamcloud.com/7109 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Faccini Bruno Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- lustre/utils/liblustreapi_hsm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lustre/utils/liblustreapi_hsm.c b/lustre/utils/liblustreapi_hsm.c index c4b5437..7274b07 100644 --- a/lustre/utils/liblustreapi_hsm.c +++ b/lustre/utils/liblustreapi_hsm.c @@ -289,6 +289,8 @@ int llapi_hsm_copy_start(char *mnt, struct hsm_copy *copy, return rc; rc = ioctl(fd, LL_IOC_HSM_COPY_START, copy); + /* If error, return errno value */ + rc = rc ? -errno : 0; close(fd); return rc; @@ -344,6 +346,8 @@ int llapi_hsm_copy_end(char *mnt, struct hsm_copy *copy, goto out_free; rc = ioctl(fd, LL_IOC_HSM_COPY_END, copy); + /* If error, return errno value */ + rc = rc ? -errno : 0; close(fd); out_free: -- 1.8.3.1