From: Praveen K Pandey <praveen@linux.vnet.ibm.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz, Praveen K Pandey <praveen@linux.vnet.ibm.com>
Subject: [PATCH] Btrfs-progs: run_next_block: Return error code when extent buffer read fails
Date: Mon, 24 Apr 2017 16:57:17 +0530 [thread overview]
Message-ID: <1493033237-12979-1-git-send-email-praveen@linux.vnet.ibm.com> (raw)
run_next_block() ignores the return value of read_tree_block() and
always returns success status. This might cause deal_root_from_list()
to loop infinitely when reading metadata block fails. This bug fixes
the issue by extracting and returning the error code from the return
value of read_tree_block().
Bug ID : https://bugzilla.kernel.org/show_bug.cgi?id=155551
Signed-off-by: Praveen K Pandey <praveen@linux.vnet.ibm.com>
---
cmds-check.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/cmds-check.c b/cmds-check.c
index 17b7efb..40e3c99 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -7625,6 +7625,7 @@ static int run_next_block(struct btrfs_root *root,
if (!extent_buffer_uptodate(buf)) {
record_bad_block_io(root->fs_info,
extent_cache, bytenr, size);
+ ret = PTR_ERR(buf);
goto out;
}
--
2.5.5
next reply other threads:[~2017-04-24 11:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 11:27 Praveen K Pandey [this message]
2017-05-02 17:14 ` [PATCH] Btrfs-progs: run_next_block: Return error code when extent buffer read fails David Sterba
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=1493033237-12979-1-git-send-email-praveen@linux.vnet.ibm.com \
--to=praveen@linux.vnet.ibm.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).