All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] md/bitmap:If bmap() failed,free buffers must check bitmap->pending_writes == 0.
@ 2012-05-18 11:38 majianpeng
  2012-05-21  0:06 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: majianpeng @ 2012-05-18 11:38 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] md/bitmap:If bmap() failed,free buffers must check bitmap->pending_writes == 0.
  2012-05-18 11:38 [PATCH] md/bitmap:If bmap() failed,free buffers must check bitmap->pending_writes == 0 majianpeng
@ 2012-05-21  0:06 ` NeilBrown
  0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2012-05-21  0:06 UTC (permalink / raw)
  To: majianpeng; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]

On Fri, 18 May 2012 19:38:34 +0800 "majianpeng" <majianpeng@gmail.com> wrote:

> 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;

Hi,
 thanks for the patch.

However it doesn't apply against the current code in linux-next.
Some changes have been made which might make this fix unnecessary as the page
is not freed until later.
Could you check the latest code and see if the problem still exists?

Thanks,
NeilBrown


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-21  0:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-18 11:38 [PATCH] md/bitmap:If bmap() failed,free buffers must check bitmap->pending_writes == 0 majianpeng
2012-05-21  0:06 ` NeilBrown

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.