Skip to content

Commit

Permalink
fscrypt: don't check for ENOKEY from fscrypt_get_encryption_info()
Browse files Browse the repository at this point in the history
fscrypt_get_encryption_info() returns 0 if the encryption key is
unavailable; it never returns ENOKEY.  So remove checks for ENOKEY.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Eric Biggers <[email protected]>
  • Loading branch information
ebiggers committed Dec 31, 2019
1 parent b7e8d3d commit 3b1ada5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fs/ext4/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)

if (IS_ENCRYPTED(inode)) {
err = fscrypt_get_encryption_info(inode);
if (err && err != -ENOKEY)
if (err)
return err;
}

Expand Down
2 changes: 1 addition & 1 deletion fs/f2fs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ static int f2fs_readdir(struct file *file, struct dir_context *ctx)

if (IS_ENCRYPTED(inode)) {
err = fscrypt_get_encryption_info(inode);
if (err && err != -ENOKEY)
if (err)
goto out;

err = fscrypt_fname_alloc_buffer(inode, F2FS_NAME_LEN, &fstr);
Expand Down
2 changes: 1 addition & 1 deletion fs/ubifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx)

if (encrypted) {
err = fscrypt_get_encryption_info(dir);
if (err && err != -ENOKEY)
if (err)
return err;

err = fscrypt_fname_alloc_buffer(dir, UBIFS_MAX_NLEN, &fstr);
Expand Down

0 comments on commit 3b1ada5

Please sign in to comment.