[LU-9744] HS_DIRTY/CLF_HSM_DIRTY can be wrongly reported upon HSM action error Created: 07/Jul/17 Updated: 18/Mar/19 Resolved: 05/Aug/17 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.10.1, Lustre 2.11.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Bruno Faccini (Inactive) | Assignee: | Bruno Faccini (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Severity: | 3 | ||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||
| Description |
|
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 : /**
* get obj and HSM attributes on a fid
* \param mti [IN] context
* \param fid [IN] object fid
* \param hsm [OUT] HSM meta data
* \retval obj or error (-ENOENT if not found)
*/
struct mdt_object *mdt_hsm_get_md_hsm(struct mdt_thread_info *mti,
const struct lu_fid *fid,
struct md_hsm *hsm)
{
struct md_attr *ma;
struct mdt_object *obj;
int rc;
ENTRY;
ma = &mti->mti_attr;
ma->ma_need = MA_HSM;
ma->ma_valid = 0;
/* find object by FID */
obj = mdt_object_find(mti->mti_env, mti->mti_mdt, fid);
if (IS_ERR(obj))
RETURN(obj);
if (!mdt_object_exists(obj)) {
/* no more object */
mdt_object_put(mti->mti_env, obj);
RETURN(ERR_PTR(-ENOENT));
}
rc = mdt_attr_get_complex(mti, obj, ma);
if (rc) {
mdt_object_put(mti->mti_env, obj);
RETURN(ERR_PTR(rc));
}
if (ma->ma_valid & MA_HSM)
*hsm = ma->ma_hsm;
else
memset(hsm, 0, sizeof(*hsm));
ma->ma_valid = 0;
RETURN(obj);
}
...................
/**
* update status of a completed request
* \param mti [IN] context
* \param pgs [IN] progress of the copy tool
* \param update_record [IN] update llog record
* \retval 0 success
* \retval -ve failure
*/
static int hsm_cdt_request_completed(struct mdt_thread_info *mti,
struct hsm_progress_kernel *pgs,
const struct cdt_agent_req *car,
enum agent_req_status *status)
{
const struct lu_env *env = mti->mti_env;
struct mdt_device *mdt = mti->mti_mdt;
struct coordinator *cdt = &mdt->mdt_coordinator;
struct mdt_object *obj = NULL;
int cl_flags = 0, rc = 0;
struct md_hsm mh;
bool is_mh_changed;
bool need_changelog = true;
ENTRY;
/* default is to retry */
*status = ARS_WAITING;
/* find object by FID, mdt_hsm_get_md_hsm() returns obj or err
* if error/removed continue anyway to get correct reporting done */
obj = mdt_hsm_get_md_hsm(mti, &car->car_hai->hai_fid, &mh);
......................
/* rc != 0 means error when analysing action, it may come from
* a crasy CT no need to manage DIRTY
*/
if (rc == 0)
hsm_set_cl_flags(&cl_flags,
mh.mh_flags & HS_DIRTY ? CLF_HSM_DIRTY : 0);
.......................
!IS_ERR(obj) should also be tested before adding CLF_HSM_DIRTY in cl_flags. 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. |
| Comments |
| Comment by Gerrit Updater [ 07/Jul/17 ] |
|
Faccini Bruno (bruno.faccini@intel.com) uploaded a new patch: https://review.whamcloud.com/27962 |
| Comment by Gerrit Updater [ 05/Aug/17 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27962/ |
| Comment by Peter Jones [ 05/Aug/17 ] |
|
Landed for 2.11 |
| Comment by Gerrit Updater [ 07/Aug/17 ] |
|
Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/28403 |
| Comment by Gerrit Updater [ 10/Aug/17 ] |
|
John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/28403/ |