From 1c741bbd63354676e0b2caa5f533a9ae3f0b5101 Mon Sep 17 00:00:00 2001 From: Li Xi Date: Thu, 27 Feb 2014 15:58:18 +0800 Subject: [PATCH] LU-4676 hsm: Fix return value error of ct_run() ct_run() returns 0 after find out that fs_name is invalid. lhsmtool_posix will exists with 0 after that error happens. That might mislead scripts calling lhsmtool_posix. Lustre-change: http://review.whamcloud.com/9412 Lustre-commit: d5ad6ff819e635c6ba337586cf70698b7728ff7f Change-Id: Id182e989011e02104b5960c6692995825d939ad6 Signed-off-by: Li Xi Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: jacques-Charles Lafoucriere Reviewed-by: Faccini Bruno Reviewed-by: Oleg Drokin Reviewed-on: http://review.whamcloud.com/10234 --- lustre/utils/lhsmtool_posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lustre/utils/lhsmtool_posix.c b/lustre/utils/lhsmtool_posix.c index 9ca73df..22ba504 100644 --- a/lustre/utils/lhsmtool_posix.c +++ b/lustre/utils/lhsmtool_posix.c @@ -1768,7 +1768,8 @@ static int ct_run(void) hal->hal_fsname, hal->hal_archive_id, hal->hal_count); if (strcmp(hal->hal_fsname, fs_name) != 0) { - CT_ERROR(EINVAL, "'%s' invalid fs name, expecting: %s", + rc = -EINVAL; + CT_ERROR(rc, "'%s' invalid fs name, expecting: %s", hal->hal_fsname, fs_name); err_major++; if (opt.o_abort_on_error) -- 1.8.3.1