* [PATCH] selftests: gpio: gpio-aggregator: add a test case for _sysfs prefix reservation
@ 2025-04-12 15:01 Koichiro Den
2025-04-14 20:30 ` Bartosz Golaszewski
0 siblings, 1 reply; 2+ messages in thread
From: Koichiro Den @ 2025-04-12 15:01 UTC (permalink / raw)
To: linux-gpio; +Cc: brgl, geert+renesas, linus.walleij, linux-kernel
The kernel doc for gpio-aggregator configfs interface, which was recently
added, states that users should not be able to create an aggregator with a
name prefixed by "_sysfs" via configfs. However, it was found that this
guard does not function as expected (thanks to Dan Carpenter for
identifying and fixing the issue).
Add a test case to verify the guard.
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
---
tools/testing/selftests/gpio/gpio-aggregator.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/testing/selftests/gpio/gpio-aggregator.sh b/tools/testing/selftests/gpio/gpio-aggregator.sh
index f1bab62c4cd2..9b6f80ad9f8a 100755
--- a/tools/testing/selftests/gpio/gpio-aggregator.sh
+++ b/tools/testing/selftests/gpio/gpio-aggregator.sh
@@ -335,6 +335,10 @@ test "$(cat "$CONFIGFS_AGG_DIR/agg0/live")" = 0 || \
agg_remove_line agg0 line0
agg_remove_chip agg0
+echo "1.1.6. Can't instantiate a chip with _sysfs prefix"
+mkdir "$CONFIGFS_AGG_DIR/_sysfs" 2> /dev/null && fail "chip _sysfs unexpectedly created"
+mkdir "$CONFIGFS_AGG_DIR/_sysfs.foo" 2> /dev/null && fail "chip _sysfs.foo unexpectedly created"
+
echo "1.2. Creation/deletion via sysfs"
echo "1.2.1. Minimum creation/deletion"
--
2.45.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] selftests: gpio: gpio-aggregator: add a test case for _sysfs prefix reservation
2025-04-12 15:01 [PATCH] selftests: gpio: gpio-aggregator: add a test case for _sysfs prefix reservation Koichiro Den
@ 2025-04-14 20:30 ` Bartosz Golaszewski
0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2025-04-14 20:30 UTC (permalink / raw)
To: linux-gpio, Koichiro Den
Cc: Bartosz Golaszewski, geert+renesas, linus.walleij, linux-kernel
On Sun, 13 Apr 2025 00:01:19 +0900, Koichiro Den wrote:
> The kernel doc for gpio-aggregator configfs interface, which was recently
> added, states that users should not be able to create an aggregator with a
> name prefixed by "_sysfs" via configfs. However, it was found that this
> guard does not function as expected (thanks to Dan Carpenter for
> identifying and fixing the issue).
>
> Add a test case to verify the guard.
>
> [...]
Applied, thanks!
[1/1] selftests: gpio: gpio-aggregator: add a test case for _sysfs prefix reservation
https://git.kernel.org/brgl/linux/c/290ffcfe3042dcd5b701a98edd48d7962d35556b
Best regards,
--
Bartosz Golaszewski <brgl@bgdev.pl>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-14 20:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-12 15:01 [PATCH] selftests: gpio: gpio-aggregator: add a test case for _sysfs prefix reservation Koichiro Den
2025-04-14 20:30 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®