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.
Lustre-change: https://review.whamcloud.com/27962
Lustre-commit:
1b6af5006d0a36615f059030b005d55d3c7bb45e
Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I4469a55b35ea5d35a9f0be152f085bd676f74240
Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/28403
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
/* 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);