[PATCH RESEND] drivers/block/zram/zram_drv.c: remove WARN_ON_ONCE() in free_block_bdev()

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

 



From: Yue Hu <huyue2@xxxxxxxxxx>

Currently, free_block_bdev() only happens after alloc_block_bdev() which
will ensure blk_idx bit to be set using test_and_set_bit(). So no need to
do WARN_ON_ONCE(!was_set) again when freeing.

Signed-off-by: Yue Hu <huyue2@xxxxxxxxxx>
---
 drivers/block/zram/zram_drv.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 1bdb579..61b10ab 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -570,10 +570,7 @@ static unsigned long alloc_block_bdev(struct zram *zram)
 
 static void free_block_bdev(struct zram *zram, unsigned long blk_idx)
 {
-	int was_set;
-
-	was_set = test_and_clear_bit(blk_idx, zram->bitmap);
-	WARN_ON_ONCE(!was_set);
+	clear_bit(blk_idx, zram->bitmap);
 	atomic64_dec(&zram->stats.bd_count);
 }
 
-- 
1.9.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux