Commit 76b7069
mm/damon/sysfs: check DAMOS regions update progress from before_terminate()
DAMON_SYSFS can receive DAMOS tried regions update request while kdamond
is already out of the main loop and before_terminate callback
(damon_sysfs_before_terminate() in this case) is not yet called. And
damon_sysfs_handle_cmd() can further be finished before the callback is
invoked. Then, damon_sysfs_before_terminate() unlocks damon_sysfs_lock,
which is not locked by anyone. This happens because the callback function
assumes damon_sysfs_cmd_request_callback() should be called before it.
Check if the assumption was true before doing the unlock, to avoid this
problem.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: f1d13ca ("mm/damon/sysfs: implement DAMOS tried regions update command")
Signed-off-by: SeongJae Park <[email protected]>
Cc: <[email protected]> [6.2.x]
Signed-off-by: Andrew Morton <[email protected]>1 parent c5155d4 commit 76b7069
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1208 | 1208 | | |
1209 | 1209 | | |
1210 | 1210 | | |
| 1211 | + | |
| 1212 | + | |
1211 | 1213 | | |
1212 | 1214 | | |
1213 | 1215 | | |
| |||
1219 | 1221 | | |
1220 | 1222 | | |
1221 | 1223 | | |
1222 | | - | |
| 1224 | + | |
| 1225 | + | |
1223 | 1226 | | |
| 1227 | + | |
1224 | 1228 | | |
1225 | 1229 | | |
1226 | 1230 | | |
| |||
1340 | 1344 | | |
1341 | 1345 | | |
1342 | 1346 | | |
1343 | | - | |
1344 | 1347 | | |
1345 | 1348 | | |
1346 | 1349 | | |
| |||
0 commit comments