[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:
Related
is related to LU-12443 sanity test_271f: @@@@@@ FAIL: expect... Resolved
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
Subject: LU-13593 ptlrpc: fix growing message buffer
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 37e5ca4de3f1ef810cdbe710145a7e776d9e3798

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.
In order to fix this problem I had to modify code according to patch https://review.whamcloud.com/38701.

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
But maybe my fix proposal is not ideal?

Comment by Gerrit Updater [ 20/Jul/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38701/
Subject: LU-13593 ptlrpc: fix growing message buffer
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 2c62cef8ae4107602664271627cf03ff859f7b21

Comment by Peter Jones [ 20/Jul/20 ]

Landed for 2.14

Generated at Sat Feb 10 03:02:34 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.