From: Yongqiang Yang <xiaoqiangnk@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, Yongqiang Yang <xiaoqiangnk@gmail.com>
Subject: [PATCH v2] ext4:Let ext4_ext_fiemap_cb() handle blocks before request range correctly.
Date: Tue, 10 May 2011 22:06:06 +0800 [thread overview]
Message-ID: <1305036366-1228-1-git-send-email-xiaoqiangnk@gmail.com> (raw)
v1->v2:
Add more specific description.
To get delayed-extent information, ext4_ext_fiemap_cb() lookups pagecache,
it thus collects information starting from a page's head block.
If blockszie < pagesize, the beginning blocks of a page may lie before the
range. ext4_ext_fiemap_cb() should proceed ignoring them, because they
has been handled before.
Reported-by: Amir Goldstein <amir73il@users.sf.net>
Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
---
fs/ext4/extents.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index e363f21..ec37109 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3718,9 +3718,14 @@ out:
bh = head;
do {
+ if (end < newex->ec_block)
+ /* The buffer is not in
+ * the request range.
+ */
+ continue;
if (buffer_mapped(bh)) {
/* get the 1st mapped buffer. */
- if (end > newex->ec_block +
+ if (end >= newex->ec_block +
newex->ec_len)
/* The buffer is out of
* the request range.
--
1.7.5.1
next reply other threads:[~2011-05-10 14:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-10 14:06 Yongqiang Yang [this message]
2011-05-10 14:35 ` [PATCH v2] ext4:Let ext4_ext_fiemap_cb() handle blocks before request range correctly Lukas Czerner
2011-05-10 15:08 ` Yongqiang Yang
2011-05-13 3:40 ` Yongqiang Yang
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=1305036366-1228-1-git-send-email-xiaoqiangnk@gmail.com \
--to=xiaoqiangnk@gmail.com \
--cc=linux-ext4@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