summaryrefslogtreecommitdiffstats
path: root/fs/ext4/dir.c
diff options
context:
space:
mode:
authorMike Marshall <hubcap@omnibond.com>2016-03-14 15:39:42 -0400
committerMike Marshall <hubcap@omnibond.com>2016-03-14 15:39:42 -0400
commitab6652524aaf834d5dcdb46dd7695813b8d63da5 (patch)
treebb3876a9b61254be902416f7dbf578deb28e9f22 /fs/ext4/dir.c
parentacfcbaf1925f2dc5c46c61de69d756dec92a2ff8 (diff)
parentb562e44f507e863c6792946e4e1b1449fbbac85d (diff)
downloadlinux-ab6652524aaf834d5dcdb46dd7695813b8d63da5.tar.bz2
Orangefs: merge to v4.5
Merge tag 'v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into current Linux 4.5
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) {