summaryrefslogtreecommitdiff
path: root/fs/ubifs/dir.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2017-11-29 12:43:14 -0800
committerRichard Weinberger <richard@nod.at>2018-01-17 21:48:03 +0100
commit5653878c8ca417b2f7b283df0db0141bb3c185f7 (patch)
tree048be660c6ebd0f18025707b61d0f79440773d6e /fs/ubifs/dir.c
parent7e35c4dac3e7b02bbf1588af52edf155537e5b61 (diff)
downloadlwn-5653878c8ca417b2f7b283df0db0141bb3c185f7.tar.gz
lwn-5653878c8ca417b2f7b283df0db0141bb3c185f7.zip
ubifs: switch to fscrypt_prepare_link()
Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/dir.c')
-rw-r--r--fs/ubifs/dir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index 417fe0b29f23..09e6c56b11bc 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -743,9 +743,9 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir,
ubifs_assert(inode_is_locked(dir));
ubifs_assert(inode_is_locked(inode));
- if (ubifs_crypt_is_encrypted(dir) &&
- !fscrypt_has_permitted_context(dir, inode))
- return -EPERM;
+ err = fscrypt_prepare_link(old_dentry, dir, dentry);
+ if (err)
+ return err;
err = fscrypt_setup_filename(dir, &dentry->d_name, 0, &nm);
if (err)