From: Guoqing Jiang <gqjiang@suse.com>
To: shli@kernel.org
Cc: neilb@suse.de, linux-raid@vger.kernel.org,
Guoqing Jiang <gqjiang@suse.com>
Subject: [V2 PATCH 10/13] md-cluster/bitmap: fix wrong calcuation of offset
Date: Mon, 2 May 2016 11:50:13 -0400 [thread overview]
Message-ID: <1462204216-2269-3-git-send-email-gqjiang@suse.com> (raw)
In-Reply-To: <1462204216-2269-1-git-send-email-gqjiang@suse.com>
The offset is wrong in bitmap_storage_alloc, we should
set it like below in bitmap_init_from_disk().
node_offset = bitmap->cluster_slot * (DIV_ROUND_UP(store->bytes, PAGE_SIZE));
Because 'offset' is only assigned to 'page->index' and
that is usually over-written by read_sb_page. So it does
not cause problem in general, but it still need to be fixed.
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
---
drivers/md/bitmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index ac93d87..cf93bb8 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -759,7 +759,7 @@ static int bitmap_storage_alloc(struct bitmap_storage *store,
bytes += sizeof(bitmap_super_t);
num_pages = DIV_ROUND_UP(bytes, PAGE_SIZE);
- offset = slot_number * (num_pages - 1);
+ offset = slot_number * num_pages;
store->filemap = kmalloc(sizeof(struct page *)
* num_pages, GFP_KERNEL);
--
2.6.6
next prev parent reply other threads:[~2016-05-02 15:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-02 15:33 [V2 PATCH 00/13] The latest patches for md-cluster Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 01/13] md-cluster: change resync lock from asynchronous to synchronous Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 02/13] md-cluser: make resync_finish only called after pers->sync_request Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 03/13] md-cluster: wake up thread to continue recovery Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 04/13] md-cluster: unregister thread if err happened Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 05/13] md-cluster: fix locking when node joins cluster during message broadcast Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 06/13] md-cluster: change array_sectors and update size are not supported Guoqing Jiang
2016-05-02 15:33 ` [V2 PATCH 07/13] md-cluster: wakeup thread if activated a spare disk Guoqing Jiang
2016-05-02 15:50 ` [V2 PATCH 08/13] md-cluster: always setup in-memory bitmap Guoqing Jiang
2016-05-02 15:50 ` [V2 PATCH 09/13] md-cluster: sync bitmap when node received RESYNCING msg Guoqing Jiang
2016-05-02 15:50 ` Guoqing Jiang [this message]
2016-05-02 15:50 ` [V2 PATCH 11/13] md-cluster/bitmap: fix wrong page num in bitmap_file_clear_bit and bitmap_file_set_bit Guoqing Jiang
2016-05-02 15:50 ` [V2 PATCH 12/13] md-cluster/bitmap: unplug bitmap to sync dirty pages to disk Guoqing Jiang
2016-05-02 15:50 ` [V2 PATCH 13/13] md-cluster: fix ifnullfree.cocci warnings Guoqing Jiang
2016-05-02 17:49 ` [V2 PATCH 00/13] The latest patches for md-cluster Shaohua Li
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=1462204216-2269-3-git-send-email-gqjiang@suse.com \
--to=gqjiang@suse.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
--cc=shli@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).