Merge branches 'edac-spr', 'edac-igen6' and 'edac-misc' into edac-updates-for-v5.11
[sfrench/cifs-2.6.git] / block / blk-settings.c
index 9741d1d83e989c8e3a18ed6eef4024bc781f0271..659cdb8a07fef767582a83ce2c55206295df647a 100644 (file)
@@ -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)) {