From e021986ee4119e487febb9a5f077ec77dff85865 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Wed, 19 Oct 2016 23:24:47 +0200 Subject: ubifs: Implement UBIFS_FLG_ENCRYPTION This feature flag indicates that the filesystem contains encrypted files. Signed-off-by: Richard Weinberger --- fs/ubifs/ioctl.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fs/ubifs/ioctl.c') 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; -- cgit 1.4.1