* [PATCH RESEND] drivers/block/zram/zram_drv.c: remove WARN_ON_ONCE() in free_block_bdev()
@ 2020-03-23 8:53 Yue Hu
0 siblings, 0 replies; only message in thread
From: Yue Hu @ 2020-03-23 8:53 UTC (permalink / raw)
To: minchan, ngupta, sergey.senozhatsky.work, axboe
Cc: huyue2, zbestahu, linux-kernel, linux-block
From: Yue Hu <huyue2@yulong.com>
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@yulong.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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-23 8:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23 8:53 [PATCH RESEND] drivers/block/zram/zram_drv.c: remove WARN_ON_ONCE() in free_block_bdev() Yue Hu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).