summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-03-15 23:54:32 +0300
committerRichard Weinberger <richard@nod.at>2019-05-07 22:36:39 +0300
commitc64cda8a99135c584a1c61074e225aacdf31060f (patch)
treea3f5f4f091dcaf0cb79f59f86e43ef3a8a7fa61e
parent37624b58542fb9f2d9a70e6ea006ef8a5f66c30b (diff)
downloadlinux-c64cda8a99135c584a1c61074e225aacdf31060f.tar.xz
ubifs: remove unnecessary calls to set up directory key
In ubifs_unlink() and ubifs_rmdir(), remove the call to fscrypt_get_encryption_info() that precedes fscrypt_setup_filename(). This call was unnecessary, because fscrypt_setup_filename() already tries to set up the directory's encryption key. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--fs/ubifs/dir.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index 5767b373a8ff..c3311ea68fe5 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -792,12 +792,6 @@ static int ubifs_unlink(struct inode *dir, struct dentry *dentry)
dentry, inode->i_ino,
inode->i_nlink, dir->i_ino);
- if (ubifs_crypt_is_encrypted(dir)) {
- err = fscrypt_get_encryption_info(dir);
- if (err && err != -ENOKEY)
- return err;
- }
-
err = fscrypt_setup_filename(dir, &dentry->d_name, 1, &nm);
if (err)
return err;
@@ -902,12 +896,6 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry)
if (err)
return err;
- if (ubifs_crypt_is_encrypted(dir)) {
- err = fscrypt_get_encryption_info(dir);
- if (err && err != -ENOKEY)
- return err;
- }
-
err = fscrypt_setup_filename(dir, &dentry->d_name, 1, &nm);
if (err)
return err;