Skip to contentSkip to conversation

md faulty: use disk_stack_limits()

PATCH Applied Eric Sandeen 2 participants 2 messages Oct 19, 2012 – Oct 21, 2012 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 md faulty: use disk_stack_limits()

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.

---

drivers/md/faulty.c +4 -1
index 45135f6..5e7dc77 100644
@@ -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;
Applied
#1 lore raw
Quoted 36 lines · On Fri, 19 Oct 2012 18:43:45 -0500 Eric Sandeen <[email protected]> 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.

---

drivers/md/faulty.c +4 -2
index 45135f6..5e7dc77 100644
@@ -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;
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied, thanks.

NeilBrown