From 86421e70c1583f5691e516b7c216efdd9b241e99 Mon Sep 17 00:00:00 2001 From: Bruno Faccini Date: Fri, 7 Jul 2017 16:42:07 +0200 Subject: [PATCH] LU-9744 mdt: avoid wrong CLF_HSM_DIRTY report in ChangeLog 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 Change-Id: I4469a55b35ea5d35a9f0be152f085bd676f74240 Reviewed-by: Quentin Bouget Reviewed-by: John L. Hammond Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/28403 Tested-by: Jenkins Tested-by: Maloo --- lustre/mdt/mdt_coordinator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/mdt/mdt_coordinator.c b/lustre/mdt/mdt_coordinator.c index bf04033..e59452e 100644 --- a/lustre/mdt/mdt_coordinator.c +++ b/lustre/mdt/mdt_coordinator.c @@ -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); -- 1.8.3.1