Backport some fscrypt fixes from 4.10 and 4.11 to 4.9-stable. These will be needed for xfstest generic/395 to pass if https://lkml.kernel.org/fstests/20201031054018.695314-1-ebiggers@xxxxxxxxxx is applied. These are clean cherry picks. Tested with 'kvm-xfstests -c ext4,f2fs -g encrypt'. Eric Biggers (2): fscrypto: move ioctl processing more fully into common code fscrypt: use EEXIST when file already uses different policy fs/crypto/policy.c | 36 ++++++++++++++++++++++-------------- fs/ext4/ext4.h | 4 ++-- fs/ext4/ioctl.c | 34 +++++----------------------------- fs/f2fs/f2fs.h | 4 ++-- fs/f2fs/file.c | 19 ++----------------- include/linux/fscrypto.h | 12 ++++++------ 6 files changed, 39 insertions(+), 70 deletions(-) -- 2.29.1