diff options
| author | Yu Kuai <yukuai3@huawei.com> | 2025-05-06 09:17:56 +0300 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-05-06 16:42:27 +0300 |
| commit | a26a339a654b9403f0ee1004f1db4c2b2a355460 (patch) | |
| tree | fe09926582ec0131a01a30ab1f1ab209e00983c8 /tools/perf/scripts/python | |
| parent | d4099f8893b057ad7e8d61df76bdeaf807ebd679 (diff) | |
| download | linux-a26a339a654b9403f0ee1004f1db4c2b2a355460.tar.xz | |
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 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
