From: Khazhismel Kumykov <khazhy@google.com>
To: tytso@mit.edu, adilger.kernel@dilger.ca,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Khazhismel Kumykov <khazhy@google.com>
Subject: [PATCH] ext4: Return EIO on read error in ext4_find_entry
Date: Thu, 22 Jun 2017 16:23:07 -0700 [thread overview]
Message-ID: <20170622232307.48392-1-khazhy@google.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 927 bytes --]
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>
---
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
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4843 bytes --]
next reply other threads:[~2017-06-22 23:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-22 23:23 Khazhismel Kumykov [this message]
2017-06-23 4:43 ` Theodore Ts'o
2017-06-23 6:33 ` Andreas Dilger
2017-06-23 12:26 ` Theodore Ts'o
2017-06-23 21:36 ` Andreas Dilger
2017-06-23 22:33 ` Khazhismel Kumykov
2017-06-23 23:26 ` Theodore Ts'o
2017-06-23 23:34 ` Andreas Dilger
2017-06-24 0:24 ` Theodore Ts'o
2017-06-26 19:22 ` Tahsin Erdogan
2017-06-26 20:45 ` Andreas Dilger
2017-06-27 21:58 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170622232307.48392-1-khazhy@google.com \
--to=khazhy@google.com \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome