md/bitmap:If bmap() failed,free buffers must check bitmap->pending_writes == 0.
PATCH 1/1 md/bitmap:If bmap() failed,free buffers must check bitmap->pending_writes == 0.
Signed-off-by majianpeng <[email protected]>
--- drivers/md/bitmap.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/md/bitmap.c +2 -0
@@ -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;
Signature · 6 lines
1.7.5.4 -------------- majianpeng 2012-05-18
Quoted 10 lines · On Fri, 18 May 2012 19:38:34 +0800 "majianpeng" <[email protected]> wrote:
Signed-off-by majianpeng <[email protected]>--- drivers/md/bitmap.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)drivers/md/bitmap.c +0
-0
drivers/md/bitmap.c static struct page *read_page(struct file *file, unsigned long index, · line 383
Quoted 8 lines
drivers/md/bitmap.c +2
-0@@ -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