[LU-16633] obd_get_mod_rpc_slot() is vulnerable to races Created: 11/Mar/23  Updated: 11/Dec/23  Resolved: 29/Mar/23

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.16.0
Fix Version/s: Lustre 2.16.0

Type: Bug Priority: Minor
Reporter: Alex Zhuravlev Assignee: Alex Zhuravlev
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-15947 Spinlock contention during wake_up_al... Resolved
is related to LU-16404 sanity test_230n: lfs mirror: cannot ... Open
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

wait_woken() called from obd_get_mod_rpc_slot() resets WQ_FLAG_WOKEN flag, but leaves the corresponding wq_entry on the list.
__wake_up_locked_key() (called from obd_put_mod_rpc() in another thread) finds that wq_entry on the list w/o WQ_FLAG_WOKEN set, consumes one more slot (cl_mod_rpcs_in_flight++).
this way we leak slots.
this can be catched with sanity/182b.



 Comments   
Comment by Alex Zhuravlev [ 11/Mar/23 ]

confirmed with AT with https://review.whamcloud.com/#/c/fs/lustre-release/+/50261/2: https://testing.whamcloud.com/test_sets/2df6460e-17a8-4b75-9abe-313301f0a9dc

Comment by Andreas Dilger [ 20/Mar/23 ]

"Alex Zhuravlev <bzzz@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/50261
Subject: LU-16633 obdclass: fix rpc slot leakage
Project: fs/lustre-release
Branch: master
Current Patch Set: 11
Commit: 238afb52dc57bbfe4db6c3736d9d651903b8ad05

Comment by Gerrit Updater [ 28/Mar/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/50261/
Subject: LU-16633 obdclass: fix rpc slot leakage
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 91a3726f313df33e099320d171039f8371fec27f

Comment by Peter Jones [ 29/Mar/23 ]

Landed for 2.16

Comment by Gerrit Updater [ 03/Jul/23 ]

"Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51539
Subject: LU-16633 obdclass: fix rpc slot leakage
Project: fs/lustre-release
Branch: b2_15
Current Patch Set: 1
Commit: 1fb91b79be498564e6c537228fd4d411b58dcda3

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