From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 1/2] btrfs: convert: Make read_disk_extent() return more meaningful -EIO other -1
Date: Fri, 14 Sep 2018 15:25:04 +0800 [thread overview]
Message-ID: <20180914072505.15916-2-wqu@suse.com> (raw)
In-Reply-To: <20180914072505.15916-1-wqu@suse.com>
When pread64() returns value smaller than expected, it normally means
EIO, so just return -EIO to replace the intermediate number.
So when IO fails, we should be able to get more meaningful error number
of than EPERM.
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
convert/source-fs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/convert/source-fs.c b/convert/source-fs.c
index b6d08370428a..5660a22cc652 100644
--- a/convert/source-fs.c
+++ b/convert/source-fs.c
@@ -201,7 +201,7 @@ int read_disk_extent(struct btrfs_root *root, u64 bytenr,
ret = 0;
fail:
if (ret > 0)
- ret = -1;
+ ret = -EIO;
return ret;
}
--
2.19.0
next prev parent reply other threads:[~2018-09-14 12:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-14 7:25 [PATCH 0/2] Enhanced error messages for btrfs-convert Qu Wenruo
2018-09-14 7:25 ` Qu Wenruo [this message]
2018-09-14 7:30 ` [PATCH 1/2] btrfs: convert: Make read_disk_extent() return more meaningful -EIO other -1 Nikolay Borisov
2018-09-14 7:25 ` [PATCH 2/2] btrfs-progs: convert: Output meaningful error messages for create_image() Qu Wenruo
2018-09-14 7:36 ` Nikolay Borisov
2018-10-24 15:14 ` [PATCH 0/2] Enhanced error messages for btrfs-convert 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=20180914072505.15916-2-wqu@suse.com \
--to=wqu@suse.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.