linux/drivers/block
Yu Kuai a26a339a65 brd: fix discard end sector
brd_do_discard() just aligned start sector to page, this can only work
if the discard size if at least one page. For example:

blkdiscard /dev/ram0 -o 5120 -l 1024

In this case, size = (1024 - (8192 - 5120)), which is a huge value.

Fix the problem by round_down() the end sector.

Fixes: 9ead7efc6f ("brd: implement discard support")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250506061756.2970934-4-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-05-06 07:42:27 -06:00
..
aoe treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
drbd CRC cleanups for 6.15 2025-04-08 12:09:28 -07:00
mtip32xx block: remove unused parameter 'q' parameter in __blk_rq_map_sg() 2025-03-13 05:46:19 -06:00
null_blk null_blk: Use strscpy() instead of strscpy_pad() in null_add_dev() 2025-04-11 07:10:46 -06:00
rnbd block: remove unused parameter 'q' parameter in __blk_rq_map_sg() 2025-03-13 05:46:19 -06:00
xen-blkback xen/blkback: convert timeouts to secs_to_jiffies() 2025-01-12 20:21:03 -08:00
zram zram: add might_sleep to zcomp API 2025-03-16 22:06:37 -07:00
amiflop.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
ataflop.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
brd.c brd: fix discard end sector 2025-05-06 07:42:27 -06:00
floppy.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
Kconfig Documentation: Document the new zoned loop block device driver 2025-05-01 17:03:56 -06:00
loop.c loop: stop using vfs_iter_{read,write} for buffered I/O 2025-04-15 18:59:15 -06:00
Makefile block: new zoned loop block device driver 2025-05-01 17:03:56 -06:00
n64cart.c block: move the nonrot flag to queue_limits 2024-06-19 07:58:28 -06:00
nbd.c block: force noio scope in blk_mq_freeze_queue 2025-01-31 07:20:08 -07:00
pktcdvd.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ps3disk.c ps3disk: Do not use dev->bounce_size before it is set 2025-01-03 11:44:25 -07:00
ps3vram.c block: pass a queue_limits argument to blk_alloc_disk 2024-02-19 16:58:23 -07:00
rbd_types.h
rbd.c block: force noio scope in blk_mq_freeze_queue 2025-01-31 07:20:08 -07:00
rnull.rs rust: module: introduce authors key 2025-03-10 15:12:17 +01:00
sunvdc.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
swim_asm.S
swim.c block: remove BLK_MQ_F_SHOULD_MERGE 2024-12-23 08:17:23 -07:00
swim3.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
ublk_drv.c ublk: consolidate UBLK_IO_FLAG_OWNED_BY_SRV checks 2025-05-06 07:40:18 -06:00
virtio_blk.c for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
xen-blkfront.c block: remove unused parameter 'q' parameter in __blk_rq_map_sg() 2025-03-13 05:46:19 -06:00
z2ram.c block: remove BLK_MQ_F_SHOULD_MERGE 2024-12-23 08:17:23 -07:00
zloop.c block: new zoned loop block device driver 2025-05-01 17:03:56 -06:00