Skip to content

Commit

Permalink
md faulty: use disk_stack_limits()
Browse files Browse the repository at this point in the history
in:
fe86cdc block: do not artificially constrain max_sectors for stacking drivers

max_sectors defaults to UINT_MAX.  md faulty wasn't using
disk_stack_limits(), so inherited this large value as well.
This triggered a bug in XFS when stressed over md_faulty, when
a very large bio_alloc() failed.

That was on an older kernel, and I can't reproduce exactly the
same thing upstream, but I think the fix is appropriate in any
case.

Thanks to Mike Snitzer for pointing out the problem.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
  • Loading branch information
Eric Sandeen authored and NeilBrown committed Oct 21, 2012
1 parent ae9d2b8 commit 0be1fec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/md/faulty.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,11 @@ static int run(struct mddev *mddev)
}
conf->nfaults = 0;

rdev_for_each(rdev, mddev)
rdev_for_each(rdev, mddev) {
conf->rdev = rdev;
disk_stack_limits(mddev->gendisk, rdev->bdev,
rdev->data_offset << 9);
}

md_set_array_sectors(mddev, faulty_size(mddev, 0, 0));
mddev->private = conf;
Expand Down

0 comments on commit 0be1fec

Please sign in to comment.