From f2b3e9e870731073487b1c3aba624416a76b65eb Mon Sep 17 00:00:00 2001 From: "Andrey V. Elsukov" Date: Tue, 11 Jan 2011 11:42:22 +0000 Subject: [PATCH] Round GNOP provider's mediasize to its sectorsize. This prevents KASSERT in g_io_request when geom classes doing tasting. PR: kern/147852 MFC after: 1 week --- sys/geom/nop/g_nop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/geom/nop/g_nop.c b/sys/geom/nop/g_nop.c index ffa32e3da5bf..0c23ffa1491a 100644 --- a/sys/geom/nop/g_nop.c +++ b/sys/geom/nop/g_nop.c @@ -176,6 +176,8 @@ g_nop_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp, gctl_error(req, "Invalid secsize for provider %s.", pp->name); return (EINVAL); } + if (size % secsize != 0) + size -= size % secsize; snprintf(name, sizeof(name), "%s%s", pp->name, G_NOP_SUFFIX); LIST_FOREACH(gp, &mp->geom, geom) { if (strcmp(gp->name, name) == 0) {