From 57378027e1b9e1fee579ac32e02df9182c3d29ee Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 23 Jun 2017 00:29:48 -0400 Subject: [PATCH] add patch return-eio-on-read-error-in-ext4_find_dentry --- return-eio-on-read-error-in-ext4_find_dentry | 35 ++++++++++++++++++++++++++++ series | 1 + timestamps | 5 ++-- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 return-eio-on-read-error-in-ext4_find_dentry diff --git a/return-eio-on-read-error-in-ext4_find_dentry b/return-eio-on-read-error-in-ext4_find_dentry new file mode 100644 index 00000000..88437d93 --- /dev/null +++ b/return-eio-on-read-error-in-ext4_find_dentry @@ -0,0 +1,35 @@ +ext4: return EIO on read error in ext4_find_entry + +From: Khazhismel Kumykov + +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 +--- + fs/ext4/namei.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c +index 404256caf9cf..6fa17e9f7b6d 100644 +--- a/fs/ext4/namei.c ++++ b/fs/ext4/namei.c +@@ -1428,11 +1428,11 @@ static struct buffer_head * ext4_find_entry (struct inode *dir, + 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, +-- +2.13.1.611.g7e3b11ae1-goog + + diff --git a/series b/series index e9f3c948..b169a2b8 100644 --- a/series +++ b/series @@ -38,6 +38,7 @@ add-nombcache-mount-option avoid-unnecesary-stalls-in-ext4_evict_inode change-sequential-discard-handling forbid-encrypting-root-directory +return-eio-on-read-error-in-ext4_find_dentry #################################################### # unstable patches diff --git a/timestamps b/timestamps index 4f6f7c59..b43bbcc4 100755 --- a/timestamps +++ b/timestamps @@ -69,6 +69,7 @@ touch -d @1498146974 stable-boundary touch -d @1498189786 avoid-unnecesary-stalls-in-ext4_evict_inode touch -d @1498190073 change-sequential-discard-handling touch -d @1498191036 forbid-encrypting-root-directory -touch -d @1498191946 series -touch -d @1498191953 status touch -d @1498191960 timestamps +touch -d @1498192145 return-eio-on-read-error-in-ext4_find_dentry +touch -d @1498192169 series +touch -d @1498192174 status -- 2.11.4.GIT