-
Notifications
You must be signed in to change notification settings - Fork 142
CORTX-34042 - Fix load_extents logic in balloc module. #2120
CORTX-34042 - Fix load_extents logic in balloc module. #2120
Conversation
In exiting code, decision about group is loaded or not is taken based on grp->bgi_extents pointer value. On restart if free fragment count = 0 then bgi_extents will remain NULL. Later when any fragment is freeup then corresponding entry in extent list and extent btree will be added by creating new extent using lext_create() api i.e le_is_alloc = true. The subsequent call to m0_balloc_load_extents() will find bgi_extents == NULL and try to load extent allocated using M0_ALLOC_ARR where le_is_alloc = false, but with same start/end values. This ends up in having overlapping entry in extent list and mismatch in fragment count in group info vs total entries in list. This PR is to add separate flag to decide about group loaded vs not loaded status, and will avoid overlapping entries scenario mentioned above. Signed-off-by: Mukund Kanekar <mukund.kanekar@seagate.com>
1.Added one liner description about newly added ‘bgi_extents_loaded’ flag. 2.Updated M0_ASSERT() with M0_ASSERT_INFO() to print ‘rc’ value. Signed-off-by: Mukund Kanekar <mukund.kanekar@seagate.com>
Signed-off-by: Mukund Kanekar <mukund.kanekar@seagate.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Jenkins CI Result : Motr#1685Motr Test Summary
CppCheck SummaryCppcheck: No new warnings found 👍 |
Jenkins CI Result : Motr#1690Motr Test Summary
CppCheck SummaryCppcheck: No new warnings found 👍 |
CORTX-34042 - Fix load_extents logic in balloc module.
Signed-off-by: Mukund Kanekar mukund.kanekar@seagate.com
Problem Statement
grp->bgi_extents pointer value.
On restart if free fragment count = 0 then bgi_extents will remain NULL.
Later when any fragment is freed up then corresponding entry in extent list
and extent btree will be added by creating new extent using lext_create()
api i.e le_is_alloc = true.
The subsequent call to m0_balloc_load_extents() will find bgi_extents == NULL
and try to load extent allocated using M0_ALLOC_ARR where le_is_alloc = false,
but with same start/end values.
This ends up in having overlapping entry in extent list and mismatch in fragment
count in group info vs actual total entries in list.
If one of the overlapping extents goes off w.r. to value stored in btree due subsequent
free/alloc operations, then extent btree update operation fails with -2 (ENOENT) error,
Design
This PR is to add separate flag to decide about group loaded vs not loaded
status, and will avoid overlapping entries scenario mentioned above.
Coding
Checklist for Author
Testing
Checklist for Author
Impact Analysis
Checklist for Author/Reviewer/GateKeeper
Review Checklist
Checklist for Author
Documentation
Checklist for Author