From owner-freebsd-geom@FreeBSD.ORG Mon Jul 7 11:06:59 2008 Return-Path: Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49605106564A for ; Mon, 7 Jul 2008 11:06:59 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 351FD8FC12 for ; Mon, 7 Jul 2008 11:06:59 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m67B6x2T062039 for ; Mon, 7 Jul 2008 11:06:59 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m67B6wod062035 for freebsd-geom@FreeBSD.org; Mon, 7 Jul 2008 11:06:58 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 7 Jul 2008 11:06:58 GMT Message-Id: <200807071106.m67B6wod062035@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-geom@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-geom@FreeBSD.org X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2008 11:06:59 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- s kern/73177 geom kldload geom_* causes panic due to memory exhaustion o kern/84556 geom [geom] GBDE-encrypted swap causes panic at shutdown o kern/87544 geom [gbde] mmaping large files on a gbde filesystem deadlo s kern/89102 geom [geom] [panic] panic when forced unmount FS from unplu o kern/89546 geom [geom] GEOM error a kern/89660 geom [vinum] [patch] [panic] due to g_malloc returning null o bin/90093 geom fdisk(8) incapable of altering in-core geometry o kern/90582 geom [geom] [panic] Restore cause panic string (ffs_blkfree o kern/98034 geom [geom] dereference of NULL pointer in acd_geom_detach o kern/104389 geom [geom] [patch] sys/geom/geom_dump.c doesn't encode XML o kern/113419 geom [geom] geom fox multipathing not failing back o kern/113957 geom [gmirror] gmirror is intermittently reporting a degrad o kern/120021 geom net-p2p/qbittorrent crashes system when it works thoug o kern/120231 geom [geom] GEOM_CONCAT error adding second drive o kern/121364 geom [gmirror] Removing all providers create a "zombie" mir o kern/122067 geom [panic]: Geom crashed during boot f kern/122415 geom [geom] UFS labels are being constantly created and rem o kern/123122 geom [geom] GEOM / gjournal kernel lock o kern/123962 geom [panic] gjournal(8): gjournal (455Gb data, 8Gb journal o kern/124130 geom [gmirror][usb] gmirror fails to start usb devices that o kern/124294 geom [geom] gmirror(8) have inappropriate logic when workin o kern/124969 geom gvinum(8): gvinum raid5 plex does not detect missing s 22 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o bin/78131 geom gbde(8) "destroy" not working. o kern/79035 geom [vinum] gvinum unable to create a striped set of mirro o kern/79251 geom [2TB] newfs fails on 2.6TB gbde device o kern/94632 geom [geom] Kernel output resets input while GELI asks for o kern/107707 geom [geom] [patch] [request] add new class geom_xbox360 to p bin/110705 geom gmirror(8) control utility does not exit with correct o kern/113837 geom [geom] unable to access 1024 sector size storage o kern/113885 geom [gmirror] [patch] improved gmirror balance algorithm o kern/114532 geom [geom] GEOM_MIRROR shows up in kldstat even if compile f kern/115547 geom [geom] [patch] [request] let GEOM Eli get password fro o kern/119743 geom [geom] geom label for cds is keeped after dismount and o kern/120044 geom [msdosfs] [geom] incorrect MSDOSFS label fries adminis o kern/121559 geom [patch] [geom] geom label class allows to create inacc o kern/123630 geom [patch] [gmirror] gmirror doesnt allow the original dr o misc/124434 geom [UPDATING] [patch]: Missing UPDATING entry for geom mi o kern/124973 geom [gjournal] [patch] boot order affects geom_journal con 16 problems total. From owner-freebsd-geom@FreeBSD.ORG Mon Jul 7 11:40:45 2008 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86D301065682; Mon, 7 Jul 2008 11:40:45 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5AC498FC26; Mon, 7 Jul 2008 11:40:45 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from freefall.freebsd.org (remko@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m67BeiZF069977; Mon, 7 Jul 2008 11:40:44 GMT (envelope-from remko@freefall.freebsd.org) Received: (from remko@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m67Bei7p069973; Mon, 7 Jul 2008 11:40:44 GMT (envelope-from remko) Date: Mon, 7 Jul 2008 11:40:44 GMT Message-Id: <200807071140.m67Bei7p069973@freefall.freebsd.org> To: remko@FreeBSD.org, freebsd-geom@FreeBSD.org, remko@FreeBSD.org From: remko@FreeBSD.org Cc: Subject: Re: misc/124434: [UPDATING] [patch]: Missing UPDATING entry for geom mirror metadata version rev X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2008 11:40:45 -0000 Synopsis: [UPDATING] [patch]: Missing UPDATING entry for geom mirror metadata version rev Responsible-Changed-From-To: freebsd-geom->remko Responsible-Changed-By: remko Responsible-Changed-When: Mon Jul 7 11:40:44 UTC 2008 Responsible-Changed-Why: I'll take it. http://www.freebsd.org/cgi/query-pr.cgi?pr=124434 From owner-freebsd-geom@FreeBSD.ORG Wed Jul 9 17:40:06 2008 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14C79106567D for ; Wed, 9 Jul 2008 17:40:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id F2FB98FC2D for ; Wed, 9 Jul 2008 17:40:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m69He5dS056323 for ; Wed, 9 Jul 2008 17:40:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m69He5M6056322; Wed, 9 Jul 2008 17:40:05 GMT (envelope-from gnats) Date: Wed, 9 Jul 2008 17:40:05 GMT Message-Id: <200807091740.m69He5M6056322@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: Ulf Lilleengen Cc: Subject: Re: kern/124969: gvinum(8): gvinum raid5 plex does not detect missing subdisk X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ulf Lilleengen List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jul 2008 17:40:06 -0000 The following reply was made to PR kern/124969; it has been noted by GNATS. From: Ulf Lilleengen To: bug-followup@FreeBSD.org, drkp-f@ambulatoryclam.net Cc: Subject: Re: kern/124969: gvinum(8): gvinum raid5 plex does not detect missing subdisk Date: Wed, 9 Jul 2008 19:38:24 +0200 --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, I think I managed to solve the issue, at least it works in CURRENT. This patch is for RELENG_6, but I've not been able to test it. Be careful, I make no guarantees of what it will do :) However, it doesn't touch any data, just handles some extra fields and flags in the structures. I ended up making it possible to have "referenced" drives (drives with no real device), as well as subdisks that didn't have a "real" drive yet. Also, I fixed some issues with the plex states when things are tasted, but please be careful and watch the states and make sure they are what they "should" be (E.g. a failed drive that is returning should neved have the UP state, since it must be synchronized first). I even found a "real" bug in CURRENT while making this patch as well. Please tell me how it fares. -- Ulf Lilleengen --gBBFr7Ir9EOA20Yy Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="gvinum_detect_down_disk.diff" Index: sys/geom/vinum/geom_vinum_drive.c =================================================================== --- sys/geom/vinum/geom_vinum_drive.c (revision 180387) +++ sys/geom/vinum/geom_vinum_drive.c (working copy) @@ -476,6 +476,13 @@ */ d = gv_find_drive(sc, vhdr->label.name); + /* If it's referenced, remove it before we re-create it. */ + if (d != NULL && d->flags & GV_DRIVE_REFERENCED) { + LIST_REMOVE(d, drive); + g_free(d); + d = NULL; + } + /* We already know about this drive. */ if (d != NULL) { /* Check if this drive already has a geom. */ @@ -536,10 +543,12 @@ * them. */ LIST_FOREACH(s, &sc->subdisks, sd) { - if (!strncmp(s->drive, d->name, GV_MAXDRIVENAME)) + if (!strncmp(s->drive, d->name, GV_MAXDRIVENAME)) { /* XXX: errors ignored */ gv_sd_to_drive(sc, d, s, errstr, sizeof(errstr)); + s->flags &= ~GV_SD_NODRIVE; + } } /* This drive is now up for sure. */ Index: sys/geom/vinum/geom_vinum_list.c =================================================================== --- sys/geom/vinum/geom_vinum_list.c (revision 180387) +++ sys/geom/vinum/geom_vinum_list.c (working copy) @@ -314,6 +314,8 @@ i = 0; LIST_FOREACH(s, &p->subdisks, in_plex) { sbuf_printf(sb, "\t\tSubdisk %d:\t%s\n", i, s->name); + if (s->flags & GV_SD_NODRIVE) + continue; sbuf_printf(sb, "\t\t state: %s\tsize %11jd " "(%jd MB)\n", gv_sdstate(s->state), (intmax_t)s->size, (intmax_t)s->size / MEGABYTE); @@ -361,6 +363,12 @@ { if (flags & GV_FLAG_V) { sbuf_printf(sb, "Subdisk %s:\n", s->name); + if (s->flags & GV_SD_NODRIVE) { + sbuf_printf(sb, "\t\tSize: 0 bytes (0 MB)\n"); + sbuf_printf(sb, "\t\tState: %s\n", + gv_sdstate(s->state)); + return; + } sbuf_printf(sb, "\t\tSize: %16jd bytes (%jd MB)\n", (intmax_t)s->size, (intmax_t)s->size / MEGABYTE); sbuf_printf(sb, "\t\tState: %s\n", gv_sdstate(s->state)); @@ -390,6 +398,11 @@ gv_roughlength(s->drive_offset, 1)); } else { sbuf_printf(sb, "S %-21s State: ", s->name); + if (s->flags & GV_SD_NODRIVE) { + sbuf_printf(sb, "%s\t", gv_sdstate(s->state)); + sbuf_printf(sb, "D: %-12s Size: 0\n", s->drive); + return; + } if (s->state == GV_SD_INITIALIZING || s->state == GV_SD_REVIVING) { if (s->state == GV_SD_INITIALIZING) @@ -439,6 +452,8 @@ /* Verbose listing. */ if (flags & GV_FLAG_V) { sbuf_printf(sb, "Drive %s:\tDevice %s\n", d->name, d->device); + if (d->flags & GV_DRIVE_REFERENCED) + return; sbuf_printf(sb, "\t\tSize: %16jd bytes (%jd MB)\n", (intmax_t)d->size, (intmax_t)d->size / MEGABYTE); sbuf_printf(sb, "\t\tUsed: %16jd bytes (%jd MB)\n", @@ -458,8 +473,13 @@ (intmax_t)fl->offset, (intmax_t)fl->size); } } else { - sbuf_printf(sb, "D %-21s State: %s\t/dev/%s\tA: %jd/%jd MB " - "(%d%%)\n", d->name, gv_drivestate(d->state), d->device, + sbuf_printf(sb, "D %-21s State: %s\t/dev/%s\t", d->name, + gv_drivestate(d->state), d->device); + if (d->flags & GV_DRIVE_REFERENCED) { + sbuf_printf(sb, "\n"); + return; + } + sbuf_printf(sb, "A: %jd/%jd MB (%d%%)\n", (intmax_t)d->avail / MEGABYTE, (intmax_t)d->size / MEGABYTE, (int)((d->avail * 100) / d->size)); } Index: sys/geom/vinum/geom_vinum_subr.c =================================================================== --- sys/geom/vinum/geom_vinum_subr.c (revision 180387) +++ sys/geom/vinum/geom_vinum_subr.c (working copy) @@ -87,6 +87,7 @@ struct gv_volume *v, *v2; struct gv_plex *p, *p2; struct gv_sd *s, *s2; + struct gv_drive *d; int tokens; char *token[GV_MAXARGS]; @@ -144,6 +145,7 @@ p->vinumconf = sc; LIST_INIT(&p->subdisks); + LIST_INIT(&p->delayed_sd); LIST_INSERT_HEAD(&sc->plexes, p, plex); } else if (!strcmp(token[0], "sd")) { @@ -154,6 +156,28 @@ break; } + /* The drive might not exist. */ + d = gv_find_drive(sc, s->drive); + if (d == NULL) { + s->flags |= GV_SD_NODRIVE; + s->state = GV_SD_DOWN; + d = g_malloc(sizeof(struct gv_drive), + M_WAITOK | M_ZERO); + d->state = GV_DRIVE_DOWN; + d->flags |= GV_DRIVE_REFERENCED; + strlcpy(d->name, s->drive, + GV_MAXDRIVENAME); + s->drive_sc = d; + snprintf(d->device, GV_MAXDRIVENAME, + "???"); + LIST_INSERT_HEAD(&sc->drives, d, drive); + p = gv_find_plex(sc, s->plex); + if (p != NULL) { + /* Register delayed plex. */ + LIST_INSERT_HEAD(&p->delayed_sd, + s, in_plex_delay); + } + } if (merge) { s2 = gv_find_sd(sc, s->name); if (s2 != NULL) { @@ -236,9 +260,10 @@ } int -gv_sd_to_plex(struct gv_plex *p, struct gv_sd *s, int check) +gv_sd_to_plex(struct gv_plex *p, struct gv_sd *s, int check, int taste) { struct gv_sd *s2; + struct gv_drive *d; g_topology_assert(); @@ -246,6 +271,13 @@ if (s->plex_sc == p) return (0); + /* If we're coming from a taste, mark the subdisk up if drive is up. */ + if (taste) { + d = gv_find_drive(p->vinumconf, s->drive); + if (d->state = GV_DRIVE_UP) + gv_set_sd_state(s, GV_SD_UP, GV_SETSTATE_FORCE); + } + /* Find the correct plex offset for this subdisk, if needed. */ if (s->plex_offset == -1) { if (p->sdcount) { @@ -325,7 +357,7 @@ { struct gv_sd *s, *s2; off_t remainder; - int required_sds, state; + int required_sds, state, sdcount; KASSERT(p != NULL, ("gv_update_plex_config: NULL p")); @@ -349,10 +381,18 @@ break; } + sdcount = p->sdcount; + LIST_FOREACH(s2, &p->subdisks, in_plex) { + if (s2->flags & GV_SD_NODRIVE) + sdcount--; + } if (required_sds) { - if (p->sdcount < required_sds) { + if (sdcount < required_sds) { state = GV_PLEX_DOWN; } + if ((sdcount == (required_sds - 1)) && + (p->org == GV_PLEX_RAID5)) { + state = GV_PLEX_DEGRADED; /* * The subdisks in striped plexes must all have the same size. @@ -412,8 +452,9 @@ s->state = GV_SD_STALE; p->flags &= ~GV_PLEX_ADDED; p->flags &= ~GV_PLEX_NEWBORN; - p->state = GV_PLEX_DOWN; + state = GV_PLEX_DOWN; } + p->state = state; } /* @@ -441,7 +482,7 @@ errlen)); /* Check if this subdisk was already given to this drive. */ - if (s->drive_sc == d) + if (s->drive_sc == d && !(s->flags & GV_SD_NODRIVE)) return (0); /* Preliminary checks. */ Index: sys/geom/vinum/geom_vinum.c =================================================================== --- sys/geom/vinum/geom_vinum.c (revision 180387) +++ sys/geom/vinum/geom_vinum.c (working copy) @@ -248,6 +248,7 @@ p->vinumconf = sc; p->flags |= GV_PLEX_NEWBORN; LIST_INIT(&p->subdisks); + LIST_INIT(&p->delayed_sd); LIST_INSERT_HEAD(&sc->plexes, p, plex); } @@ -302,7 +303,7 @@ * Then, we give the subdisk to the plex; we check if the * given values are correct and maybe adjust them. */ - error = gv_sd_to_plex(p, s, 1); + error = gv_sd_to_plex(p, s, 1, 0); if (error) { printf("FOO: couldn't give sd '%s' to plex '%s'\n", s->name, p->name); Index: sys/geom/vinum/geom_vinum_state.c =================================================================== --- sys/geom/vinum/geom_vinum_state.c (revision 180387) +++ sys/geom/vinum/geom_vinum_state.c (working copy) @@ -171,7 +171,8 @@ case GV_SD_UP: /* We can't bring the subdisk up if our drive is dead. */ d = s->drive_sc; - if ((d == NULL) || (d->state != GV_DRIVE_UP)) + if ((d == NULL) || (d->state != GV_DRIVE_UP) || + (d->flags & GV_DRIVE_REFERENCED)) return (-1); /* Check from where we want to be brought up. */ @@ -276,6 +277,8 @@ s->flags &= ~GV_SD_NEWBORN; } else if (s->state != GV_SD_UP) s->state = GV_SD_STALE; + else if (s->flags & GV_SD_NODRIVE) + s->state = GV_SD_DOWN; else s->state = GV_SD_UP; @@ -391,6 +394,10 @@ p->sddown++; /* XXX: Another unusable subdisk? */ break; } + if (s->flags & GV_SD_NODRIVE) + p->sddown++; } + LIST_FOREACH(s, &p->delayed_sd, in_plex_delay) + p->sddown++; return (statemap); } Index: sys/geom/vinum/geom_vinum.h =================================================================== --- sys/geom/vinum/geom_vinum.h (revision 180387) +++ sys/geom/vinum/geom_vinum.h (working copy) @@ -86,7 +86,7 @@ void gv_parse_config(struct gv_softc *, u_char *, int); int gv_sd_to_drive(struct gv_softc *, struct gv_drive *, struct gv_sd *, char *, int); -int gv_sd_to_plex(struct gv_plex *, struct gv_sd *, int); +int gv_sd_to_plex(struct gv_plex *, struct gv_sd *, int, int); void gv_update_plex_config(struct gv_plex *); void gv_update_vol_size(struct gv_volume *, off_t); Index: sys/geom/vinum/geom_vinum_var.h =================================================================== --- sys/geom/vinum/geom_vinum_var.h (revision 180387) +++ sys/geom/vinum/geom_vinum_var.h (working copy) @@ -190,6 +190,7 @@ #define GV_DRIVE_THREAD_DIE 0x02 /* Signal the worker thread to die. */ #define GV_DRIVE_THREAD_DEAD 0x04 /* The worker thread has died. */ #define GV_DRIVE_NEWBORN 0x08 /* The drive was just created. */ +#define GV_DRIVE_REFERENCED 0x10 /* The drive does not yet exist. */ struct gv_hdr *hdr; /* The drive header. */ @@ -226,6 +227,7 @@ int flags; #define GV_SD_NEWBORN 0x01 /* Subdisk was just created. */ #define GV_SD_INITCANCEL 0x02 /* Cancel initialization process. */ +#define GV_SD_NODRIVE 0x04 /* The subdisk does'nt have a drive. */ char drive[GV_MAXDRIVENAME]; /* Name of underlying drive. */ char plex[GV_MAXPLEXNAME]; /* Name of associated plex. */ @@ -239,6 +241,7 @@ LIST_ENTRY(gv_sd) from_drive; /* Subdisk list of underlying drive. */ LIST_ENTRY(gv_sd) in_plex; /* Subdisk list of associated plex. */ LIST_ENTRY(gv_sd) sd; /* Entry in the vinum config. */ + LIST_ENTRY(gv_sd) in_plex_delay; /* Delayed entry. */ struct gv_softc *vinumconf; /* Pointer to the vinum config. */ }; @@ -281,6 +284,7 @@ TAILQ_HEAD(,gv_bioq) wqueue; /* Waiting BIO queue. */ TAILQ_HEAD(,gv_raid5_packet) packets; /* RAID5 sub-requests. */ + LIST_HEAD(,gv_sd) delayed_sd; /* List of delayed subdisks. */ LIST_HEAD(,gv_sd) subdisks; /* List of attached subdisks. */ LIST_ENTRY(gv_plex) in_volume; /* Plex list of associated volume. */ LIST_ENTRY(gv_plex) plex; /* Entry in the vinum config. */ Index: sys/geom/vinum/geom_vinum_move.c =================================================================== --- sys/geom/vinum/geom_vinum_move.c (revision 180387) +++ sys/geom/vinum/geom_vinum_move.c (working copy) @@ -190,7 +190,7 @@ } } - gv_sd_to_plex(p, newsd, 1); + gv_sd_to_plex(p, newsd, 1, 0); /* Creates the new providers.... */ gv_drive_modify(d); Index: sys/geom/vinum/geom_vinum_plex.c =================================================================== --- sys/geom/vinum/geom_vinum_plex.c (revision 180387) +++ sys/geom/vinum/geom_vinum_plex.c (working copy) @@ -273,7 +273,7 @@ { struct bio *bp; struct gv_plex *p; - struct gv_sd *s; + struct gv_sd *s, *s2; struct gv_bioq *bq; p = arg; @@ -285,6 +285,17 @@ if (p->flags & GV_PLEX_THREAD_DIE) break; + /* First make sure we got all subdisks. */ + LIST_FOREACH_SAFE(s, &p->delayed_sd, in_plex_delay, s2) { + if (s->flags & GV_SD_NODRIVE) { + gv_set_sd_state(s, GV_SD_STALE, + GV_SETSTATE_FORCE); + } + gv_sd_to_plex(p, s, 0, 0); + LIST_REMOVE(s, in_plex_delay); + gv_update_plex_config(p); + } + /* Take the first BIO from our queue. */ bq = TAILQ_FIRST(&p->bqueue); if (bq == NULL) { @@ -737,7 +748,7 @@ * configuration, we don't check the given value (should we?). * XXX: shouldn't be done here */ - gv_sd_to_plex(p, s, 0); + gv_sd_to_plex(p, s, 0, 1); /* Now check if there's already a geom for this plex. */ gp = p->geom; --gBBFr7Ir9EOA20Yy-- From owner-freebsd-geom@FreeBSD.ORG Wed Jul 9 17:50:03 2008 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8D4E106567E for ; Wed, 9 Jul 2008 17:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8F2F28FC26 for ; Wed, 9 Jul 2008 17:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m69Ho3Op056591 for ; Wed, 9 Jul 2008 17:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m69Ho3Hk056590; Wed, 9 Jul 2008 17:50:03 GMT (envelope-from gnats) Date: Wed, 9 Jul 2008 17:50:03 GMT Message-Id: <200807091750.m69Ho3Hk056590@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: Ulf Lilleengen Cc: Subject: Re: kern/124969: gvinum(8): gvinum raid5 plex does not detect missing subdisk X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ulf Lilleengen List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jul 2008 17:50:03 -0000 The following reply was made to PR kern/124969; it has been noted by GNATS. From: Ulf Lilleengen To: bug-followup@FreeBSD.org, drkp-f@ambulatoryclam.net Cc: Subject: Re: kern/124969: gvinum(8): gvinum raid5 plex does not detect missing subdisk Date: Wed, 9 Jul 2008 19:49:07 +0200 Hi again, I also put the patch here: http://people.freebsd.org/~lulf/patches/gvinum/gvinum_detect_down_disk.diff In case you love GNATS as much as I do :) -- Ulf Lilleengen From owner-freebsd-geom@FreeBSD.ORG Thu Jul 10 12:55:15 2008 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1FB21065685 for ; Thu, 10 Jul 2008 12:55:15 +0000 (UTC) (envelope-from tapan.list@gmail.com) Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.238]) by mx1.freebsd.org (Postfix) with ESMTP id 8F95B8FC24 for ; Thu, 10 Jul 2008 12:55:15 +0000 (UTC) (envelope-from tapan.list@gmail.com) Received: by qb-out-0506.google.com with SMTP id q12so7304081qba.13 for ; Thu, 10 Jul 2008 05:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=ifFIrK+xYIr3NW44SXjlVofPOvU7LXZHhqiYNfgwbjg=; b=Lt1mFdU1EC1lqlNeQSN17VpN8fWXtqOYowcnhvBO/3alGOexEMe6r0OusqiV0+1ZpS Y8IdSMFRyW49EXzS1EOOCDcpEWCcHvycl6BQ9MniXbagbJebYti5pYV70bnbvbkyHEMv RyofBrARq8xlm8l2kQqNA9hO1VPYeZAhb6cUY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=Vo61JEVLj4E8aue0MnR6G0rVdMQmWzPDCbBruDUWFyzd9FUX1iD43FUZRgNwYgp35f xUlD9mWpbl9uvdYwmePN2rYk5lL2EBXtgYRSi0IELcWIF2SM3Xi1c2E6wTOQJYoHigkS RQxdfL26deA/oOn9u+P3mcOcHf+fAhO1vs96A= Received: by 10.103.40.5 with SMTP id s5mr4800545muj.133.1215693686508; Thu, 10 Jul 2008 05:41:26 -0700 (PDT) Received: by 10.103.227.19 with HTTP; Thu, 10 Jul 2008 05:41:25 -0700 (PDT) Message-ID: <482257ad0807100541s2d2c3d1eo6cd57c3a1bc338d1@mail.gmail.com> Date: Thu, 10 Jul 2008 18:11:25 +0530 From: "Tapan Chaudhari" To: freebsd-geom@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Can GEOM be used to intercept the I/o calls to an existing mounted device? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2008 12:55:15 -0000 Hi All, I am a newbie to FreeBSD and GEOM. I wanted to intercept the i/o calls going to a particular mounted device by writing some driver. I came across geom and thought it might work. I tried to create a new device, mount it and then tried using gmirror to mirror the device :- #dd if=/dev/zero of=file1 bs=1M count=10 #dd if=/dev/zero of=file2 bs=1M count=10 #mdconfig -f file1 #mdconfig -f file2 #fdisk -B /dev/mirror/md0 #newfs /dev/mirror/md0s1 #mkdir /mnt/mirror0 #mount /dev/mirror/md0s1 /mnt/mirror0/ #gmirror label -v -n -b round-robin gm0 /dev/md0 gmirror: Can't store metadata on /dev/md0: Operation not permitted. It gave me this error "gmirror: Can't store metadata on /dev/md0: Operation not permitted." Am I doing something wrong? Or GEOM does not permit me intercept the i/o calls? If not geom, is there any other mechanism by which I can achieve it? Thanks, --Tapan. From owner-freebsd-geom@FreeBSD.ORG Thu Jul 10 13:33:34 2008 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 405E41065676 for ; Thu, 10 Jul 2008 13:33:34 +0000 (UTC) (envelope-from mark@legios.org) Received: from bade.legios.org (ppp198-172.static.internode.on.net [59.167.198.172]) by mx1.freebsd.org (Postfix) with ESMTP id 023118FC1C for ; Thu, 10 Jul 2008 13:33:33 +0000 (UTC) (envelope-from mark@legios.org) Received: from localhost (unknown [192.168.0.17]) by bade.legios.org (Postfix) with ESMTP id 190041AD719; Thu, 10 Jul 2008 23:11:14 +1000 (EST) X-Virus-Scanned: amavisd-new at legios.org Received: from bade.legios.org ([192.168.0.17]) by localhost (legios.org [192.168.0.17]) (amavisd-new, port 10024) with ESMTP id 18k629VjEppQ; Thu, 10 Jul 2008 23:10:58 +1000 (EST) Received: from [192.168.0.200] (unknown [192.168.0.200]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by bade.legios.org (Postfix) with ESMTP id 8E85B1AD6F5; Thu, 10 Jul 2008 23:10:58 +1000 (EST) From: Mark Gladman To: freebsd-geom@freebsd.org Date: Thu, 10 Jul 2008 23:09:02 +1000 User-Agent: KMail/1.9.7 References: <482257ad0807100541s2d2c3d1eo6cd57c3a1bc338d1@mail.gmail.com> In-Reply-To: <482257ad0807100541s2d2c3d1eo6cd57c3a1bc338d1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807102309.03191.mark@legios.org> Cc: Tapan Chaudhari Subject: Re: Can GEOM be used to intercept the I/o calls to an existing mounted device? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2008 13:33:34 -0000 On Thursday 10 July 2008 22:41:25 Tapan Chaudhari wrote: > Hi All, > I am a newbie to FreeBSD and GEOM. I wanted to intercept the i/o calls > going to a particular mounted device by writing some driver. > I came across geom and thought it might work. I tried to create a new > device, mount it and then tried using gmirror to mirror the device :- > > #dd if=/dev/zero of=file1 bs=1M count=10 > #dd if=/dev/zero of=file2 bs=1M count=10 > #mdconfig -f file1 > #mdconfig -f file2 > #fdisk -B /dev/mirror/md0 > #newfs /dev/mirror/md0s1 > #mkdir /mnt/mirror0 > #mount /dev/mirror/md0s1 /mnt/mirror0/ > > #gmirror label -v -n -b round-robin gm0 /dev/md0 > gmirror: Can't store metadata on /dev/md0: Operation not permitted. > > It gave me this error "gmirror: Can't store metadata on /dev/md0: Operation > not permitted." > > Am I doing something wrong? Or GEOM does not permit me intercept the i/o > calls? If not geom, is there any other mechanism by which I can achieve it? > > > Thanks, > --Tapan. > _______________________________________________ > freebsd-geom@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-geom > To unsubscribe, send any mail to "freebsd-geom-unsubscribe@freebsd.org" Hey, You're attempting to set up gmirror on a mounted device. Unmount /dev/mirror/md0s1 then retry the gmirror command and it should work. Cheers! Mark From owner-freebsd-geom@FreeBSD.ORG Thu Jul 10 13:55:42 2008 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82605106566B for ; Thu, 10 Jul 2008 13:55:42 +0000 (UTC) (envelope-from tapan.list@gmail.com) Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.231]) by mx1.freebsd.org (Postfix) with ESMTP id 3D60F8FC1E for ; Thu, 10 Jul 2008 13:55:42 +0000 (UTC) (envelope-from tapan.list@gmail.com) Received: by qb-out-0506.google.com with SMTP id q12so7388737qba.13 for ; Thu, 10 Jul 2008 06:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=inHYr0sHq9nj2kF2vYG1/WvoD0Wwr0jcSSFdBofyiTE=; b=KtLT01slrFZKn3izIKp+RyXC9QCEmbm69DjCVUUbNYFXn6dz06eNiSNpxPXzsgbMGQ QAoHVtUcB5Lf4a9NCts59EzYBYLdJ4AcbbGWceLqwrHhM5wxkZGVb1dYkXdrYEnibarH x2qZsW5xpAswwMyOX/fPxcPKAk4cGtdSQSIzE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=Yc1bJV3/MNhc8fVSnwlMHVNfsXi2RrGtKhHycxeKmaT7eeG0lq7qhr+jAiJLvojqdd fo4hCpLg3o9R3Yiiz3u4uhnw+L+aemFGymQxvn/0869WUVKaIVpm5fIAIiN2nqneVQ3L VEWIncFLF/zmPpFwOWAuNzGY0cuVKU0BuC6qU= Received: by 10.102.218.6 with SMTP id q6mr2786239mug.127.1215698140146; Thu, 10 Jul 2008 06:55:40 -0700 (PDT) Received: by 10.103.227.19 with HTTP; Thu, 10 Jul 2008 06:55:40 -0700 (PDT) Message-ID: <482257ad0807100655u1a5c660awfad05564e40e9a95@mail.gmail.com> Date: Thu, 10 Jul 2008 19:25:40 +0530 From: "Tapan Chaudhari" To: freebsd-geom@freebsd.org In-Reply-To: <200807102309.03191.mark@legios.org> MIME-Version: 1.0 References: <482257ad0807100541s2d2c3d1eo6cd57c3a1bc338d1@mail.gmail.com> <200807102309.03191.mark@legios.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Can GEOM be used to intercept the I/o calls to an existing mounted device? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2008 13:55:42 -0000 Thanks Mark, but unmounting will anyways work. But the problem here will be, a new device "/dev/mirror/gm0" and "/dev/mirror/gm0s1" will be created after :- #gmirror label -v -n -b round-robin gm0 /dev/md0 #gmirror load #gmirror configure -a gm0 and "/dev/md0s1" gets deleted. Now I will have to mount the new device "/dev/mirror/gm0s1" to get my original contents. Can't I do it on the fly while the device is already mounted? I just want that all the calls going to the device "/dev/md0s1" first come to me and then it goes to the original device. In short intercepting the i/o calls. Is there some way I can achieve this? Thanks, On Thu, Jul 10, 2008 at 6:39 PM, Mark Gladman wrote: > On Thursday 10 July 2008 22:41:25 Tapan Chaudhari wrote: > > Hi All, > > I am a newbie to FreeBSD and GEOM. I wanted to intercept the i/o > calls > > going to a particular mounted device by writing some driver. > > I came across geom and thought it might work. I tried to create a new > > device, mount it and then tried using gmirror to mirror the device :- > > > > #dd if=/dev/zero of=file1 bs=1M count=10 > > #dd if=/dev/zero of=file2 bs=1M count=10 > > #mdconfig -f file1 > > #mdconfig -f file2 > > #fdisk -B /dev/mirror/md0 > > #newfs /dev/mirror/md0s1 > > #mkdir /mnt/mirror0 > > #mount /dev/mirror/md0s1 /mnt/mirror0/ > > > > #gmirror label -v -n -b round-robin gm0 /dev/md0 > > gmirror: Can't store metadata on /dev/md0: Operation not permitted. > > > > It gave me this error "gmirror: Can't store metadata on /dev/md0: > Operation > > not permitted." > > > > Am I doing something wrong? Or GEOM does not permit me intercept the i/o > > calls? If not geom, is there any other mechanism by which I can achieve > it? > > > > > > Thanks, > > --Tapan. > > _______________________________________________ > > freebsd-geom@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-geom > > To unsubscribe, send any mail to "freebsd-geom-unsubscribe@freebsd.org" > > Hey, > > You're attempting to set up gmirror on a mounted device. > Unmount /dev/mirror/md0s1 then retry the gmirror command and it should > work. > > Cheers! > Mark > From owner-freebsd-geom@FreeBSD.ORG Thu Jul 10 14:42:17 2008 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0523106564A for ; Thu, 10 Jul 2008 14:42:17 +0000 (UTC) (envelope-from mark@legios.org) Received: from bade.legios.org (ppp198-172.static.internode.on.net [59.167.198.172]) by mx1.freebsd.org (Postfix) with ESMTP id 2EA808FC20 for ; Thu, 10 Jul 2008 14:42:17 +0000 (UTC) (envelope-from mark@legios.org) Received: from localhost (unknown [192.168.0.17]) by bade.legios.org (Postfix) with ESMTP id C5F451AD71E for ; Fri, 11 Jul 2008 00:41:54 +1000 (EST) X-Virus-Scanned: amavisd-new at legios.org Received: from bade.legios.org ([192.168.0.17]) by localhost (legios.org [192.168.0.17]) (amavisd-new, port 10024) with ESMTP id PsipiAQJdnFh for ; Fri, 11 Jul 2008 00:41:39 +1000 (EST) Received: from [192.168.0.200] (unknown [192.168.0.200]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by bade.legios.org (Postfix) with ESMTP id 61EF01AD6F5 for ; Fri, 11 Jul 2008 00:41:39 +1000 (EST) From: Mark Gladman To: freebsd-geom@freebsd.org Date: Fri, 11 Jul 2008 00:39:41 +1000 User-Agent: KMail/1.9.7 References: <482257ad0807100541s2d2c3d1eo6cd57c3a1bc338d1@mail.gmail.com> <200807102309.03191.mark@legios.org> <482257ad0807100655u1a5c660awfad05564e40e9a95@mail.gmail.com> In-Reply-To: <482257ad0807100655u1a5c660awfad05564e40e9a95@mail.gmail.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200807110039.42114.mark@legios.org> Subject: Re: Can GEOM be used to intercept the I/o calls to an existing mounted device? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2008 14:42:17 -0000 Ah, I see what you mean... Not as far as I'm aware - although there's people here much more knowledgeable on the subject than me. You can write the geom metadata to the mounted disk(s) by settings the following sysctl kern.geom.debugflags=16 (This is potentially unsafe, but for what you're doing it should be fine) Out of curiosities sake though, I did the follwing. (note - I had to do this on a zvol on this workstation, so hopefully it's not invalid) mount /dev/zvol/zpool0/test /mnt sysctl kern.geom.debugflags=16 gmirror label -v -n -b round-robin gm0 /dev/zvol/zpool0/test kldload geom_mirror However, if I then do mount /dev/mirror/test0 /mnt2 Then do *anything* involving /mnt2, it causes FreeBSD to keel over - not totally unexpected. I'm not sure if this helps - hopefully others can chime in. On Thursday 10 July 2008 23:55:40 Tapan Chaudhari wrote: > Thanks Mark, but unmounting will anyways work. But the problem here will > be, a new device "/dev/mirror/gm0" and "/dev/mirror/gm0s1" will be created > after > > :- > > #gmirror label -v -n -b round-robin gm0 /dev/md0 > #gmirror load > #gmirror configure -a gm0 > > and "/dev/md0s1" gets deleted. > Now I will have to mount the new device "/dev/mirror/gm0s1" to get my > original contents. > Can't I do it on the fly while the device is already mounted? I just want > that all the calls going to the device "/dev/md0s1" first come to me and > then it goes to the original device. In short intercepting the i/o calls. > Is there some way I can achieve this? > > Thanks, > > On Thu, Jul 10, 2008 at 6:39 PM, Mark Gladman wrote: > > On Thursday 10 July 2008 22:41:25 Tapan Chaudhari wrote: > > > Hi All, > > > I am a newbie to FreeBSD and GEOM. I wanted to intercept the i/o > > > > calls > > > > > going to a particular mounted device by writing some driver. > > > I came across geom and thought it might work. I tried to create a new > > > device, mount it and then tried using gmirror to mirror the device :- > > > > > > #dd if=/dev/zero of=file1 bs=1M count=10 > > > #dd if=/dev/zero of=file2 bs=1M count=10 > > > #mdconfig -f file1 > > > #mdconfig -f file2 > > > #fdisk -B /dev/mirror/md0 > > > #newfs /dev/mirror/md0s1 > > > #mkdir /mnt/mirror0 > > > #mount /dev/mirror/md0s1 /mnt/mirror0/ > > > > > > #gmirror label -v -n -b round-robin gm0 /dev/md0 > > > gmirror: Can't store metadata on /dev/md0: Operation not permitted. > > > > > > It gave me this error "gmirror: Can't store metadata on /dev/md0: > > > > Operation > > > > > not permitted." > > > > > > Am I doing something wrong? Or GEOM does not permit me intercept the > > > i/o calls? If not geom, is there any other mechanism by which I can > > > achieve > > > > it? > > > > > Thanks, > > > --Tapan. > > > _______________________________________________ > > > freebsd-geom@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-geom > > > To unsubscribe, send any mail to "freebsd-geom-unsubscribe@freebsd.org" > > > > Hey, > > > > You're attempting to set up gmirror on a mounted device. > > Unmount /dev/mirror/md0s1 then retry the gmirror command and it should > > work. > > > > Cheers! > > Mark > > _______________________________________________ > freebsd-geom@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-geom > To unsubscribe, send any mail to "freebsd-geom-unsubscribe@freebsd.org" From owner-freebsd-geom@FreeBSD.ORG Thu Jul 10 19:19:54 2008 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94F55106564A for ; Thu, 10 Jul 2008 19:19:54 +0000 (UTC) (envelope-from gcubfg-freebsd-geom@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 50E258FC1B for ; Thu, 10 Jul 2008 19:19:54 +0000 (UTC) (envelope-from gcubfg-freebsd-geom@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KH1gD-0004Lo-Qy for freebsd-geom@freebsd.org; Thu, 10 Jul 2008 19:19:49 +0000 Received: from 78-0-89-102.adsl.net.t-com.hr ([78.0.89.102]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Jul 2008 19:19:49 +0000 Received: from ivoras by 78-0-89-102.adsl.net.t-com.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Jul 2008 19:19:49 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-geom@freebsd.org From: Ivan Voras Date: Thu, 10 Jul 2008 21:19:35 +0200 Lines: 38 Message-ID: References: <482257ad0807100541s2d2c3d1eo6cd57c3a1bc338d1@mail.gmail.com> <200807102309.03191.mark@legios.org> <482257ad0807100655u1a5c660awfad05564e40e9a95@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig14946CCF175CE727EF6B3025" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 78-0-89-102.adsl.net.t-com.hr User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) In-Reply-To: <482257ad0807100655u1a5c660awfad05564e40e9a95@mail.gmail.com> X-Enigmail-Version: 0.95.6 Sender: news Subject: Re: Can GEOM be used to intercept the I/o calls to an existing mounted device? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2008 19:19:54 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig14946CCF175CE727EF6B3025 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Tapan Chaudhari wrote: > Can't I do it on the fly while the device is already mounted? I just wa= nt > that all the calls going to the device "/dev/md0s1" first come to me an= d > then it goes to the original device. In short intercepting the i/o call= s. Is > there some way I can achieve this? It would be very nice if GEOM could do this, since it would then=20 trivially allow things like data replication, log/rollback, etc. but it=20 doesn't work like that. In short, no, you cannot listen to IO between=20 providers. (not that it isn't possible to do at all, it just isn't implemented). --------------enig14946CCF175CE727EF6B3025 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIdmDIldnAQVacBcgRAqr9AJ9vAhSfb6e2a29Y4NxAn2QNWRTRpACg8Ht7 z86ZtogEdVF0NwgAb0JoHC8= =M/JJ -----END PGP SIGNATURE----- --------------enig14946CCF175CE727EF6B3025-- From owner-freebsd-geom@FreeBSD.ORG Thu Jul 10 22:02:37 2008 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70104106568B; Thu, 10 Jul 2008 22:02:37 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 36D6D8FC13; Thu, 10 Jul 2008 22:02:36 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.64.3]) by phk.freebsd.dk (Postfix) with ESMTP id 4AB6E170E3; Thu, 10 Jul 2008 22:02:35 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.2/8.14.2) with ESMTP id m6AM2YoL050706; Thu, 10 Jul 2008 22:02:35 GMT (envelope-from phk@critter.freebsd.dk) To: Ivan Voras From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 10 Jul 2008 21:19:35 +0200." Date: Thu, 10 Jul 2008 22:02:34 +0000 Message-ID: <50705.1215727354@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: freebsd-geom@freebsd.org Subject: Re: Can GEOM be used to intercept the I/o calls to an existing mounted device? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2008 22:02:37 -0000 In message , Ivan Voras writes: >> Can't I do it on the fly while the device is already mounted? I just wa= >nt >> that all the calls going to the device "/dev/md0s1" first come to me an= >d >> then it goes to the original device. In short intercepting the i/o call= >s. Is >> there some way I can achieve this? > >It would be very nice if GEOM could do this, since it would then=20 >trivially allow things like data replication, log/rollback, etc. but it=20 >doesn't work like that. In short, no, you cannot listen to IO between=20 >providers. > >(not that it isn't possible to do at all, it just isn't implemented). The GEOM design allows for insertions, where a 1:1 GEOM class is inserted in an existing provider-consumer connection. The traditional example was: insert mirror module add disk to mirror replicate drop original disk from mirror remove mirror module. I may still have the code that can do this in a src tree somewhere, but it never got to the surface of my TODO list. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-geom@FreeBSD.ORG Thu Jul 10 23:42:35 2008 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 293C61065676 for ; Thu, 10 Jul 2008 23:42:35 +0000 (UTC) (envelope-from mark@legios.org) Received: from bade.legios.org (ppp198-172.static.internode.on.net [59.167.198.172]) by mx1.freebsd.org (Postfix) with ESMTP id D623E8FC1D for ; Thu, 10 Jul 2008 23:42:34 +0000 (UTC) (envelope-from mark@legios.org) Received: from localhost (unknown [192.168.0.17]) by bade.legios.org (Postfix) with ESMTP id 0213A1AD735 for ; Fri, 11 Jul 2008 09:42:13 +1000 (EST) X-Virus-Scanned: amavisd-new at legios.org Received: from bade.legios.org ([192.168.0.17]) by localhost (legios.org [192.168.0.17]) (amavisd-new, port 10024) with ESMTP id xGbr9iRFVINI for ; Fri, 11 Jul 2008 09:41:58 +1000 (EST) Received: from [192.168.0.200] (unknown [192.168.0.200]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by bade.legios.org (Postfix) with ESMTP id 2E9AD1AD72C for ; Fri, 11 Jul 2008 09:41:58 +1000 (EST) From: Mark Gladman To: freebsd-geom@freebsd.org Date: Fri, 11 Jul 2008 09:40:05 +1000 User-Agent: KMail/1.9.7 References: <482257ad0807100541s2d2c3d1eo6cd57c3a1bc338d1@mail.gmail.com> <482257ad0807100655u1a5c660awfad05564e40e9a95@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807110940.05862.mark@legios.org> Subject: Re: Can GEOM be used to intercept the I/o calls to an existing mounted device? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2008 23:42:35 -0000 On Friday 11 July 2008 05:19:35 Ivan Voras wrote: > Tapan Chaudhari wrote: > > Can't I do it on the fly while the device is already mounted? I just want > > that all the calls going to the device "/dev/md0s1" first come to me and > > then it goes to the original device. In short intercepting the i/o calls. > > Is there some way I can achieve this? > > It would be very nice if GEOM could do this, since it would then > trivially allow things like data replication, log/rollback, etc. but it > doesn't work like that. In short, no, you cannot listen to IO between > providers. > > (not that it isn't possible to do at all, it just isn't implemented). Whoops - I was *totally* focussing on the wrong part of his question... (It was late, that's my excuse. :) From owner-freebsd-geom@FreeBSD.ORG Fri Jul 11 18:29:10 2008 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA358106566B for ; Fri, 11 Jul 2008 18:29:10 +0000 (UTC) (envelope-from tapan.list@gmail.com) Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.235]) by mx1.freebsd.org (Postfix) with ESMTP id 9ADA28FC08 for ; Fri, 11 Jul 2008 18:29:10 +0000 (UTC) (envelope-from tapan.list@gmail.com) Received: by qb-out-0506.google.com with SMTP id q12so395987qbq.13 for ; Fri, 11 Jul 2008 11:29:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=nQk0nVg2S88l93HtiFccP1Sj47No4TrOM4aDDdwQCmk=; b=TB8TxRV/og1VEa1HRwzykHD0GI0T6AuIF57dxS2sVntAxxwJtIGnZoMVmTP99KStPR RenN9HrQxcD79ZNgMruqK9lzPMrVJEl3xw3wBF0YLEnXG6oE1B1DhcCqcPFI7uPzd9bB bN2gWQ+U9pYubwlOLJXKThzKxH6iVCHcmdsTA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=Wm4XmvD0EEJXE+VjoXDV30bZadj8tZR8ULW0XcikKzWbg3uaAwGdcV40kKok5PTN5n QDQvAPgOUzSX7cLdJT5KkIdYMdbnt8xX2ShBwfxWu3citmVl8LZ88kIFDRM86Fn+YRMZ ok2RQ0t2hBjPUHj7gZFnHqt0KQCQoO6blAVgI= Received: by 10.103.222.12 with SMTP id z12mr5649257muq.12.1215800949167; Fri, 11 Jul 2008 11:29:09 -0700 (PDT) Received: by 10.103.227.19 with HTTP; Fri, 11 Jul 2008 11:29:09 -0700 (PDT) Message-ID: <482257ad0807111129i66ac4372sbc9b4d4ef7675e9d@mail.gmail.com> Date: Fri, 11 Jul 2008 23:59:09 +0530 From: "Tapan Chaudhari" To: freebsd-geom@freebsd.org In-Reply-To: <482257ad0807100655u1a5c660awfad05564e40e9a95@mail.gmail.com> MIME-Version: 1.0 References: <482257ad0807100541s2d2c3d1eo6cd57c3a1bc338d1@mail.gmail.com> <200807102309.03191.mark@legios.org> <482257ad0807100655u1a5c660awfad05564e40e9a95@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Can GEOM be used to intercept the I/o calls to an existing mounted device? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2008 18:29:11 -0000 Hey guys, First of all, I was not able to receive your replies to my mail. I don't know the reason but I am already subscribed to the list. I got to know about your replies from the digest i received today. I have written a mail to the mailing list owner describing this problem. Hope this does not happen again. Well regarding GEOM as Poul mentioned he has already done this interception mechanism in GEOM, Poul can you please help me out by giving some directions as to how to move ahead and implement the interceptions of i/o to a particular device? I would be really happy to get any help regarding the interception mechanism. Thanks, --Tapan. On Thu, Jul 10, 2008 at 7:25 PM, Tapan Chaudhari wrote: > Thanks Mark, but unmounting will anyways work. But the problem here will > be, a new device "/dev/mirror/gm0" and "/dev/mirror/gm0s1" will be created > after :- > > #gmirror label -v -n -b round-robin gm0 /dev/md0 > #gmirror load > #gmirror configure -a gm0 > > and "/dev/md0s1" gets deleted. > Now I will have to mount the new device "/dev/mirror/gm0s1" to get my > original contents. > Can't I do it on the fly while the device is already mounted? I just want > that all the calls going to the device "/dev/md0s1" first come to me and > then it goes to the original device. In short intercepting the i/o calls. Is > there some way I can achieve this? > > Thanks, > > > On Thu, Jul 10, 2008 at 6:39 PM, Mark Gladman wrote: > >> On Thursday 10 July 2008 22:41:25 Tapan Chaudhari wrote: >> > Hi All, >> > I am a newbie to FreeBSD and GEOM. I wanted to intercept the i/o >> calls >> > going to a particular mounted device by writing some driver. >> > I came across geom and thought it might work. I tried to create a new >> > device, mount it and then tried using gmirror to mirror the device :- >> > >> > #dd if=/dev/zero of=file1 bs=1M count=10 >> > #dd if=/dev/zero of=file2 bs=1M count=10 >> > #mdconfig -f file1 >> > #mdconfig -f file2 >> > #fdisk -B /dev/mirror/md0 >> > #newfs /dev/mirror/md0s1 >> > #mkdir /mnt/mirror0 >> > #mount /dev/mirror/md0s1 /mnt/mirror0/ >> > >> > #gmirror label -v -n -b round-robin gm0 /dev/md0 >> > gmirror: Can't store metadata on /dev/md0: Operation not permitted. >> > >> > It gave me this error "gmirror: Can't store metadata on /dev/md0: >> Operation >> > not permitted." >> > >> > Am I doing something wrong? Or GEOM does not permit me intercept the i/o >> > calls? If not geom, is there any other mechanism by which I can achieve >> it? >> > >> > >> > Thanks, >> > --Tapan. >> > _______________________________________________ >> > freebsd-geom@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/freebsd-geom >> > To unsubscribe, send any mail to "freebsd-geom-unsubscribe@freebsd.org" >> >> Hey, >> >> You're attempting to set up gmirror on a mounted device. >> Unmount /dev/mirror/md0s1 then retry the gmirror command and it should >> work. >> >> Cheers! >> Mark >> > > From owner-freebsd-geom@FreeBSD.ORG Fri Jul 11 19:09:05 2008 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D43410656BF for ; Fri, 11 Jul 2008 19:09:05 +0000 (UTC) (envelope-from tapan.list@gmail.com) Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.229]) by mx1.freebsd.org (Postfix) with ESMTP id C65878FC2B for ; Fri, 11 Jul 2008 19:09:04 +0000 (UTC) (envelope-from tapan.list@gmail.com) Received: by qb-out-0506.google.com with SMTP id o21so1323137qba.7 for ; Fri, 11 Jul 2008 12:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=VQvVlvHG+8Lj+OndTll/aTHKrOPl8sHXRl3weJ8oqPM=; b=uQbRhjmkOY32edGhhY1dU1wJH+HusYED2z5DOT3l4z1YiJ8DtCn9uKUVq2I5ONFse0 HSqOmb2CuITMIGOYTUVePuJqmzUOKZ9eFHp9xIE64cc1br3DqY4c9R9yFTtSayN6CPfu eR6cWpXHV0Hvs0cQZJLnE3Vr0bpp7cCNgBMXM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=TV4/aP1KwLQkVKWPZSteWRf0Ub01+2pePH3cbYZ+q0+qaMDulwkyp3rXReJS5is6zi n3rGDKLpes6uQtOxt4OpJ5aA8U4Mu4LdRhQOUsyWyu107BjqsRZGs2OzodZjpH7DswtP 6Welj8UciAkOuC+hil0WJ3o8XpUvS0YsTIgYY= Received: by 10.103.192.10 with SMTP id u10mr5664612mup.29.1215803343217; Fri, 11 Jul 2008 12:09:03 -0700 (PDT) Received: by 10.103.227.19 with HTTP; Fri, 11 Jul 2008 12:09:03 -0700 (PDT) Message-ID: <482257ad0807111209g20cdb0f6j9f7000fd57a7287a@mail.gmail.com> Date: Sat, 12 Jul 2008 00:39:03 +0530 From: "Tapan Chaudhari" To: freebsd-geom@freebsd.org In-Reply-To: <482257ad0807111129i66ac4372sbc9b4d4ef7675e9d@mail.gmail.com> MIME-Version: 1.0 References: <482257ad0807100541s2d2c3d1eo6cd57c3a1bc338d1@mail.gmail.com> <200807102309.03191.mark@legios.org> <482257ad0807100655u1a5c660awfad05564e40e9a95@mail.gmail.com> <482257ad0807111129i66ac4372sbc9b4d4ef7675e9d@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Can GEOM be used to intercept the I/o calls to an existing mounted device? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2008 19:09:05 -0000 Hi, I got the problem resolved of not getting mails. It was the stupid of me that changed the settings :-).. I have unchecked the digest. Did Ivan sent some attachment with the mail? An attachment was scrubbed in the digest I received. Sorry for the trouble but still, can anyone resend it? Expecting some help regarding "interception mechanism" from all of you. Thanks, --Tapan. On Fri, Jul 11, 2008 at 11:59 PM, Tapan Chaudhari wrote: > Hey guys, > First of all, I was not able to receive your replies to my mail. I > don't know the reason but I am already subscribed to the list. I got to know > about your replies from the digest i received today. I have written a mail > to the mailing list owner describing this problem. Hope this does not happen > again. > > > Well regarding GEOM as Poul mentioned he has already done this interception > mechanism in GEOM, Poul can you please help me out by giving some directions > as to how to move ahead and implement the interceptions of i/o to a > particular device? I would be really happy to get any help regarding the > interception mechanism. > > Thanks, > --Tapan. > > > On Thu, Jul 10, 2008 at 7:25 PM, Tapan Chaudhari > wrote: > >> Thanks Mark, but unmounting will anyways work. But the problem here will >> be, a new device "/dev/mirror/gm0" and "/dev/mirror/gm0s1" will be created >> after :- >> >> #gmirror label -v -n -b round-robin gm0 /dev/md0 >> #gmirror load >> #gmirror configure -a gm0 >> >> and "/dev/md0s1" gets deleted. >> Now I will have to mount the new device "/dev/mirror/gm0s1" to get my >> original contents. >> Can't I do it on the fly while the device is already mounted? I just want >> that all the calls going to the device "/dev/md0s1" first come to me and >> then it goes to the original device. In short intercepting the i/o calls. Is >> there some way I can achieve this? >> >> Thanks, >> >> >> On Thu, Jul 10, 2008 at 6:39 PM, Mark Gladman wrote: >> >>> On Thursday 10 July 2008 22:41:25 Tapan Chaudhari wrote: >>> > Hi All, >>> > I am a newbie to FreeBSD and GEOM. I wanted to intercept the i/o >>> calls >>> > going to a particular mounted device by writing some driver. >>> > I came across geom and thought it might work. I tried to create a new >>> > device, mount it and then tried using gmirror to mirror the device :- >>> > >>> > #dd if=/dev/zero of=file1 bs=1M count=10 >>> > #dd if=/dev/zero of=file2 bs=1M count=10 >>> > #mdconfig -f file1 >>> > #mdconfig -f file2 >>> > #fdisk -B /dev/mirror/md0 >>> > #newfs /dev/mirror/md0s1 >>> > #mkdir /mnt/mirror0 >>> > #mount /dev/mirror/md0s1 /mnt/mirror0/ >>> > >>> > #gmirror label -v -n -b round-robin gm0 /dev/md0 >>> > gmirror: Can't store metadata on /dev/md0: Operation not permitted. >>> > >>> > It gave me this error "gmirror: Can't store metadata on /dev/md0: >>> Operation >>> > not permitted." >>> > >>> > Am I doing something wrong? Or GEOM does not permit me intercept the >>> i/o >>> > calls? If not geom, is there any other mechanism by which I can achieve >>> it? >>> > >>> > >>> > Thanks, >>> > --Tapan. >>> > _______________________________________________ >>> > freebsd-geom@freebsd.org mailing list >>> > http://lists.freebsd.org/mailman/listinfo/freebsd-geom >>> > To unsubscribe, send any mail to "freebsd-geom-unsubscribe@freebsd.org >>> " >>> >>> Hey, >>> >>> You're attempting to set up gmirror on a mounted device. >>> Unmount /dev/mirror/md0s1 then retry the gmirror command and it should >>> work. >>> >>> Cheers! >>> Mark >>> >> >> >