/* Calculate stripe information for the request. */
rmd->blocks_per_row = rmd->data_disks_per_row * rmd->strip_size;
+ if (rmd->blocks_per_row == 0) /* Used as a divisor in many calculations */
+ return PQI_RAID_BYPASS_INELIGIBLE;
#if BITS_PER_LONG == 32
tmpdiv = rmd->first_block;
do_div(tmpdiv, rmd->blocks_per_row);
#if BITS_PER_LONG == 32
u64 tmpdiv;
#endif
+
+ if (rmd->blocks_per_row == 0) /* Used as a divisor in many calculations */
+ return PQI_RAID_BYPASS_INELIGIBLE;
+
/* RAID 50/60 */
/* Verify first and last block are in same RAID group. */
rmd->stripesize = rmd->blocks_per_row * rmd->layout_map_count;
rmd->q_parity_it_nexus = raid_map->disk_data[index + 1].aio_handle;
rmd->xor_mult = raid_map->disk_data[rmd->map_index].xor_mult[1];
}
- if (rmd->blocks_per_row == 0)
- return PQI_RAID_BYPASS_INELIGIBLE;
#if BITS_PER_LONG == 32
tmpdiv = rmd->first_block;
do_div(tmpdiv, rmd->blocks_per_row);