From: Li Xi Date: Thu, 27 Feb 2014 07:58:18 +0000 (+0800) Subject: LU-4676 hsm: Fix return value error of ct_run() X-Git-Tag: 2.5.59~55 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=d5ad6ff819e635c6ba337586cf70698b7728ff7f;hp=1c3b697d82666790ca7c6f384f0ec0112fd769b9;ds=sidebyside 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. Signed-off-by: Li Xi Change-Id: If167b38ffee0faff9d8eeb603c55b4972ba322d8 Reviewed-on: http://review.whamcloud.com/9412 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: jacques-Charles Lafoucriere Reviewed-by: Faccini Bruno Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/lhsmtool_posix.c b/lustre/utils/lhsmtool_posix.c index 91ec7b5..6df6af5 100644 --- a/lustre/utils/lhsmtool_posix.c +++ b/lustre/utils/lhsmtool_posix.c @@ -1776,7 +1776,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)