]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.154/ext4-reset-error-code-in-ext4_find_entry-in-fallback.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.154 / ext4-reset-error-code-in-ext4_find_entry-in-fallback.patch
CommitLineData
f15b2821
GKH
1From f39b3f45dbcb0343822cce31ea7636ad66e60bc2 Mon Sep 17 00:00:00 2001
2From: Eric Sandeen <sandeen@redhat.com>
3Date: Sun, 29 Jul 2018 17:13:42 -0400
4Subject: ext4: reset error code in ext4_find_entry in fallback
5
6From: Eric Sandeen <sandeen@redhat.com>
7
8commit f39b3f45dbcb0343822cce31ea7636ad66e60bc2 upstream.
9
10When ext4_find_entry() falls back to "searching the old fashioned
11way" due to a corrupt dx dir, it needs to reset the error code
12to NULL so that the nonstandard ERR_BAD_DX_DIR code isn't returned
13to userspace.
14
15https://bugzilla.kernel.org/show_bug.cgi?id=199947
16
17Reported-by: Anatoly Trosinenko <anatoly.trosinenko@yandex.com>
18Reviewed-by: Andreas Dilger <adilger@dilger.ca>
19Signed-off-by: Eric Sandeen <sandeen@redhat.com>
20Signed-off-by: Theodore Ts'o <tytso@mit.edu>
21Cc: stable@vger.kernel.org
22Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24---
25 fs/ext4/namei.c | 1 +
26 1 file changed, 1 insertion(+)
27
28--- a/fs/ext4/namei.c
29+++ b/fs/ext4/namei.c
30@@ -1401,6 +1401,7 @@ static struct buffer_head * ext4_find_en
31 goto cleanup_and_exit;
32 dxtrace(printk(KERN_DEBUG "ext4_find_entry: dx failed, "
33 "falling back\n"));
34+ ret = NULL;
35 }
36 nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb);
37 if (!nblocks) {