diff options
author | Khazhismel Kumykov <khazhy@google.com> | 2017-06-23 00:29:05 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2017-06-23 00:29:05 -0400 |
commit | 6febe6f253a5bb5c7ac2080d688bd4b75e019d4d (patch) | |
tree | f684f8158e8451b55c4007f30a6b4023d04281dd | |
parent | 9ce0151a47f6fa8e4b3b35785aac0d51adbb06ca (diff) |
ext4: return EIO on read error in ext4_find_entry
Previously, a read error would be ignored and we would eventually return
NULL from ext4_find_entry, which signals "no such file or directory". We
should be returning EIO.
Signed-off-by: Khazhismel Kumykov <khazhy@google.com>
-rw-r--r-- | fs/ext4/namei.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 423e1f761768..2a7f2dc7f4dd 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -1442,11 +1442,11 @@ restart: | |||
1442 | goto next; | 1442 | goto next; |
1443 | wait_on_buffer(bh); | 1443 | wait_on_buffer(bh); |
1444 | if (!buffer_uptodate(bh)) { | 1444 | if (!buffer_uptodate(bh)) { |
1445 | /* read error, skip block & hope for the best */ | ||
1446 | EXT4_ERROR_INODE(dir, "reading directory lblock %lu", | 1445 | EXT4_ERROR_INODE(dir, "reading directory lblock %lu", |
1447 | (unsigned long) block); | 1446 | (unsigned long) block); |
1448 | brelse(bh); | 1447 | brelse(bh); |
1449 | goto next; | 1448 | ret = ERR_PTR(-EIO); |
1449 | goto cleanup_and_exit; | ||
1450 | } | 1450 | } |
1451 | if (!buffer_verified(bh) && | 1451 | if (!buffer_verified(bh) && |
1452 | !is_dx_internal_node(dir, block, | 1452 | !is_dx_internal_node(dir, block, |