ubifs: remove unnecessary calls to set up directory key
Subsystems (3)
Eric Biggers
maintainerPATCH 1/1 ubifs: remove unnecessary calls to set up directory key
From: Eric Biggers <[email protected]>
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.
--- fs/ubifs/dir.c | 12 ------------ 1 file changed, 12 deletions(-)
fs/ubifs/dir.c +0 -12
@@ -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;
Signature · 1 line
2.21.0.360.g471c308f928-goog
Quoted 33 lines · Eric Biggers
From: Eric Biggers <[email protected]>
In
ubifs_unlink()andubifs_rmdir(), remove the call tofscrypt_get_encryption_info()that precedesfscrypt_setup_filename(). This call was unnecessary, becausefscrypt_setup_filename()already tries to set up the directory's encryption key.Signed-off-by Eric Biggers <[email protected]>--- fs/ubifs/dir.c | 12 ------------ 1 file changed, 12 deletions(-)fs/ubifs/dir.c +0
-6@@ -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;
fs/ubifs/dir.c static int ubifs_rmdir(struct inode *dir, struct dentry *dentry) · line 901
Quoted 10 lines
fs/ubifs/dir.c +0
-6-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;
Thanks for the cleanup, Eric!
Signature · 2 lines
Thanks, //richard
Eric Biggers
maintainerQuoted 35 lines · Richard Weinberger
Quoted 34 lines · Eric Biggers
From: Eric Biggers <[email protected]>
In
ubifs_unlink()andubifs_rmdir(), remove the call tofscrypt_get_encryption_info()that precedesfscrypt_setup_filename(). This call was unnecessary, becausefscrypt_setup_filename()already tries to set up the directory's encryption key.Signed-off-by Eric Biggers <[email protected]>--- fs/ubifs/dir.c | 12 ------------ 1 file changed, 12 deletions(-)fs/ubifs/dir.c +0
-6@@ -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;
Quoted 15 lines
fs/ubifs/dir.c static int ubifs_unlink(struct inode *dir, struct dentry *dentry) · line 797
Quoted 9 lines
fs/ubifs/dir.c +0
-6-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;Thanks for the cleanup, Eric!
Signature · 2 lines
Thanks, //richard
Richard, can you take this through the ubifs tree for 5.2?
- Eric