Browse Source

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>
Khazhismel Kumykov 8 years ago
parent
commit
6febe6f253
1 changed files with 2 additions and 2 deletions
  1. 2 2
      fs/ext4/namei.c

+ 2 - 2
fs/ext4/namei.c

@@ -1442,11 +1442,11 @@ restart:
 			goto next;
 		wait_on_buffer(bh);
 		if (!buffer_uptodate(bh)) {
-			/* read error, skip block & hope for the best */
 			EXT4_ERROR_INODE(dir, "reading directory lblock %lu",
 					 (unsigned long) block);
 			brelse(bh);
-			goto next;
+			ret = ERR_PTR(-EIO);
+			goto cleanup_and_exit;
 		}
 		if (!buffer_verified(bh) &&
 		    !is_dx_internal_node(dir, block,