Details
-
Question/Request
-
Resolution: Fixed
-
Minor
-
None
-
None
-
None
-
9223372036854775807
Description
Here is a simplified version of mdt_attr_get_complex():
int mdt_attr_get_complex(struct mdt_attr *ma)
{
int need = ma->ma_need;
ma->ma_valid = 0;
if (need & MA_<something>) {
ma->ma_need = MA_<something>;
mo_attr_get(ma);
}
return 0;
}
Is it normal/necessary for mdt_attr_get_complex() to initialize ma->ma_valid to 0 whenever it is called?
From what I understand, mdt_attr_get_complex() is used to update cached attributes. When an attribute is updated, the field ma_valid is modified to contain the corresponding MA_* flag (MA_INODE, MA_HSM, ...).
The problem I see with this, is that when mdt_attr_get_complex() is called to only update inode attributes, hsm attributes will automatically get invalidated, without re-checking them. Is this the correct behaviour? Shouldn't ma_valid be initialized to only clear the flags that the caller requested to re-check? Something like:
ma->ma_valid ~= ~need
This issue was raised in a discussion on this patch and might be the root cause of LU-9654.