Whamcloud - gitweb
LU-4676 hsm: Fix return value error of ct_run() 12/9412/3
authorLi Xi <lixi@ddn.com>
Thu, 27 Feb 2014 07:58:18 +0000 (15:58 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 6 May 2014 02:30:40 +0000 (02:30 +0000)
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 <lixi@ddn.com>
Change-Id: If167b38ffee0faff9d8eeb603c55b4972ba322d8
Reviewed-on: http://review.whamcloud.com/9412
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/lhsmtool_posix.c

index 91ec7b5..6df6af5 100644 (file)
@@ -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)