Commit 87623405 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-5.10/dm-fixes-2' of...

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()
parents b3298500 65f33b35
...@@ -1076,10 +1076,12 @@ static inline unsigned int blk_max_size_offset(struct request_queue *q, ...@@ -1076,10 +1076,12 @@ static inline unsigned int blk_max_size_offset(struct request_queue *q,
sector_t offset, sector_t offset,
unsigned int chunk_sectors) unsigned int chunk_sectors)
{ {
if (!chunk_sectors && q->limits.chunk_sectors) if (!chunk_sectors) {
chunk_sectors = q->limits.chunk_sectors; if (q->limits.chunk_sectors)
else chunk_sectors = q->limits.chunk_sectors;
return q->limits.max_sectors; else
return q->limits.max_sectors;
}
if (likely(is_power_of_2(chunk_sectors))) if (likely(is_power_of_2(chunk_sectors)))
chunk_sectors -= offset & (chunk_sectors - 1); chunk_sectors -= offset & (chunk_sectors - 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment