summaryrefslogtreecommitdiff
path: root/fs/ubifs/ioctl.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2016-10-20 00:24:47 +0300
committerRichard Weinberger <richard@nod.at>2016-12-13 01:07:38 +0300
commite021986ee4119e487febb9a5f077ec77dff85865 (patch)
treeafce15fde0bd515e82f2463c74fffbe63f54dd5d /fs/ubifs/ioctl.c
parentd63d61c16972c667d770f713c21aa04e2c0489d2 (diff)
downloadlinux-e021986ee4119e487febb9a5f077ec77dff85865.tar.xz
ubifs: Implement UBIFS_FLG_ENCRYPTION
This feature flag indicates that the filesystem contains encrypted files. Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/ioctl.c')
-rw-r--r--fs/ubifs/ioctl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c
index 6bb5b35050de..3d10f5525274 100644
--- a/fs/ubifs/ioctl.c
+++ b/fs/ubifs/ioctl.c
@@ -183,6 +183,7 @@ long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
}
case FS_IOC_SET_ENCRYPTION_POLICY: {
#ifdef CONFIG_UBIFS_FS_ENCRYPTION
+ struct ubifs_info *c = inode->i_sb->s_fs_info;
struct fscrypt_policy policy;
if (copy_from_user(&policy,
@@ -190,6 +191,10 @@ long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
sizeof(policy)))
return -EFAULT;
+ err = ubifs_enable_encryption(c);
+ if (err)
+ return err;
+
err = fscrypt_process_policy(file, &policy);
return err;