Skip to content

Commit

Permalink
Merge tag 'block-5.10-2020-12-05' of git://git.kernel.dk/linux-block
Browse files Browse the repository at this point in the history
Pull block fix from Jens Axboe:
 "Single fix for an issue with chunk_sectors and stacked devices"

* tag 'block-5.10-2020-12-05' of git://git.kernel.dk/linux-block:
  block: use gcd() to fix chunk_sectors limit stacking
  • Loading branch information
torvalds committed Dec 5, 2020
2 parents 619ca26 + 7e7986f commit be1515b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion block/blk-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,10 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,

t->io_min = max(t->io_min, b->io_min);
t->io_opt = lcm_not_zero(t->io_opt, b->io_opt);
t->chunk_sectors = lcm_not_zero(t->chunk_sectors, b->chunk_sectors);

/* Set non-power-of-2 compatible chunk_sectors boundary */
if (b->chunk_sectors)
t->chunk_sectors = gcd(t->chunk_sectors, b->chunk_sectors);

/* Physical block size a multiple of the logical block size? */
if (t->physical_block_size & (t->logical_block_size - 1)) {
Expand Down

0 comments on commit be1515b

Please sign in to comment.