add patch return-EFSBADCRC-on-csum-error-in-ext4_find_entry
[ext4-patch-queue.git] / return-eio-on-read-error-in-ext4_find_dentry
blob88437d93dc1c4334e7a1a28d2ab93bff53b798f1
1 ext4: return EIO on read error in ext4_find_entry
3 From: Khazhismel Kumykov <khazhy@google.com>
5 Previously, a read error would be ignored and we would eventually return
6 NULL from ext4_find_entry, which signals "no such file or directory". We
7 should be returning EIO.
9 Signed-off-by: Khazhismel Kumykov <khazhy@google.com>
10 ---
11  fs/ext4/namei.c | 4 ++--
12  1 file changed, 2 insertions(+), 2 deletions(-)
14 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
15 index 404256caf9cf..6fa17e9f7b6d 100644
16 --- a/fs/ext4/namei.c
17 +++ b/fs/ext4/namei.c
18 @@ -1428,11 +1428,11 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
19                         goto next;
20                 wait_on_buffer(bh);
21                 if (!buffer_uptodate(bh)) {
22 -                       /* read error, skip block & hope for the best */
23                         EXT4_ERROR_INODE(dir, "reading directory lblock %lu",
24                                          (unsigned long) block);
25                         brelse(bh);
26 -                       goto next;
27 +                       ret = ERR_PTR(-EIO);
28 +                       goto cleanup_and_exit;
29                 }
30                 if (!buffer_verified(bh) &&
31                     !is_dx_internal_node(dir, block,
32 -- 
33 2.13.1.611.g7e3b11ae1-goog