From: Mr NeilBrown Date: Fri, 25 Sep 2020 05:02:42 +0000 (+1000) Subject: LU-13986 target: fix possible liveloop in distribute_txn thd X-Git-Tag: 2.13.57~150 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=d05cab2fd7b9b38cc8414dcb03dbcc7b9ed31696;hp=d05cab2fd7b9b38cc8414dcb03dbcc7b9ed31696 LU-13986 target: fix possible liveloop in distribute_txn thd A recent patch to update_trans.c changed how distribute_txn_thread() waited for more work to do. It previously had an explicit "wait_event()" which listed all the conditions to wait for. It would then recheck each condition and possibly perform an appropriate action. It was changed to check each condition only once (per loop). If the condition was true, the action would be performed and a flag set. If no conditions were true (indicated by flag), it would wait, otherwise it would loop and recheck all condition. One of the "if (condition) { do work }" stanzas in the loop tested a condition that was *not* a condition that should wake up the loop. "batchid" was not tested at all in the wait_event(). The flag mentioned above was, however, set when that condition tested true. This can cause the loop to spin indefinitely. So remove the "__set_current_state(TASK_RUNNING);" so that the value of batchid cannot stop the loop from sleeping (calling 'schedule()'). Signed-off-by: Mr NeilBrown Change-Id: I124ee3e8250dc63fa927f72dc4d29ed3e7b53005 Reviewed-on: https://review.whamcloud.com/40043 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin ---