Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH] dm cache: fix divide error in too_many_discard_blocks()
@ 2026-11-06 18:10 Drif Abdelmalek Mohamed Said
  2026-11-06 18:10 ` syzbot
  2026-11-06 18:10 ` syzbot
  0 siblings, 2 replies; 3+ messages in thread
From: Drif Abdelmalek Mohamed Said @ 2026-11-06 18:10 UTC (permalink / raw)
  To: syzbot+3e16980543e238b95bd1
  Cc: syzbot+7ff3adde89dd795ad4c4, kmsan-dev, glider, dvyukov, jack,
	linux-fsdevel, linux-kernel, Drif Abdelmalek Mohamed Said

#syz test

diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index 1a5072425c4a..2d40d6047ef1 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -2383,9 +2383,7 @@ static int create_cache_policy(struct cache *cache, struct cache_args *ca,
 static bool too_many_discard_blocks(sector_t discard_block_size,
 				    sector_t origin_size)
 {
-	(void) sector_div(origin_size, discard_block_size);
-
-	return origin_size > MAX_DISCARD_BLOCKS;
+	return div64_u64(origin_size, discard_block_size) > MAX_DISCARD_BLOCKS;
 }
 
 static sector_t calculate_discard_block_size(sector_t cache_block_size,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-06 18:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-06 18:10 [PATCH] dm cache: fix divide error in too_many_discard_blocks() Drif Abdelmalek Mohamed Said
2026-11-06 18:10 ` syzbot
2026-11-06 18:10 ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox