[LU-7096] Unprotected critical section in nrs_policy_stop Created: 03/Sep/15  Updated: 26/Jul/16  Resolved: 19/Sep/15

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

Type: Bug Priority: Minor
Reporter: Henri Doreau (Inactive) Assignee: Emoly Liu
Resolution: Fixed Votes: 0
Labels: cea, patch

Issue Links:
Related
is related to LU-7072 sanityn test_78: Expected set_param t... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

The execution flow to stopping a NRS policy is not safe, and concurrent execution of a policy' stop function can happen, leading to instant crashes.

For instance:
lctl set_param ost.OSS.ost_io.nrs_policies=orr
lctl set_param ost.OSS.ost_io.nrs_policies=fifo & sleep 0.1 && \
lctl set_param ost.OSS.ost_io.nrs_orr_quantum=32

leads to a crash in:
[...]
#6 [ffff880098c99cc0] kmem_cache_destroy at ffffffff811772bc
#7 [ffff880098c99ce0] nrs_orr_stop at ffffffffa139d8a8 [ptlrpc]
#8 [ffff880098c99d00] nrs_policy_stop0 at ffffffffa13933cf [ptlrpc]
#9 [ffff880098c99d20] nrs_policy_stop_primary at ffffffffa1393938 [ptlrpc]
#10 [ffff880098c99d40] nrs_policy_start_locked at ffffffffa13940e0 [ptlrpc]
#11 [ffff880098c99d90] nrs_policy_ctl at ffffffffa139452c [ptlrpc]
#12 [ffff880098c99de0] ptlrpc_nrs_policy_control at ffffffffa1396092 [ptlrpc]
[...]



 Comments   
Comment by Gerrit Updater [ 03/Sep/15 ]

Henri Doreau (henri.doreau@cea.fr) uploaded a new patch: http://review.whamcloud.com/16214
Subject: LU-7096 nrs: serialize executions of nrs_policy_stop
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 775d8e55928f74ac7dc2bd90a0f82bf2a3b6ca6d

Comment by Peter Jones [ 03/Sep/15 ]

Emoly

Could you please take care of this patch?

Thanks

Peter

Comment by Gerrit Updater [ 19/Sep/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/16214/
Subject: LU-7096 nrs: serialize executions of nrs_policy_stop
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 654bbf7fcc7a4c83d41e70d728e971eaed7994fe

Comment by Peter Jones [ 19/Sep/15 ]

Landed for 2.8

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