[LU-6397] LDLM lock creation race condition on new object creation Created: 24/Mar/15 Updated: 07/Feb/18 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.7.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Patrick Farrell (Inactive) | Assignee: | Patrick Farrell (Inactive) |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | patch | ||
| Severity: | 3 |
| Rank (Obsolete): | 9223372036854775807 |
| Description |
|
This applies to newly created objects, for which kms_valid is not yet set. If kms_valid is not set, osc_enqueue_base will not attempt to match existing ldlm locks: /*
* kms is not valid when either object is completely fresh (so that no
* locks are cached), or object was evicted. In the latter case cached
* lock cannot be used, because it would prime inode state with
* potentially stale LVB.
*/
if (!kms_valid)
goto(no_match);
kms_valid is read out from osc->oo_oinfo->loi_kms_valid in the osc_object. This results in a race when two IO requests are going at the same time. P1 makes an IO request (FX, write to the first page of the file) This is easier to see with async lock requests, since they do not wait (and do not take the range lock which would prevent this race for truly overlapping IOs.), but it also applies to regular lock requests. This can be solved by removing the usage of kms_valid in osc_enqueue_base. Per the comment on that usage, there are two things to handle to remove this usage of kms_valid: For newly created objects: If the object is new and no locks exist, then it's safe to try to match. For evicted objects, Jinshan suggested a solution: Jinshan also provided the patch for this, which I've done basic testing on and will upload shortly. |
| Comments |
| Comment by Gerrit Updater [ 24/Mar/15 ] |
|
Patrick Farrell (paf@cray.com) uploaded a new patch: http://review.whamcloud.com/14167 |
| Comment by Gerrit Updater [ 28/Apr/15 ] |
|
Patrick Farrell (paf@cray.com) uploaded a new patch: http://review.whamcloud.com/14630 |