* [PATCH] md faulty: use disk_stack_limits()
@ 2012-10-19 23:43 Eric Sandeen
2012-10-21 23:45 ` NeilBrown
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2012-10-19 23:43 UTC (permalink / raw)
To: linux-raid; +Cc: Mike Snitzer, Jes Sorensen
in:
fe86cdce 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>
---
diff --git a/drivers/md/faulty.c b/drivers/md/faulty.c
index 45135f6..5e7dc77 100644
--- a/drivers/md/faulty.c
+++ b/drivers/md/faulty.c
@@ -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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] md faulty: use disk_stack_limits()
2012-10-19 23:43 [PATCH] md faulty: use disk_stack_limits() Eric Sandeen
@ 2012-10-21 23:45 ` NeilBrown
0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2012-10-21 23:45 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-raid, Mike Snitzer, Jes Sorensen
[-- Attachment #1: Type: text/plain, Size: 1438 bytes --]
On Fri, 19 Oct 2012 18:43:45 -0500 Eric Sandeen <sandeen@redhat.com> wrote:
> in:
> fe86cdce 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>
> ---
>
> diff --git a/drivers/md/faulty.c b/drivers/md/faulty.c
> index 45135f6..5e7dc77 100644
> --- a/drivers/md/faulty.c
> +++ b/drivers/md/faulty.c
> @@ -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;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Applied, thanks.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-21 23:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-19 23:43 [PATCH] md faulty: use disk_stack_limits() Eric Sandeen
2012-10-21 23:45 ` NeilBrown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).