Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block layer fix from Jens Axboe:
"Just one patch in this pull request, fixing a regression caused by a
'mathematically correct' change to lcm()"

* 'for-linus' of git://git.kernel.dk/linux-block:
block: fix blk_stack_limits() regression due to lcm() change

+15 -3
+3 -3
block/blk-settings.c
··· 585 585 b->physical_block_size); 586 586 587 587 t->io_min = max(t->io_min, b->io_min); 588 - t->io_opt = lcm(t->io_opt, b->io_opt); 588 + t->io_opt = lcm_not_zero(t->io_opt, b->io_opt); 589 589 590 590 t->cluster &= b->cluster; 591 591 t->discard_zeroes_data &= b->discard_zeroes_data; ··· 616 616 b->raid_partial_stripes_expensive); 617 617 618 618 /* Find lowest common alignment_offset */ 619 - t->alignment_offset = lcm(t->alignment_offset, alignment) 619 + t->alignment_offset = lcm_not_zero(t->alignment_offset, alignment) 620 620 % max(t->physical_block_size, t->io_min); 621 621 622 622 /* Verify that new alignment_offset is on a logical block boundary */ ··· 643 643 b->max_discard_sectors); 644 644 t->discard_granularity = max(t->discard_granularity, 645 645 b->discard_granularity); 646 - t->discard_alignment = lcm(t->discard_alignment, alignment) % 646 + t->discard_alignment = lcm_not_zero(t->discard_alignment, alignment) % 647 647 t->discard_granularity; 648 648 } 649 649
+1
include/linux/lcm.h
··· 4 4 #include <linux/compiler.h> 5 5 6 6 unsigned long lcm(unsigned long a, unsigned long b) __attribute_const__; 7 + unsigned long lcm_not_zero(unsigned long a, unsigned long b) __attribute_const__; 7 8 8 9 #endif /* _LCM_H */
+11
lib/lcm.c
··· 12 12 return 0; 13 13 } 14 14 EXPORT_SYMBOL_GPL(lcm); 15 + 16 + unsigned long lcm_not_zero(unsigned long a, unsigned long b) 17 + { 18 + unsigned long l = lcm(a, b); 19 + 20 + if (l) 21 + return l; 22 + 23 + return (b ? : a); 24 + } 25 + EXPORT_SYMBOL_GPL(lcm_not_zero);