1
0
Fork 0
remarkable-linux/fs/crypto
Eric Biggers d3d5e69b5e fscrypt: use ENOTDIR when setting encryption policy on nondirectory
[ Upstream commit dffd0cfa06 ]

As part of an effort to clean up fscrypt-related error codes, make
FS_IOC_SET_ENCRYPTION_POLICY fail with ENOTDIR when the file descriptor
does not refer to a directory.  This is more descriptive than EINVAL,
which was ambiguous with some of the other error cases.

I am not aware of any users who might be relying on the previous error
code of EINVAL, which was never documented anywhere, and in some buggy
kernels did not exist at all as the S_ISDIR() check was missing.

This failure case will be exercised by an xfstest.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-30 08:39:11 +00:00
..
Kconfig fs crypto: move per-file encryption from f2fs tree to fs/crypto 2016-03-17 21:19:33 -07:00
Makefile fs crypto: move per-file encryption from f2fs tree to fs/crypto 2016-03-17 21:19:33 -07:00
crypto.c fscrypt: lock mutex before checking for bounce page pool 2017-11-30 08:39:09 +00:00
fname.c fscrypt: use ENOKEY when file cannot be created w/o key 2017-11-30 08:39:11 +00:00
keyinfo.c fscrypt: fix dereference of NULL user_key_payload 2017-10-27 10:38:10 +02:00
policy.c fscrypt: use ENOTDIR when setting encryption policy on nondirectory 2017-11-30 08:39:11 +00:00