[LU-13593] Fix growing message buffer Created: 22/May/20 Updated: 08/Feb/21 Resolved: 20/Jul/20 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.14.0 |
| Fix Version/s: | Lustre 2.14.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Sebastien Buisson | Assignee: | Sebastien Buisson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | patch | ||
| Issue Links: |
|
||||||||
| Severity: | 3 | ||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||
| Description |
|
lustre_grow_msg_v2() should move memory region even if new size for buffer has already been set. The use case is when it is called via mdt_dom_read_on_open() and req_capsule_server_grow() in order to put DoM file content into RMF_NIOBUF_INLINE field (RQF_LDLM_INTENT_OPEN request with ldlm_intent_open_server format for server part). Indeed, there is another field RMF_FILE_SECCTX (and soon another one for encryption context support) after RMF_NIOBUF_INLINE. To achieve this, I will push a patch that adds an 'oldlen' parameter. |
| Comments |
| Comment by Gerrit Updater [ 22/May/20 ] |
|
Sebastien Buisson (sbuisson@ddn.com) uploaded a new patch: https://review.whamcloud.com/38701 |
| Comment by Mikhail Pershin [ 25/May/20 ] |
|
Sebastien, I don't understand the reason of the patch still. Could you give an example why memcpy() is needed if size is set already? You mean the size was set but data weren't moved? Or something else? |
| Comment by Sebastien Buisson [ 25/May/20 ] |
|
Hi Mike, With the path explained in the description of this ticket, new size of grown buffer RMF_NIOBUF_INLINE is set, but content of fields after it, like RMF_FILE_SECCTX, is not moved, which ends up in corrupted request content. |
| Comment by Mikhail Pershin [ 25/May/20 ] |
|
so problem is that next buffers after NIOBUF_INLINE were not moved? At the same time old code has part that suppose to move such tail, so it does that wrongly and you fixed that, right? |
| Comment by Sebastien Buisson [ 26/May/20 ] |
|
Correct, at least that is my intention with patch submitted under this Jira ticket |
| Comment by Gerrit Updater [ 20/Jul/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38701/ |
| Comment by Peter Jones [ 20/Jul/20 ] |
|
Landed for 2.14 |