mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-22 17:52:09 +00:00
There was a bug[1] that triggered by writing non-context DAMON debugfs file names to the 'rm_contexts' DAMON debugfs file. Add a selftest for the bug to avoid it happen again. [1] https://lore.kernel.org/damon/000000000000ede3ac05ec4abf8e@google.com/ Link: https://lkml.kernel.org/r/20221107165001.5717-3-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
20 lines
324 B
Bash
20 lines
324 B
Bash
#!/bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
source _debugfs_common.sh
|
|
|
|
# Test putting non-ctx files/dirs to rm_contexts file
|
|
# ===================================================
|
|
|
|
dmesg -C
|
|
|
|
for file in "$DBGFS/"*
|
|
do
|
|
echo "$(basename "$f")" > "$DBGFS/rm_contexts"
|
|
if dmesg | grep -q BUG
|
|
then
|
|
dmesg
|
|
exit 1
|
|
fi
|
|
done
|