summaryrefslogtreecommitdiff
path: root/fs/ext4/dir.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-03-10 09:29:25 +0700
committerLinus Walleij <linus.walleij@linaro.org>2016-03-10 09:29:25 +0700
commitcc998d8bc74341f6bbbcd63ab4449a6acfc45ee9 (patch)
tree2f4e23fa1ceb83b3e720afd52d9a5ef2be26c77e /fs/ext4/dir.c
parentd2d13ed01362ecddc3f76f9cca31b0cd5d663a7e (diff)
parent81f70ba233d5f660e1ea5fe23260ee323af5d53a (diff)
Merge tag 'v4.5-rc5' into devel
Linux 4.5-rc5
Diffstat (limited to 'fs/ext4/dir.c')
-rw-r--r--fs/ext4/dir.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index 1d1bca74f844..33f5e2a50cf8 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -111,6 +111,12 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)
int dir_has_error = 0;
struct ext4_str fname_crypto_str = {.name = NULL, .len = 0};
+ if (ext4_encrypted_inode(inode)) {
+ err = ext4_get_encryption_info(inode);
+ if (err && err != -ENOKEY)
+ return err;
+ }
+
if (is_dx_dir(inode)) {
err = ext4_dx_readdir(file, ctx);
if (err != ERR_BAD_DX_DIR) {
@@ -157,8 +163,11 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)
index, 1);
file->f_ra.prev_pos = (loff_t)index << PAGE_CACHE_SHIFT;
bh = ext4_bread(NULL, inode, map.m_lblk, 0);
- if (IS_ERR(bh))
- return PTR_ERR(bh);
+ if (IS_ERR(bh)) {
+ err = PTR_ERR(bh);
+ bh = NULL;
+ goto errout;
+ }
}
if (!bh) {