mm/damon/dbgfs: fix missed use of damon_dbgfs_lock
authorSeongJae Park <sj@kernel.org>
Sat, 20 Nov 2021 00:43:52 +0000 (16:43 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:48:43 +0000 (09:48 +0100)
commit1e0d346be1cc1f987ce63ecfd1a27593408f6b61
tree4da8dfd33abd246a92e29a166bf5137c123a3cc3
parentcda10b34ecfb27935f4a4dad0d0cb1f6405747b4
mm/damon/dbgfs: fix missed use of damon_dbgfs_lock

commit d78f3853f831eee46c6dbe726debf3be9e9c0d05 upstream.

DAMON debugfs is supposed to protect dbgfs_ctxs, dbgfs_nr_ctxs, and
dbgfs_dirs using damon_dbgfs_lock.  However, some of the code is
accessing the variables without the protection.  This fixes it by
protecting all such accesses.

Link: https://lkml.kernel.org/r/20211110145758.16558-3-sj@kernel.org
Fixes: 75c1c2b53c78 ("mm/damon/dbgfs: support multiple contexts")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/damon/dbgfs.c