Skip to content

Commit

Permalink
ubifs: remove unnecessary calls to set up directory key
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Biggers authored and Richard Weinberger committed May 7, 2019
1 parent 37624b5 commit c64cda8
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions fs/ubifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c64cda8

Please sign in to comment.