Whamcloud - gitweb
LU-9744 mdt: avoid wrong CLF_HSM_DIRTY report in ChangeLog 62/27962/2
authorBruno Faccini <bruno.faccini@intel.com>
Fri, 7 Jul 2017 14:42:07 +0000 (16:42 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 5 Aug 2017 00:38:22 +0000 (00:38 +0000)
In hsm_cdt_request_completed() and upon error being returned
from mdt_hsm_get_md_hsm(), where "struct md_hsm mh" has not been
populated, HS_DIRTY can be wrongly detected and thus CLF_HSM_DIRTY
flag will be reported by error
This can be the cause of errors in associated sanity-hsm sub-tests
test_220a, test_222c, test_222d, tests_224a, when analyzing
ChangeLog flags.
!IS_ERR(obj) should also be tested before adding CLF_HSM_DIRTY
in cl_flags.

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I4469a55b35ea5d35a9f0be152f085bd676f74240
Reviewed-on: https://review.whamcloud.com/27962
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdt/mdt_coordinator.c

index bf04033..e59452e 100644 (file)
@@ -1377,8 +1377,10 @@ static int hsm_cdt_request_completed(struct mdt_thread_info *mti,
 
        /* rc != 0 means error when analysing action, it may come from
         * a crasy CT no need to manage DIRTY
+        * and if mdt_hsm_get_md_hsm() has returned an error, mh has not been
+        * filled
         */
-       if (rc == 0)
+       if (rc == 0 && !IS_ERR(obj))
                hsm_set_cl_flags(&cl_flags,
                                 mh.mh_flags & HS_DIRTY ? CLF_HSM_DIRTY : 0);