Skip to content

selftests: add a new test driver for sysfs

Luis Chamberlain linux-block linux-kselftest lkml netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 8 repliesIn review
  2. v14 patches 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4selftests: add tests_sysfs moduleMAINTAINERS lib/Kconfig.debug lib/Makefile +4 more+2177 -04 replies
2/4kernfs: add initial failure injection supportDocumentation/fault-injection/fault-injection.rst MAINTAINERS fs/kernfs/Makefile +5 more+207 -10 replies
3/4test_sysfs: add support to use kernfs failure injectionlib/Kconfig.debug lib/test_sysfs.c tools/testing/selftests/sysfs/config +1 more+211 -00 replies
4/4test_sysfs: demonstrate deadlock fixlib/test_sysfs.c tools/testing/selftests/sysfs/sysfs.sh+64 -114 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] selftests: add a new test driver for sysfs

This v2 rebases onto the latest linux-next tag, next-20210701. A few changes were needed, namely:

1) changes kernfs_init_failure_injection() to return int instead of void. On the latest linux-next we have a new static build check for this, so this mistake was captured when building.

2) I made kernfs_init_failure_injection static

3) lib/test_sysfs.c moved to the new blk_alloc_disk() added by Christoph as direct queue allocation is no longer supported, ie, blk_alloc_queue() is no longer exported. This work was done by Christoph in preparation to help make add_disk*() callers eventually return an error code and make the error handling much saner. Because of this same change blk_cleanup_queue() is no longer needed so we embrace the shiny new blk_cleanup_disk().

I've put this up on my linux-next git tree [0] under the branch named 20210701-sysfs-fix-races-v2.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/log/?h=20210701-sysfs-fix-races-v2

Luis Chamberlain (4):
selftests: add tests_sysfs module
kernfs: add initial failure injection support
test_sysfs: add support to use kernfs failure injection
test_sysfs: demonstrate deadlock fix

 .../fault-injection/fault-injection.rst       |   22 +
 MAINTAINERS                                   |    9 +-
 fs/kernfs/Makefile                            |    1 +
 fs/kernfs/failure-injection.c                 |   83 +
 fs/kernfs/file.c                              |   13 +
 fs/kernfs/kernfs-internal.h                   |   72 +
 include/linux/kernfs.h                        |    5 +
 lib/Kconfig.debug                             |   23 +
 lib/Makefile                                  |    1 +
 lib/test_sysfs.c                              | 1027 ++++++++++++
 tools/testing/selftests/sysfs/Makefile        |   12 +
 tools/testing/selftests/sysfs/config          |    5 +
 tools/testing/selftests/sysfs/sysfs.sh        | 1376 +++++++++++++++++
 13 files changed, 2648 insertions(+), 1 deletion(-)
 create mode 100644 fs/kernfs/failure-injection.c
 create mode 100644 lib/test_sysfs.c
 create mode 100644 tools/testing/selftests/sysfs/Makefile
 create mode 100644 tools/testing/selftests/sysfs/config
 create mode 100755 tools/testing/selftests/sysfs/sysfs.sh
Signature · 1 line
2.27.0