add patch improve-code-readability-in-ext4_iget
[ext4-patch-queue.git] / reset-error-code-in-ext4_find_entry-in-fallback
blobd65be2c476fd08e49d10c5d1e8708f01c9068673
1 ext4: reset error code in ext4_find_entry in fallback
3 From: Eric Sandeen <sandeen@redhat.com>
5 When ext4_find_entry() falls back to "searching the old fashioned
6 way" due to a corrupt dx dir, it needs to reset the error code
7 to NULL so that the nonstandard ERR_BAD_DX_DIR code isn't returned
8 to userspace.
10 https://bugzilla.kernel.org/show_bug.cgi?id=199947
12 Reported-by: Anatoly Trosinenko <anatoly.trosinenko@yandex.com>
13 Reviewed-by: Andreas Dilger <adilger@dilger.ca>
14 Signed-off-by: Eric Sandeen <sandeen@redhat.com>
15 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
16 Cc: stable@vger.kernel.org
17 ---
19 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
20 index b1f21e3a0763..559b2b9d392a 100644
21 --- a/fs/ext4/namei.c
22 +++ b/fs/ext4/namei.c
23 @@ -1398,6 +1400,7 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
24                         goto cleanup_and_exit;
25                 dxtrace(printk(KERN_DEBUG "ext4_find_entry: dx failed, "
26                                "falling back\n"));
27 +               ret = NULL;
28         }
29         nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb);
30         if (!nblocks) {