[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200226083217.5720-1-zbestahu@gmail.com>
Date: Wed, 26 Feb 2020 16:32:17 +0800
From: Yue Hu <zbestahu@...il.com>
To: minchan@...nel.org, ngupta@...are.org,
sergey.senozhatsky.work@...il.com, axboe@...nel.dk
Cc: linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
huyue2@...ong.com, zbestahu@....com
Subject: [PATCH] drivers/block/zram/zram_drv.c: remove WARN_ON_ONCE() in free_block_bdev()
From: Yue Hu <huyue2@...ong.com>
Currently, free_block_bdev() only happens after calling 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@...ong.com>
---
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
Powered by blists - more mailing lists