Skip to content

Commit

Permalink
md/raid10: round up to bdev_logical_block_size in narrow_write_error.
Browse files Browse the repository at this point in the history
RAID10 version of earlier fix for RAID1.  We must never initiate
IO with sizes less that logical_block_size.

Signed-off-by: NeilBrown <neilb@suse.de>
  • Loading branch information
NeilBrown committed Feb 16, 2015
1 parent ab713cd commit f04ebb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -2572,7 +2572,8 @@ static int narrow_write_error(struct r10bio *r10_bio, int i)
if (rdev->badblocks.shift < 0)
return 0;

block_sectors = 1 << rdev->badblocks.shift;
block_sectors = roundup(1 << rdev->badblocks.shift,
bdev_logical_block_size(rdev->bdev) >> 9);
sector = r10_bio->sector;
sectors = ((r10_bio->sector + block_sectors)
& ~(sector_t)(block_sectors - 1))
Expand Down

0 comments on commit f04ebb0

Please sign in to comment.