Fix incorrect branching at top of blk_max_size_offset().
-----BEGIN PGP SIGNATURE----- iQFHBAABCAAxFiEEJfWUX4UqZ4x1O2wixSPxCi2dA1oFAl/KwFgTHHNuaXR6ZXJA cmVkaGF0LmNvbQAKCRDFI/EKLZ0DWlN+CAC0H96QVQTS5+osg3FOaBMO/whp3Wgw AA/W8g/TyzW41CnuSRr/B90p+XOYdn7xyt3YjsI1KDUuwMzeMncVq/rLZBdJmsyk q1ra+zkz430W6oE3+xr7By50RGVHH1c1fbhpaS+Jb2xRYqPmjneHk/aHt7SH2DAX HhViT6GW0k7rg+NrwZCw9sjOC4/dSz63i0wQAuvM06DK4hLzY54CwV5cQwCnUzA8 ZK6N69cayP/6A0L6RyEKbH3E9YbT0lrD3+Q6VtSYVn/8Dcftx9McyFEckqEOWq0a 3XywXhFbc9L8WhM6XxmobxXlIg/HlhhY9MjHMGu76LthhpLe0YAp0Yyh =RnxG -----END PGP SIGNATURE----- Merge tag 'for-5.10/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull fix for device mapper fixes from Mike Snitzer: "Apologies for the glaring bug I introduced with my previous pull request! Fix incorrect branching at top of blk_max_size_offset()" * tag 'for-5.10/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: block: fix incorrect branching in blk_max_size_offset()
This commit is contained in:
commit
8762340561
@ -1076,10 +1076,12 @@ static inline unsigned int blk_max_size_offset(struct request_queue *q,
|
||||
sector_t offset,
|
||||
unsigned int chunk_sectors)
|
||||
{
|
||||
if (!chunk_sectors && q->limits.chunk_sectors)
|
||||
chunk_sectors = q->limits.chunk_sectors;
|
||||
else
|
||||
return q->limits.max_sectors;
|
||||
if (!chunk_sectors) {
|
||||
if (q->limits.chunk_sectors)
|
||||
chunk_sectors = q->limits.chunk_sectors;
|
||||
else
|
||||
return q->limits.max_sectors;
|
||||
}
|
||||
|
||||
if (likely(is_power_of_2(chunk_sectors)))
|
||||
chunk_sectors -= offset & (chunk_sectors - 1);
|
||||
|
Loading…
Reference in New Issue
Block a user