summaryrefslogtreecommitdiffstats
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-12-17 12:14:33 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-12-17 12:14:33 -0800
commit1c6b942d7d39765a81ea0577c893edaddfccad3d (patch)
treebab0b0032f963b838e4d0ccf5c078617ceafed2f /fs/ext4/namei.c
parentf3b5ad89de16f5d42e8ad36fbdf85f705c1ae051 (diff)
parent9d5afec6b8bd46d6ed821aa1579634437f58ef1f (diff)
downloadlinux-stable-1c6b942d7d39765a81ea0577c893edaddfccad3d.tar.gz
linux-stable-1c6b942d7d39765a81ea0577c893edaddfccad3d.tar.bz2
linux-stable-1c6b942d7d39765a81ea0577c893edaddfccad3d.zip
Merge tag 'ext4_for_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 fixes from Ted Ts'o: "Fix a regression which caused us to fail to interpret symlinks in very ancient ext3 file system images. Also fix two xfstests failures, one of which could cause an OOPS, plus an additional bug fix caught by fuzz testing" * tag 'ext4_for_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: fix crash when a directory's i_size is too small ext4: add missing error check in __ext4_new_inode() ext4: fix fdatasync(2) after fallocate(2) operation ext4: support fast symlinks from ext3 file systems
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r--fs/ext4/namei.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 798b3ac680db..e750d68fbcb5 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1399,6 +1399,10 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
"falling back\n"));
}
nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb);
+ if (!nblocks) {
+ ret = NULL;
+ goto cleanup_and_exit;
+ }
start = EXT4_I(dir)->i_dir_start_lookup;
if (start >= nblocks)
start = 0;