summaryrefslogtreecommitdiff
path: root/include/linux/backing-file.h
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2025-05-06 14:17:56 +0800
committerJens Axboe <axboe@kernel.dk>2025-05-06 07:42:27 -0600
commita26a339a654b9403f0ee1004f1db4c2b2a355460 (patch)
treefe09926582ec0131a01a30ab1f1ab209e00983c8 /include/linux/backing-file.h
parentd4099f8893b057ad7e8d61df76bdeaf807ebd679 (diff)
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: 9ead7efc6f3f ("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>
Diffstat (limited to 'include/linux/backing-file.h')
0 files changed, 0 insertions, 0 deletions