Commit 0d695d6d authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'md/3.20-fixes' of git://neil.brown.name/md

Pull md bugfixes from Neil Brown:
 "Three bug md fixes for 3.20

  yet-another-livelock in raid5, and a problem with write errors to
  4K-block devices"

* tag 'md/3.20-fixes' of git://neil.brown.name/md:
  md/raid5: Fix livelock when array is both resyncing and degraded.
  md/raid10: round up to bdev_logical_block_size in narrow_write_error.
  md/raid1: round up to bdev_logical_block_size in narrow_write_error
parents d96c757e 26ac1073
...@@ -2196,7 +2196,8 @@ static int narrow_write_error(struct r1bio *r1_bio, int i) ...@@ -2196,7 +2196,8 @@ static int narrow_write_error(struct r1bio *r1_bio, int i)
if (rdev->badblocks.shift < 0) if (rdev->badblocks.shift < 0)
return 0; return 0;
block_sectors = 1 << rdev->badblocks.shift; block_sectors = roundup(1 << rdev->badblocks.shift,
bdev_logical_block_size(rdev->bdev) >> 9);
sector = r1_bio->sector; sector = r1_bio->sector;
sectors = ((sector + block_sectors) sectors = ((sector + block_sectors)
& ~(sector_t)(block_sectors - 1)) & ~(sector_t)(block_sectors - 1))
......
...@@ -2572,7 +2572,8 @@ static int narrow_write_error(struct r10bio *r10_bio, int i) ...@@ -2572,7 +2572,8 @@ static int narrow_write_error(struct r10bio *r10_bio, int i)
if (rdev->badblocks.shift < 0) if (rdev->badblocks.shift < 0)
return 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; sector = r10_bio->sector;
sectors = ((r10_bio->sector + block_sectors) sectors = ((r10_bio->sector + block_sectors)
& ~(sector_t)(block_sectors - 1)) & ~(sector_t)(block_sectors - 1))
......
...@@ -3170,7 +3170,8 @@ static void handle_stripe_dirtying(struct r5conf *conf, ...@@ -3170,7 +3170,8 @@ static void handle_stripe_dirtying(struct r5conf *conf,
* generate correct data from the parity. * generate correct data from the parity.
*/ */
if (conf->max_degraded == 2 || if (conf->max_degraded == 2 ||
(recovery_cp < MaxSector && sh->sector >= recovery_cp)) { (recovery_cp < MaxSector && sh->sector >= recovery_cp &&
s->failed == 0)) {
/* Calculate the real rcw later - for now make it /* Calculate the real rcw later - for now make it
* look like rcw is cheaper * look like rcw is cheaper
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment