Whamcloud - gitweb
LU-4676 hsm: Fix return value error of ct_run() 34/10234/2
authorLi Xi <lixi@ddn.com>
Thu, 27 Feb 2014 07:58:18 +0000 (15:58 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 11 Jun 2014 19:33:03 +0000 (19:33 +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.

Lustre-change: http://review.whamcloud.com/9412
Lustre-commit: d5ad6ff819e635c6ba337586cf70698b7728ff7f

Change-Id: Id182e989011e02104b5960c6692995825d939ad6
Signed-off-by: Li Xi <lixi@ddn.com>
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>
Reviewed-on: http://review.whamcloud.com/10234

lustre/utils/lhsmtool_posix.c

index 9ca73df..22ba504 100644 (file)
@@ -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)