[PATCH] md/bitmap:If bmap() failed,free buffers must check bitmap->pending_writes == 0.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: majianpeng <majianpeng@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux