]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
cachefiles: Add some error injection support
authorDavid Howells <dhowells@redhat.com>
Thu, 21 Oct 2021 07:15:26 +0000 (08:15 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 26 Nov 2021 16:22:52 +0000 (16:22 +0000)
commit1d1a87fb8c04f6dc9bbd1edb1f840a827bb0841a
tree2fc8354a55395a52b24aaaaf71fa428d1ddc5801
parent56066b5d0d5e4a84e88edaae80ddc9bd7e9820d1
cachefiles: Add some error injection support

Add support for injecting ENOSPC or EIO errors.  This needs to be enabled
by CONFIG_CACHEFILES_ERROR_INJECTION=y.  Once enabled, ENOSPC on things
like write and mkdir can be triggered by:

        echo 1 >/proc/sys/cachefiles/error_injection

and EIO can be triggered on most operations by:

        echo 2 >/proc/sys/cachefiles/error_injection

Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-cachefs@redhat.com
fs/cachefiles/Kconfig
fs/cachefiles/Makefile
fs/cachefiles/error_inject.c [new file with mode: 0644]
fs/cachefiles/internal.h
fs/cachefiles/main.c