generic: test fscrypt key eviction racing with inode dirtying
authorEric Biggers <ebiggers@google.com>
Mon, 23 Mar 2020 16:40:34 +0000 (09:40 -0700)
committerEryu Guan <guaneryu@gmail.com>
Mon, 6 Apr 2020 12:42:26 +0000 (20:42 +0800)
commit0afa39e891239f54cf0ac535c1465c1c9fabb8da
treeb7f70660797be88e98f7464f51b9a7f7653b1b14
parentb6093d0eed59739ad952af1d22320660264e1aad
generic: test fscrypt key eviction racing with inode dirtying

Add a regression test for a bug in the FS_IOC_REMOVE_ENCRYPTION_KEY
ioctl fixed by commit 2b4eae95c736 ("fscrypt: don't evict dirty inodes
after removing key").

This ioctl is also tested by generic/580 and generic/581, but they
didn't cover the case where this bug occurs.

This test detects the bug on ext4, f2fs, and ubifs.  The multi-threaded
part of the test actually still fails on ubifs even with the fix, due to
another kernel bug which I'm working on fixing.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/595 [new file with mode: 0755]
tests/generic/595.out [new file with mode: 0644]
tests/generic/group