From: "majianpeng" <majianpeng@gmail.com>
To: Neil Brown <neilb@suse.de>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: [PATCH] md/bitmap:If bmap() failed,free buffers must check bitmap->pending_writes == 0.
Date: Fri, 18 May 2012 19:38:34 +0800 [thread overview]
Message-ID: <201205181938310931047@gmail.com> (raw)
Signed-off-by: majianpeng <majianpeng@gmail.com>
---
drivers/md/bitmap.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 17e2b47..74540d7 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -376,6 +376,8 @@ static struct page *read_page(struct file *file, unsigned long index,
bh->b_blocknr = bmap(inode, block);
if (bh->b_blocknr == 0) {
/* Cannot use this file! */
+ wait_event(bitmap->write_wait,
+ atomic_read(&bitmap->pending_writes) == 0);
free_buffers(page);
page = ERR_PTR(-EINVAL);
goto out;
--
1.7.5.4
--------------
majianpeng
2012-05-18
next reply other threads:[~2012-05-18 11:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-18 11:38 majianpeng [this message]
2012-05-21 0:06 ` [PATCH] md/bitmap:If bmap() failed,free buffers must check bitmap->pending_writes == 0 NeilBrown
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=201205181938310931047@gmail.com \
--to=majianpeng@gmail.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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).