[LU-7543] reserve lock flags for upcoming features and future expansion Created: 11/Dec/15 Updated: 23/Sep/16 Resolved: 06/Jan/16 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.8.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | nasf (Inactive) | Assignee: | nasf (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||
| Severity: | 3 | ||||
| Rank (Obsolete): | 9223372036854775807 | ||||
| Description |
|
The obd_connect_flags field has almost run out of bits to add new features. Reserve the last few free bits for upcoming features and the very last bit for OBD_CONNECT_FLAGS2 to create obd_connect_flags2, to have space for new features. Any feature that is using a bit in obd_connect_flags2 needs to understand OBD_CONNECT_FLAGS2 as well. |
| Comments |
| Comment by Gerrit Updater [ 11/Dec/15 ] |
|
Fan Yong (fan.yong@intel.com) uploaded a new patch: http://review.whamcloud.com/17559 |
| Comment by Andreas Dilger [ 12/Dec/15 ] |
|
The connection handing code on the server would need to add OBD_CONNECT_FLAGS2 checking, and then add a separate OST_CONNECT2_SUPPORTED MDT_CONNECT2_SUPPORTED, and MGS_CONNECT2_SUPPORTED masks for that word. Strictly speaking, clients shouldn't care if obd_connect_flags2 is masked off or not, since an older server will drop OBD_CONNECT_FLAGS2 and the client should check if this is still valid before trying to check obd_connect_flags2 features. It might be best to hide this complexity inside accessor functions like: bool obd_connect_has_grant(struct obd_connect_data *ocd)
{
return ocd->obd_connect_data & OBD_CONNECT_GRANT;
}
bool obd_connect_has_future_feature(struct obd_connect_data *ocd)
{
return ocd->obd_connect_data & OBD_CONNECT_FLAGS2 &&
ocd->obd_connect_data2 & OBD_CONNECT2_FUTURE_FEATURE;
}
Otherwise, there is a danger of someone using an OBD_CONNECT2_* flag with obd_connect_data incorrectly, and having multiple checks throughout the code is just ugly. This would also allow us to change the above helper function to "return false" if a feature is disabled at compile time for some reason without having to mess with the rest of the code. |
| Comment by Andreas Dilger [ 12/Dec/15 ] |
|
There are several older feature flags that could begin to be deprecated, for "features" that were more like transient bug fixes and not expected to ever be removed, or features that are always set on all connections and provide no value:
|
| Comment by Gerrit Updater [ 17/Dec/15 ] |
|
Fan Yong (fan.yong@intel.com) uploaded a new patch: http://review.whamcloud.com/17644 |
| Comment by Gerrit Updater [ 17/Dec/15 ] |
|
Fan Yong (fan.yong@intel.com) uploaded a new patch: http://review.whamcloud.com/17645 |
| Comment by Gerrit Updater [ 17/Dec/15 ] |
|
Fan Yong (fan.yong@intel.com) uploaded a new patch: http://review.whamcloud.com/17646 |
| Comment by Gerrit Updater [ 17/Dec/15 ] |
|
Fan Yong (fan.yong@intel.com) uploaded a new patch: http://review.whamcloud.com/17647 |
| Comment by Gerrit Updater [ 06/Jan/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/17644/ |
| Comment by Gerrit Updater [ 06/Jan/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/17645/ |
| Comment by Gerrit Updater [ 06/Jan/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/17646/ |
| Comment by Gerrit Updater [ 06/Jan/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/17647/ |
| Comment by nasf (Inactive) [ 06/Jan/16 ] |
|
The patches have been landed to master. |