From owner-freebsd-geom@FreeBSD.ORG Sun Apr 3 17:49:04 2011 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 62504106566B; Sun, 3 Apr 2011 17:49:04 +0000 (UTC) (envelope-from rozhuk.im@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9563A8FC13; Sun, 3 Apr 2011 17:49:03 +0000 (UTC) Received: by wyf23 with SMTP id 23so4876864wyf.13 for ; Sun, 03 Apr 2011 10:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:reply-to:from:to:references:in-reply-to:subject :date:message-id:mime-version:content-type:x-mailer:thread-index :content-language; bh=XjucrDGwg7rwm3zKKXa0klX4HzcdnGXIhfDhlnS+Rb0=; b=IGcI+sWtrV9Pon41SDY2Io1nilTrzo1ikoDx4wjz0BshPOIZyCp8qFFnEuDCFKciUw KwMTDaDCL26GT3OQnqvSh7/Tr4a3FnhKhrvJqXmMg8kkjSr0c5bnVG3znSXljl2sLgx5 1XfFS09Z/G288eH3yKto37AepJxRsqUI7IIuU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=reply-to:from:to:references:in-reply-to:subject:date:message-id :mime-version:content-type:x-mailer:thread-index:content-language; b=N1HCFuD13kDcfHJkz0kOIQZfb3O6PdojVEvso0jeFGdG5LLpuJlk7vg8fhPOINB/9S g8lRCsERPGjI0WpEXpnCg5Zg0pPpym4gsGabXGAsHbixDxdfOqfuRQHNAu4BVuScUllu nFr5JATqbYXtFcP96BnrR+zGX2obFi22G4AAA= Received: by 10.227.131.195 with SMTP id y3mr6549046wbs.38.1301852942462; Sun, 03 Apr 2011 10:49:02 -0700 (PDT) Received: from rimwks1x64 ([92.124.4.68]) by mx.google.com with ESMTPS id l24sm2460781wbc.13.2011.04.03.10.48.58 (version=SSLv3 cipher=OTHER); Sun, 03 Apr 2011 10:49:01 -0700 (PDT) From: rozhuk.im@gmail.com To: , References: <4d9351fb.1d32dc0a.2d95.070c@mx.google.com> <56D961DF-74C4-4E1B-B7F5-60E0E939DE8E@bsdimp.com> <4d938233.1192e60a.2761.1205@mx.google.com> <20110330232735.3768cbb6.ray@ddteam.net> In-Reply-To: <20110330232735.3768cbb6.ray@ddteam.net> Date: Mon, 4 Apr 2011 02:48:56 +0900 Message-ID: <4d98b30d.581ce30a.3a77.ffffc4d6@mx.google.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0076_01CBF272.D99FC070" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcvvGPDlbGt7V8EPRXOLtFY/OnVGFgDCw1sA Content-Language: ru Cc: Subject: RE: merge geom redboot and map X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Rozhuk.IM@gmail.com List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Apr 2011 17:49:04 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0076_01CBF272.D99FC070 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable Hi all! I need Your help with testing and adding code to FreeBSD sources. Not tested: - redboot/FIS - map search by key Build options: options GEOM_MAP #=20 options GEOM_MAP_NO_REDBOOT # turn off redboot/fis support Static mappings in hints: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D # Area 0: 30000000 to 3002FFFF (0 - 196607, size: 196607) : = "Bootloader": u-boot # Area 1: 30030000 to 3003FFFF (196608 - 262143, size: 65535) : = "Factory": u-boot env # Area 2: 30040000 to 3023FFFF (262144 - 2359295, size: 2097151) : = "Kernel" # Area 3: 30240000 to 307FFFFF (2359296 - 8388607, size: 6029311) : = "RootFS" hint.map.0.at =3D "flash/spi0" hint.map.0.start =3D 0x00000000 hint.map.0.end =3D 0x00030000 hint.map.0.name =3D "bootldr" hint.map.0.readonly =3D1 hint.map.1.at =3D "flash/spi0" hint.map.1.start =3D 0x00030000 hint.map.1.end =3D 0x00040000 hint.map.1.name =3D "bootldr_env" hint.map.1.readonly =3D1 hint.map.2.at =3D "flash/spi0" hint.map.2.start =3D 0x00040000 hint.map.2.end =3D 0x00240000 hint.map.2.name =3D "kernel" hint.map.2.readonly =3D0 hint.map.3.at =3D "flash/spi0" hint.map.3.start =3D 0x00240000 hint.map.3.end =3D 0x00800000 hint.map.3.name =3D "rootfs" hint.map.3.readonly =3D0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D Boot log: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D ... GEOM_MAP: /dev/flash/spi0: 0x00000000-0x00030000, offset=3D0x0, R/O, size=3D196608 bytes at: "/dev/map/spi0bootldr" GEOM_MAP: /dev/flash/spi0: 0x00030000-0x00040000, offset=3D0x0, R/O, size=3D65536 bytes at: "/dev/map/spi0bootldr_env" GEOM_MAP: /dev/flash/spi0: 0x00040000-0x00240000, offset=3D0x0, R/W, size=3D2097152 bytes at: "/dev/map/spi0kernel" GEOM_MAP: /dev/flash/spi0: 0x00240000-0x00800000, offset=3D0x0, R/W, size=3D6029312 bytes at: "/dev/map/spi0rootfs" GEOM_MAP: /dev/flash/spi0: FIS/RedBoot not exist, incompatible = blksize=3D0 GEOM_MAP: /dev/flash/spi0: mediasize=3D8388608, secsize=3D65536, = blksize=3D0 ... GEOM_MAP: /dev/da0: FIS/RedBoot not exist, incompatible blksize=3D0 GEOM_MAP: /dev/da0p1: FIS/RedBoot not exist, incompatible blksize=3D0 GEOM_MAP: /dev/gpt/Documental: FIS/RedBoot not exist, incompatible = blksize=3D0 GEOM_MAP: /dev/gptid/ca70d533-5759-11e0-b900-001a4d559a42: FIS/RedBoot = not exist, incompatible blksize=3D0 Mounting local file systems:GEOM_MAP: /dev/md0: FIS/RedBoot not exist, incompatible blksize=3D0 GEOM_MAP: /dev/ufsid/4d98a59e587419bf: FIS/RedBoot not exist, = incompatible blksize=3D0 GEOM_MAP: /dev/md0: FIS/RedBoot not exist, incompatible blksize=3D0 GEOM_MAP: /dev/ufsid/4d98a967c292e50d: FIS/RedBoot not exist, = incompatible blksize=3D0 GEOM_MAP: /dev/md1: FIS/RedBoot not exist, incompatible blksize=3D0 GEOM_MAP: /dev/md1: FIS/RedBoot not exist, incompatible blksize=3D0 GEOM_MAP: /dev/ufsid/4d98a968674909d4: FIS/RedBoot not exist, = incompatible blksize=3D0 ... =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D Files: - geom_map.c - source of geom node - options_add_geom_map.txt - patch to add build options - subr_hints.txt - kernel api to read 64bit values from hints http://www.freebsd.org/cgi/query-pr.cgi?pr=3D156130 =A0 -- Rozhuk Ivan =A0=20 > -----Original Message----- > From: Aleksandr Rybalko [mailto:ray@ddteam.net] > Sent: Thursday, March 31, 2011 5:28 AM > To: Rozhuk.IM@gmail.com > Cc: rozhuk.im@gmail.com; 'Warner Losh'; freebsd-arm@freebsd.org; > freebsd-geom@freebsd.org > Subject: Re: merge geom redboot and map >=20 > Hi all, >=20 > On Thu, 31 Mar 2011 04:19:11 +0900 > rozhuk.im@gmail.com wrote: >=20 > > > > > > I need your opinions, suggestions and help with testing and > > > > including > > > code > > > > to main stream source tree. > > > > > > I think this likely is a good refactoring. > > > > > > > PS: I can test only "map" part on my Agestar LB2. > > > > > > But please make sure FIS still works. > > > > I hope peoples with redboot hardware help with testing. > > > > > > Another question is path to mapped block (partition)? > > > > Now > > - redboot: /dev/redboot/%name > > - map: /dev/map/%name > > > > Variants: > > 1. stay as is > > 2. /dev/flash/%name > > 3. ? >=20 > 3. /dev/flash/spi0kernel, /dev/flash/spi0rootfs, ... >=20 > IMO, /dev/map/ more generic :) >=20 > > > > _______________________________________________ > > freebsd-arm@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > > To unsubscribe, send any mail to "freebsd-arm- > unsubscribe@freebsd.org" >=20 > P.S. >=20 > I think GEOM_FLASH_NO_MAP not needed, > because this modules differ only on configuration source, > REDBOOT partition map and hints, so maybe only GEOM_FLASH_NO_REDBOOT = to > avoid unwanted read. >=20 > WBW > -- > Aleksandr Rybalko ------=_NextPart_000_0076_01CBF272.D99FC070 Content-Type: text/plain; name="subr_hints.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="subr_hints.txt" --- /usr/src/sys/kern/subr_hints_orig.c 2009-08-03 17:13:06.000000000 = +0900 +++ /usr/src/sys/kern/subr_hints.c 2011-04-03 18:10:57.000000000 = +0900 @@ -273,6 +273,30 @@ return 0; } =20 + +int +resource_quad_t_value(const char *name, int unit, const char *resname, = quad_t *result) +{ + int error; + const char *str; + char *op; + quad_t val; + int line; + + line =3D 0; + error =3D resource_find(&line, NULL, name, &unit, resname, NULL, + NULL, NULL, NULL, NULL, NULL, &str); + if (error) + return error; + if (*str =3D=3D '\0')=20 + return EFTYPE; + val =3D strtoq(str, &op, 0); + if (*op !=3D '\0')=20 + return EFTYPE; + *result =3D val; + return 0; +} + int resource_string_value(const char *name, int unit, const char *resname, const char **result) --- /usr/src/sys/sys/bus.h_orig 2011-02-09 06:08:00.000000000 +0800 +++ /usr/src/sys/sys/bus.h 2011-04-03 18:13:07.000000000 +0900 @@ -470,6 +470,8 @@ int *result); int resource_long_value(const char *name, int unit, const char = *resname, long *result); +int resource_quad_t_value(const char *name, int unit, const char = *resname, + quad_t *result); int resource_string_value(const char *name, int unit, const char = *resname, const char **result); int resource_disabled(const char *name, int unit); ------=_NextPart_000_0076_01CBF272.D99FC070 Content-Type: text/plain; name="geom_map.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="geom_map.c" /*-=0A= * Copyright (c) 2009 Aleksandr Rybalko AKA Alex RAY, DDTeam.net=0A= * based on geom_redboot.c=0A= * Copyright (c) 2009 Sam Leffler, Errno Consulting=0A= * All rights reserved.=0A= *=0A= * Redistribution and use in source and binary forms, with or without=0A= * modification, are permitted provided that the following conditions=0A= * are met:=0A= * 1. Redistributions of source code must retain the above copyright=0A= * notice, this list of conditions and the following disclaimer,=0A= * without modification.=0A= * 2. Redistributions in binary form must reproduce at minimum a = disclaimer=0A= * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and = any=0A= * redistribution must be conditioned upon including a substantially=0A= * similar Disclaimer requirement for further binary redistribution.=0A= *=0A= * NO WARRANTY=0A= * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=0A= * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT=0A= * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY=0A= * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL=0A= * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, = EXEMPLARY,=0A= * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT = OF=0A= * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR = BUSINESS=0A= * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER=0A= * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR = OTHERWISE)=0A= * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF=0A= * THE POSSIBILITY OF SUCH DAMAGES.=0A= */=0A= =0A= =0A= #include =0A= __FBSDID("$FreeBSD$");=0A= =0A= #include =0A= #include =0A= #include =0A= #include =0A= #include =0A= #include =0A= #include =0A= #include =0A= #include =0A= #include =0A= #include =0A= =0A= #include =0A= #include =0A= #include =0A= #include "opt_geom.h"=0A= =0A= =0A= #define MAP_CLASS_NAME "MAP"=0A= #define MAP_MAXSLICE 64=0A= #define MAP_SEARCH_KEY_LEN_MAX 255=0A= #define MAP_SEARCH_STEP_DEF 0x10000U=0A= =0A= =0A= struct g_map_softc {=0A= g_access_t *parent_access;=0A= off_t entry[MAP_MAXSLICE]; /* offset in image for entry point */=0A= off_t dsize[MAP_MAXSLICE]; /* data size in bytes */=0A= u_int readonly[MAP_MAXSLICE];=0A= };=0A= =0A= =0A= =0A= #if !defined(GEOM_MAP_NO_REDBOOT)=0A= =0A= struct fis_image_desc {=0A= uint8_t name [16]; /* null-terminated name */=0A= uint32_t offset; /* offset in flash */=0A= uint32_t addr; /* address in memory */=0A= uint32_t size; /* image size in bytes */=0A= uint32_t entry; /* offset in image for entry point */=0A= uint32_t dsize; /* data size in bytes */=0A= uint8_t pad[256-(16+7*sizeof(uint32_t)+sizeof(void*))];=0A= struct fis_image_desc *next; /* linked list (in memory) */=0A= uint32_t dsum; /* descriptor checksum */=0A= uint32_t fsum; /* checksum over image data */=0A= };=0A= =0A= #define FISDIR_NAME "FIS directory"=0A= #define REDBCFG_NAME "RedBoot config"=0A= #define REDBOOT_NAME "RedBoot"=0A= =0A= #endif /* !defined(GEOM_MAP_NO_REDBOOT) */=0A= =0A= =0A= =0A= =0A= static int=0A= g_map_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag, = struct thread *td)=0A= {=0A= return (ENOIOCTL);=0A= }=0A= =0A= static int=0A= g_map_access(struct g_provider *pp, int dread, int dwrite, int dexcl)=0A= {=0A= struct g_geom *gp =3D pp->geom;=0A= struct g_slicer *gsp =3D gp->softc;=0A= struct g_map_softc *sc =3D gsp->softc;=0A= =0A= if (dwrite > 0 && sc->readonly[pp->index])=0A= return (EPERM);=0A= return (sc->parent_access(pp, dread, dwrite, dexcl)); =0A= }=0A= =0A= static int=0A= g_map_start(struct bio *bp)=0A= {=0A= struct g_provider *pp;=0A= struct g_geom *gp;=0A= struct g_map_softc *sc;=0A= struct g_slicer *gsp;=0A= int idx;=0A= =0A= pp =3D bp->bio_to;=0A= idx =3D pp->index;=0A= gp =3D pp->geom;=0A= gsp =3D gp->softc;=0A= sc =3D gsp->softc;=0A= if (bp->bio_cmd =3D=3D BIO_GETATTR) {=0A= if (g_handleattr_off_t(bp, MAP_CLASS_NAME "::entry", sc->entry[idx]))=0A= return (1);=0A= if (g_handleattr_off_t(bp, MAP_CLASS_NAME "::dsize", sc->dsize[idx]))=0A= return (1);=0A= }=0A= return (0);=0A= }=0A= =0A= static void=0A= g_map_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp,=0A= struct g_consumer *cp __unused, struct g_provider *pp)=0A= {=0A= struct g_map_softc *sc;=0A= struct g_slicer *gsp;=0A= =0A= gsp =3D gp->softc;=0A= sc =3D gsp->softc;=0A= g_slice_dumpconf(sb, indent, gp, cp, pp);=0A= if (pp !=3D NULL) {=0A= if (indent =3D=3D NULL) {=0A= sbuf_printf(sb, " entry %jd", sc->entry[pp->index]);=0A= sbuf_printf(sb, " dsize %jd", sc->dsize[pp->index]);=0A= sbuf_printf(sb, " readonly %u", sc->readonly[pp->index]);=0A= } else {=0A= sbuf_printf(sb, "%s%jd\n", indent, = sc->entry[pp->index]);=0A= sbuf_printf(sb, "%s%jd\n", indent, = sc->dsize[pp->index]);=0A= sbuf_printf(sb, "%s%u\n", indent, = sc->readonly[pp->index]);=0A= }=0A= }=0A= }=0A= =0A= =0A= =0A= #include =0A= =0A= =0A= =0A= #if !defined(GEOM_MAP_NO_REDBOOT)=0A= =0A= static void=0A= g_map_print_redboot(int i, struct fis_image_desc *fd)=0A= {=0A= printf("[%2d] \"%-15.15s\" %08x:%08x", i, fd->name, fd->offset, = fd->size);=0A= printf(" addr %08x entry %08x\n", fd->addr, fd->entry);=0A= printf(" dsize 0x%x dsum 0x%x fsum 0x%x\n", fd->dsize, fd->dsum, = fd->fsum);=0A= }=0A= =0A= =0A= static int=0A= nameok(const char name[16])=0A= {=0A= int i;=0A= =0A= /* descriptor names are null-terminated printable ascii */=0A= for (i =3D 0; i < 15; i++)=0A= if (!isprint(name[i]))=0A= break;=0A= return (name[i] =3D=3D '\0');=0A= }=0A= =0A= =0A= static struct fis_image_desc *=0A= parse_fis_directory(u_char *buf, size_t bufsize, off_t offset, uint32_t = offmask)=0A= {=0A= #define match(a,b) (bcmp(a, b, sizeof(b)-1) =3D=3D 0)=0A= struct fis_image_desc *fd, *efd;=0A= struct fis_image_desc *fisdir, *redbcfg;=0A= struct fis_image_desc *head, **tail;=0A= int i;=0A= =0A= fd =3D (struct fis_image_desc *)buf;=0A= efd =3D fd + (bufsize / sizeof(struct fis_image_desc));=0A= #if 0=0A= /*=0A= * Find the start of the FIS table.=0A= */=0A= while (fd < efd && fd->name[0] !=3D 0xff)=0A= fd++;=0A= if (fd =3D=3D efd)=0A= return (NULL);=0A= if (bootverbose)=0A= printf("RedBoot FIS table starts at 0x%jx\n",=0A= offset + fd - (struct fis_image_desc *) buf);=0A= #endif=0A= /*=0A= * Scan forward collecting entries in a list.=0A= */=0A= fisdir =3D redbcfg =3D NULL;=0A= *(tail =3D &head) =3D NULL;=0A= for (i =3D 0; fd < efd; i++, fd++) {=0A= if (fd->name[0] =3D=3D 0xff)=0A= continue;=0A= if (match(fd->name, FISDIR_NAME))=0A= fisdir =3D fd;=0A= else if (match(fd->name, REDBCFG_NAME))=0A= redbcfg =3D fd;=0A= if (nameok(fd->name)) {=0A= /*=0A= * NB: flash address includes platform mapping;=0A= * strip it so we have only a flash offset.=0A= */=0A= fd->offset &=3D offmask;=0A= if (bootverbose)=0A= g_map_print_redboot(i, fd);=0A= *tail =3D fd;=0A= *(tail =3D &fd->next) =3D NULL;=0A= }=0A= }=0A= if (fisdir =3D=3D NULL) {=0A= if (bootverbose)=0A= printf("No RedBoot FIS table located at %ju\n", offset);=0A= return (NULL);=0A= }=0A= if (redbcfg !=3D NULL &&=0A= fisdir->offset + fisdir->size =3D=3D redbcfg->offset) {=0A= /*=0A= * Merged FIS/RedBoot config directory.=0A= */=0A= if (bootverbose)=0A= printf("FIS/RedBoot merged at 0x%jx (not yet)\n",=0A= offset + fisdir->offset);=0A= /* XXX */=0A= }=0A= return head;=0A= #undef match=0A= }=0A= =0A= =0A= /* load maps from hints */=0A= static u_int=0A= g_map_load_fis(struct g_consumer *cp, u_int idx)=0A= {=0A= struct g_geom *gp;=0A= struct g_provider *pp;=0A= struct g_slicer *gsp;=0A= struct g_map_softc *sc;=0A= struct fis_image_desc *fd, *head;=0A= u_char *buf;=0A= int error;=0A= u_int sectorsize, blksize; /* NB: flash block size stored as stripesize = */=0A= uint32_t offmask;=0A= off_t offset;=0A= =0A= =0A= gp =3D cp->geom;=0A= pp =3D cp->provider;=0A= gsp =3D gp->softc;=0A= sc =3D gsp->softc;=0A= =0A= sectorsize =3D cp->provider->sectorsize;=0A= if (sectorsize < sizeof(struct fis_image_desc) ||=0A= (sectorsize % sizeof(struct fis_image_desc))) {=0A= if (bootverbose)=0A= printf("GEOM_MAP: /dev/%s: FIS/RedBoot not exist, incompatible = sectorsize=3D%u\n", pp->name, sectorsize);=0A= return (0);=0A= }=0A= =0A= blksize =3D cp->provider->stripesize;=0A= if (blksize =3D=3D 0) {=0A= if (bootverbose)=0A= printf("GEOM_MAP: /dev/%s: FIS/RedBoot not exist, incompatible = blksize=3D%u\n", pp->name, blksize);=0A= return (0);=0A= }=0A= =0A= if (powerof2(cp->provider->mediasize))=0A= offmask =3D cp->provider->mediasize-1;=0A= else=0A= offmask =3D 0xffffffff; /* XXX */=0A= offset =3D (cp->provider->mediasize - blksize);=0A= g_topology_unlock();=0A= again:=0A= head =3D NULL;=0A= buf =3D g_read_data(cp, offset, blksize, NULL);=0A= if (buf !=3D NULL)=0A= head =3D parse_fis_directory(buf, blksize, offset, offmask);=0A= if (head =3D=3D NULL && offset !=3D 0) {=0A= if (bootverbose)=0A= printf("GEOM_MAP: /dev/%s: FIS/RedBoot table not found in last block, = try firast block\n", pp->name);=0A= if (buf !=3D NULL)=0A= g_free(buf);=0A= offset =3D 0; /* check the front */=0A= goto again;=0A= }=0A= g_topology_lock();=0A= if (head =3D=3D NULL) {=0A= if (bootverbose)=0A= printf("GEOM_MAP: /dev/%s: FIS/RedBoot not found on device\n", = pp->name);=0A= if (buf !=3D NULL)=0A= g_free(buf);=0A= return (0);=0A= }=0A= =0A= /* Craft a slice for each entry. */=0A= for (fd =3D head; fd !=3D NULL; fd =3D fd->next) {=0A= if (fd->name[0] =3D=3D '\0')=0A= continue;=0A= error =3D g_slice_config(gp, idx, G_SLICE_CONFIG_SET, fd->offset, = fd->size, sectorsize, "redboot/%s", fd->name);=0A= if (error) {=0A= printf("GEOM_MAP: /dev/%s: g_slice_config returns %d for \"%s\"\n", = pp->name, error, fd->name);=0A= }else{=0A= sc->entry[idx] =3D fd->entry;=0A= sc->dsize[idx] =3D fd->dsize;=0A= /* disallow writing hard-to-recover entries */=0A= sc->readonly[idx] =3D (strcmp(fd->name, FISDIR_NAME) =3D=3D 0) || = (strcmp(fd->name, REDBOOT_NAME) =3D=3D 0);=0A= idx ++;=0A= =0A= printf("GEOM_MAP: /dev/%s: 0x%08x-0x%08x, offset=3D0x%x, %s, = size=3D%ul bytes at: \"/dev/redboot/%s\"\n",=0A= pp->name, fd->addr, (fd->addr + fd->size), fd->entry, = (sc->readonly[idx]? "R/O":"R/W"), fd->size, fd->name);=0A= }=0A= }=0A= g_free(buf);=0A= =0A= return(idx);=0A= }=0A= =0A= #endif /* !defined(GEOM_MAP_NO_REDBOOT) */=0A= =0A= =0A= =0A= /* search given key on some geom */=0A= static off_t=0A= g_map_search_key(struct g_consumer *cp, u_int sectorsize, off_t from, = off_t step, const char *key, u_int key_len)=0A= {=0A= struct g_provider *pp;=0A= off_t ret =3D 0, i, mediasize, read_len;=0A= u_int c;=0A= char key_mask[MAP_SEARCH_KEY_LEN_MAX];=0A= u_char *buf;=0A= =0A= =0A= pp =3D cp->provider;=0A= key_len =3D min(MAP_SEARCH_KEY_LEN_MAX, key_len);=0A= read_len =3D roundup(key_len, sectorsize);=0A= mediasize =3D cp->provider->mediasize;=0A= =0A= if (bootverbose)=0A= printf("GEOM_MAP: /dev/%s: searchkey=3D\"%s\", from=3D0x%jx, = step=3D0x%jx...", pp->name, key, from, step);=0A= =0A= g_topology_unlock();=0A= for (i =3D from; i < mediasize && ret =3D=3D 0; i +=3D step) {=0A= buf =3D g_read_data(cp, rounddown(i, sectorsize), read_len, NULL);=0A= /* read ok? */=0A= if (buf =3D=3D NULL)=0A= break;=0A= =0A= /* Wildcard, replace '.' with byte from data */=0A= bcopy(key, key_mask, key_len);=0A= for (c =3D 0; c < key_len; c++)=0A= if (key_mask[c] =3D=3D '.')=0A= key_mask[c] =3D ((char *)(buf + (i % sectorsize)))[c];=0A= =0A= if (bcmp( (buf + (i % sectorsize)), key_mask, key_len) =3D=3D 0)=0A= ret =3D i;=0A= g_free(buf);=0A= }=0A= g_topology_lock();=0A= =0A= if (bootverbose) {=0A= if (ret)=0A= printf("found at 0x%jx\n", ret);=0A= else=0A= printf("NOT found!\n");=0A= }=0A= =0A= return(ret);=0A= }=0A= =0A= =0A= /* load maps from hints */=0A= static u_int=0A= g_map_load_hints(struct g_consumer *cp, u_int idx)=0A= {=0A= struct g_geom *gp;=0A= struct g_provider *pp;=0A= struct g_slicer *gsp;=0A= struct g_map_softc *sc;=0A= const char *map_name, *tmpstr, *search_key;=0A= off_t map_start, map_end, map_size, map_offset, search_start, = search_step;=0A= u_int i, sectorsize, map_readonly, map_start_searched;=0A= int ret;=0A= =0A= gp =3D cp->geom;=0A= pp =3D cp->provider;=0A= gsp =3D gp->softc;=0A= sc =3D gsp->softc;=0A= =0A= sectorsize =3D cp->provider->sectorsize;=0A= =0A= for (i =3D 0; i < MAP_MAXSLICE; i++) {=0A= map_start =3D map_end =3D map_size =3D map_offset =3D map_readonly =3D = map_start_searched =3D 0;=0A= =0A= ret =3D resource_string_value("map", i, "at", &tmpstr);=0A= /* Check if my provider */=0A= if (ret || strcmp(pp->name, tmpstr))=0A= continue;=0A= =0A= ret =3D resource_string_value("map", i, "name", &map_name);=0A= /* No name or error read name */=0A= if (ret)=0A= continue;=0A= =0A= ret =3D resource_string_value("map", i, "start", &tmpstr);=0A= /* No start or error read */=0A= if (ret)=0A= continue;=0A= if (strncmp(tmpstr, "search", 6) =3D=3D 0) {=0A= ret =3D resource_string_value("map", i, "searchkey", &search_key);=0A= if (ret)=0A= continue;=0A= =0A= search_start =3D 0;=0A= search_step =3D MAP_SEARCH_STEP_DEF;=0A= resource_quad_t_value("map", i, "searchstart", &search_start);=0A= resource_quad_t_value("map", i, "searchstep", &search_step);=0A= map_start_searched =3D 1;=0A= =0A= map_start =3D g_map_search_key(cp, sectorsize, search_start, = search_step, search_key, strlen(search_key));=0A= /* is search failed? */=0A= if (search_start > map_start)=0A= ret =3D 1;=0A= } else=0A= ret =3D resource_quad_t_value("map", i, "start", &map_start);=0A= if (ret)=0A= continue;=0A= =0A= =0A= ret =3D resource_string_value("map", i, "end", &tmpstr);=0A= /* No start or error read */=0A= if (ret)=0A= continue;=0A= if (strncmp(tmpstr, "search", 6) =3D=3D 0) {=0A= ret =3D resource_string_value("map", i, "searchkey", &search_key);=0A= if (ret)=0A= continue;=0A= =0A= search_step =3D MAP_SEARCH_STEP_DEF;=0A= if (map_start_searched) {=0A= /* we found key for start, end will see in next "step" offset */=0A= search_start =3D (map_start + search_step);=0A= }else{=0A= search_start =3D 0;=0A= resource_quad_t_value("map", i, "searchstart", &search_start);=0A= }=0A= resource_quad_t_value("map", i, "searchstep", &search_step);=0A= =0A= map_end =3D g_map_search_key(cp, sectorsize, search_start, = search_step, search_key, strlen(search_key));=0A= /* is search failed? */=0A= if (search_start > map_start)=0A= ret =3D 1;=0A= } else=0A= ret =3D resource_quad_t_value("map", i, "end", &map_end);=0A= =0A= map_size =3D (map_end - map_start);=0A= =0A= /* end is 0 or size is 0, No MAP - so next */=0A= if (ret || map_end =3D=3D 0 || map_size =3D=3D 0)=0A= continue;=0A= if (map_offset > map_size) {=0A= printf("GEOM_MAP: /dev/%s: offset(%jx) > size(%jx) for \"%s\"\n", = pp->name, map_offset, map_size, map_name);=0A= continue;=0A= }=0A= =0A= resource_quad_t_value("map", i, "offset", &map_offset);=0A= resource_int_value("map", i, "readonly", &map_readonly);=0A= =0A= /* strip dev name: pp->name =3D "flash/spi0" -> tmpstr =3D "spi0" */=0A= for (tmpstr =3D (pp->name + strlen(pp->name)); tmpstr > pp->name && = tmpstr[0] !=3D '/'; tmpstr --);=0A= if (tmpstr[0] =3D=3D '/')=0A= tmpstr ++;=0A= =0A= ret =3D g_slice_config(gp, idx, G_SLICE_CONFIG_SET, (map_start + = map_offset), (map_size - map_offset), sectorsize, "map/%s%s", tmpstr, = map_name);=0A= if (ret) {=0A= printf("GEOM_MAP: /dev/%s: g_slice_config returns %d for \"%s\"\n", = pp->name, ret, map_name);=0A= }else{=0A= sc->entry[idx] =3D map_offset;=0A= sc->dsize[idx] =3D (map_size - map_offset);=0A= sc->readonly[idx] =3D map_readonly;=0A= idx ++;=0A= =0A= printf("GEOM_MAP: /dev/%s: 0x%08jx-0x%08jx, offset=3D0x%jx, %s, = size=3D%ju bytes at: \"/dev/map/%s%s\"\n",=0A= pp->name, map_start, map_end, map_offset, (map_readonly? = "R/O":"R/W"), map_size, tmpstr, map_name);=0A= }=0A= }/* for (i =3D 0; i < MAP_MAXSLICE; i++) */=0A= =0A= return(idx);=0A= }=0A= =0A= =0A= =0A= static struct g_geom *=0A= g_map_taste(struct g_class *mp, struct g_provider *pp, int insist)=0A= {=0A= struct g_geom *gp;=0A= struct g_consumer *cp;=0A= struct g_map_softc *sc;=0A= u_int idx =3D 0;=0A= =0A= =0A= g_trace(G_T_TOPOLOGY, "map_taste(%s,%s)", mp->name, pp->name);=0A= g_topology_assert();=0A= if (!strcmp(pp->geom->class->name, MAP_CLASS_NAME))=0A= return (NULL);=0A= =0A= gp =3D g_slice_new(mp, MAP_MAXSLICE, pp, &cp, &sc, sizeof(*sc), = g_map_start);=0A= if (gp =3D=3D NULL)=0A= return (NULL);=0A= =0A= /* interpose our access method */=0A= sc->parent_access =3D gp->access;=0A= gp->access =3D g_map_access;=0A= =0A= idx +=3D g_map_load_hints(cp, idx);=0A= =0A= #if !defined(GEOM_MAP_NO_REDBOOT)=0A= idx +=3D g_map_load_fis(cp, idx);=0A= #endif=0A= =0A= if (idx && bootverbose)=0A= printf("GEOM_MAP: /dev/%s: mediasize=3D%ju, secsize=3D%d, = blksize=3D%d\n",=0A= pp->name, pp->mediasize, pp->sectorsize, pp->stripesize);=0A= =0A= =0A= g_access(cp, -1, 0, 0);=0A= if (LIST_EMPTY(&gp->provider)) {=0A= g_slice_spoiled(cp);=0A= return (NULL);=0A= }=0A= return (gp);=0A= }=0A= =0A= static void=0A= g_map_config(struct gctl_req *req, struct g_class *mp, const char *verb)=0A= {=0A= struct g_geom *gp;=0A= =0A= g_topology_assert();=0A= gp =3D gctl_get_geom(req, mp, "geom");=0A= if (gp =3D=3D NULL)=0A= return;=0A= gctl_error(req, "Unknown verb");=0A= }=0A= =0A= static struct g_class g_map_class =3D {=0A= .name =3D MAP_CLASS_NAME,=0A= .version =3D G_VERSION,=0A= .taste =3D g_map_taste,=0A= .dumpconf =3D g_map_dumpconf,=0A= .ctlreq =3D g_map_config,=0A= .ioctl =3D g_map_ioctl,=0A= };=0A= DECLARE_GEOM_CLASS(g_map_class, g_map);=0A= ------=_NextPart_000_0076_01CBF272.D99FC070 Content-Type: text/plain; name="options_add_geom_map.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="options_add_geom_map.txt" --- /usr/src/sys/conf/options_orig 2011-04-04 02:38:46.000000000 = +0900=0A= +++ /usr/src/sys/conf/options 2011-04-03 06:18:26.000000000 +0900=0A= @@ -1,4 +1,4 @@=0A= -# $FreeBSD: src/sys/conf/options,v 1.687.2.11 2011/03/27 00:42:28 kib = Exp $=0A= +# $FreeBSD: src/sys/conf/options,v 1.687.2.10 2010/07/09 08:48:51 ae = Exp $=0A= #=0A= # On the handling of kernel options=0A= #=0A= @@ -99,6 +99,8 @@=0A= GEOM_PART_MBR opt_geom.h=0A= GEOM_PART_PC98 opt_geom.h=0A= GEOM_PART_VTOC8 opt_geom.h=0A= +GEOM_MAP opt_geom.h=0A= +GEOM_MAP_NO_REDBOOT opt_geom.h=0A= GEOM_PC98 opt_geom.h=0A= GEOM_RAID3 opt_geom.h=0A= GEOM_SHSEC opt_geom.h=0A= =0A= ------=_NextPart_000_0076_01CBF272.D99FC070-- From owner-freebsd-geom@FreeBSD.ORG Mon Apr 4 06:26:15 2011 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 D4CD1106566B; Mon, 4 Apr 2011 06:26:15 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A9A458FC0A; Mon, 4 Apr 2011 06:26:15 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p346QFio044491; Mon, 4 Apr 2011 06:26:15 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p346QFpN044487; Mon, 4 Apr 2011 06:26:15 GMT (envelope-from linimon) Date: Mon, 4 Apr 2011 06:26:15 GMT Message-Id: <201104040626.p346QFpN044487@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-geom@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/155994: [geom] Long "Suspend time" when reading large files from gjournal partion. 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, 04 Apr 2011 06:26:15 -0000 Old Synopsis: Long "Suspend time" when reading large files from gjournal partion. New Synopsis: [geom] Long "Suspend time" when reading large files from gjournal partion. Responsible-Changed-From-To: freebsd-bugs->freebsd-geom Responsible-Changed-By: linimon Responsible-Changed-When: Mon Apr 4 06:24:37 UTC 2011 Responsible-Changed-Why: reclassify. http://www.freebsd.org/cgi/query-pr.cgi?pr=155994 From owner-freebsd-geom@FreeBSD.ORG Mon Apr 4 11:07:00 2011 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 41A661065675 for ; Mon, 4 Apr 2011 11:07:00 +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 2D28B8FC1D for ; Mon, 4 Apr 2011 11:07:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p34B70oD028610 for ; Mon, 4 Apr 2011 11:07:00 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p34B6xIM028608 for freebsd-geom@FreeBSD.org; Mon, 4 Apr 2011 11:06:59 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 4 Apr 2011 11:06:59 GMT Message-Id: <201104041106.p34B6xIM028608@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, 04 Apr 2011 11:07:00 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/155994 geom [geom] Long "Suspend time" when reading large files fr o kern/154226 geom [geom] GEOM label does not change when you modify them o kern/152609 geom [geli] geli onetime on gzero panics o kern/150858 geom [geom] [geom_label] [patch] glabel(8) is not compatibl o kern/150626 geom [geom] [gjournal] gjournal(8) destroys label o kern/150555 geom [geom] gjournal unusable on GPT partitions o kern/150334 geom [geom] [udf] [patch] geom label does not support UDF o kern/149762 geom volume labels with rogue characters o bin/149215 geom [panic] [geom_part] gpart(8): Delete linux's slice via o kern/147667 geom [gmirror] Booting with one component of a gmirror, the o kern/145818 geom [geom] geom_stat_open showing cached information for n o kern/145042 geom [geom] System stops booting after printing message "GE o kern/144905 geom [geom][geom_part] panic in gpart_ctlreq when unpluggin o kern/143455 geom gstripe(8) in RELENG_8 (31st Jan 2010) broken o kern/142563 geom [geom] [hang] ioctl freeze in zpool o kern/141740 geom [geom] gjournal(8): g_journal_destroy concurrent error o kern/140352 geom [geom] gjournal + glabel not working o kern/135898 geom [geom] Severe filesystem corruption - large files or l o kern/134922 geom [gmirror] [panic] kernel panic when use fdisk on disk o kern/134113 geom [geli] Problem setting secondary GELI key o kern/133931 geom [geli] [request] intentionally wrong password to destr o bin/132845 geom [geom] [patch] ggated(8) does not close files opened a o kern/132273 geom glabel(8): [patch] failing on journaled partition o kern/131353 geom [geom] gjournal(8) kernel lock o kern/129674 geom [geom] gjournal root did not mount on boot o kern/129645 geom gjournal(8): GEOM_JOURNAL causes system to fail to boo o kern/129245 geom [geom] gcache is more suitable for suffix based provid f kern/128276 geom [gmirror] machine lock up when gmirror module is used o kern/127420 geom [geom] [gjournal] [panic] Journal overflow on gmirrore o kern/124973 geom [gjournal] [patch] boot order affects geom_journal con o kern/124969 geom gvinum(8): gvinum raid5 plex does not detect missing s o kern/123962 geom [panic] [gjournal] gjournal (455Gb data, 8Gb journal), o kern/123122 geom [geom] GEOM / gjournal kernel lock o kern/122738 geom [geom] gmirror list "losts consumers" after gmirror de o kern/122067 geom [geom] [panic] Geom crashed during boot o kern/121364 geom [gmirror] Removing all providers create a "zombie" mir o kern/120091 geom [geom] [geli] [gjournal] geli does not prompt for pass o kern/115856 geom [geli] ZFS thought it was degraded when it should have o kern/115547 geom [geom] [patch] [request] let GEOM Eli get password fro o kern/114532 geom [geom] GEOM_MIRROR shows up in kldstat even if compile f kern/113957 geom [gmirror] gmirror is intermittently reporting a degrad o kern/113837 geom [geom] unable to access 1024 sector size storage o kern/113419 geom [geom] geom fox multipathing not failing back o kern/107707 geom [geom] [patch] [request] add new class geom_xbox360 to o kern/94632 geom [geom] Kernel output resets input while GELI asks for o kern/90582 geom [geom] [panic] Restore cause panic string (ffs_blkfree o bin/90093 geom fdisk(8) incapable of altering in-core geometry f kern/88601 geom [geli] geli cause kernel panic under heavy disk usage o kern/87544 geom [gbde] mmaping large files on a gbde filesystem deadlo o bin/86388 geom [geom] [geom_part] periodic(8) daily should backup gpa o kern/84556 geom [geom] [panic] GBDE-encrypted swap causes panic at shu o kern/79251 geom [2TB] newfs fails on 2.6TB gbde device o kern/79035 geom [vinum] gvinum unable to create a striped set of mirro o bin/78131 geom gbde(8) "destroy" not working. 54 problems total. From owner-freebsd-geom@FreeBSD.ORG Wed Apr 6 14:59:48 2011 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 A0B68106566B for ; Wed, 6 Apr 2011 14:59:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D59098FC0A for ; Wed, 6 Apr 2011 14:59:47 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA26693 for ; Wed, 06 Apr 2011 17:40:19 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4D9C7B52.5010207@FreeBSD.org> Date: Wed, 06 Apr 2011 17:40:18 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110309 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: freebsd-geom@FreeBSD.org X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: geom and removable media 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: Wed, 06 Apr 2011 14:59:48 -0000 Suppose we implemented a mechanism to detect removal or change of removable media (e.g. for optical discs in cd drives). How to signal media removal (or change)? Destroy the existing and create a new disk(9)? Or do some sort of geom spoil on it? Thank you! -- Andriy Gapon From owner-freebsd-geom@FreeBSD.ORG Wed Apr 6 17:07:23 2011 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 BBA451065670 for ; Wed, 6 Apr 2011 17:07:23 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id 703318FC18 for ; Wed, 6 Apr 2011 17:07:23 +0000 (UTC) Received: from [192.168.221.2] (remotevpn [192.168.221.2]) by ns1.feral.com (8.14.4/8.14.3) with ESMTP id p36Ge0Rn025418 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Wed, 6 Apr 2011 09:40:00 -0700 (PDT) (envelope-from mj@feral.com) Message-ID: <4D9C975C.9010700@feral.com> Date: Wed, 06 Apr 2011 09:39:56 -0700 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: freebsd-geom@freebsd.org References: <4D9C7B52.5010207@FreeBSD.org> In-Reply-To: <4D9C7B52.5010207@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.2.6 (ns1.feral.com [192.168.221.1]); Wed, 06 Apr 2011 09:40:01 -0700 (PDT) Subject: Re: geom and removable media 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: Wed, 06 Apr 2011 17:07:23 -0000 ...Or drives leaving an FC or SAS fabric.... On 4/6/2011 7:40 AM, Andriy Gapon wrote: > Suppose we implemented a mechanism to detect removal or change of removable media > (e.g. for optical discs in cd drives). How to signal media removal (or change)? > Destroy the existing and create a new disk(9)? > Or do some sort of geom spoil on it? > > Thank you! From owner-freebsd-geom@FreeBSD.ORG Thu Apr 7 00:26:49 2011 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 B92D91065672; Thu, 7 Apr 2011 00:26:49 +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 801E68FC0C; Thu, 7 Apr 2011 00:26:49 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 7D33D5DFD; Thu, 7 Apr 2011 00:09:54 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id p3709rJ0052626; Thu, 7 Apr 2011 00:09:54 GMT (envelope-from phk@critter.freebsd.dk) To: Andriy Gapon From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 06 Apr 2011 17:40:18 +0300." <4D9C7B52.5010207@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1 Date: Thu, 07 Apr 2011 00:09:53 +0000 Message-ID: <52625.1302134993@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: freebsd-geom@FreeBSD.org Subject: Re: geom and removable media 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, 07 Apr 2011 00:26:49 -0000 In message <4D9C7B52.5010207@FreeBSD.org>, Andriy Gapon writes: >Suppose we implemented a mechanism to detect removal or change of removable media >(e.g. for optical discs in cd drives). How to signal media removal (or change)? >Destroy the existing and create a new disk(9)? >Or do some sort of geom spoil on it? Basically yes. -- 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 Apr 7 05:26:45 2011 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 73DE0106566B for ; Thu, 7 Apr 2011 05:26:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BD4718FC14 for ; Thu, 7 Apr 2011 05:26:44 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA07764; Thu, 07 Apr 2011 08:26:41 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Q7hjt-000CiK-8A; Thu, 07 Apr 2011 08:26:41 +0300 Message-ID: <4D9D4B10.1080501@FreeBSD.org> Date: Thu, 07 Apr 2011 08:26:40 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110308 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Poul-Henning Kamp References: <52625.1302134993@critter.freebsd.dk> In-Reply-To: <52625.1302134993@critter.freebsd.dk> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-geom@FreeBSD.org Subject: Re: geom and removable media 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, 07 Apr 2011 05:26:45 -0000 on 07/04/2011 03:09 Poul-Henning Kamp said the following: > In message <4D9C7B52.5010207@FreeBSD.org>, Andriy Gapon writes: > >> Suppose we implemented a mechanism to detect removal or change of removable media >> (e.g. for optical discs in cd drives). How to signal media removal (or change)? >> Destroy the existing and create a new disk(9)? >> Or do some sort of geom spoil on it? > > Basically yes. Apologies, but yes to what? :) Thanks! -- Andriy Gapon From owner-freebsd-geom@FreeBSD.ORG Thu Apr 7 08:41:17 2011 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 AC8E9106564A; Thu, 7 Apr 2011 08:41:17 +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 72C2A8FC0C; Thu, 7 Apr 2011 08:41:17 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id B78AA5E2A; Thu, 7 Apr 2011 08:41:15 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id p378fExJ054078; Thu, 7 Apr 2011 08:41:15 GMT (envelope-from phk@critter.freebsd.dk) To: Andriy Gapon From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 07 Apr 2011 08:26:40 +0300." <4D9D4B10.1080501@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1 Date: Thu, 07 Apr 2011 08:41:14 +0000 Message-ID: <54077.1302165674@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: freebsd-geom@FreeBSD.org Subject: Re: geom and removable media 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, 07 Apr 2011 08:41:17 -0000 In message <4D9D4B10.1080501@FreeBSD.org>, Andriy Gapon writes: >on 07/04/2011 03:09 Poul-Henning Kamp said the following: >> In message <4D9C7B52.5010207@FreeBSD.org>, Andriy Gapon writes: >> >>> Suppose we implemented a mechanism to detect removal or change of removable media >>> (e.g. for optical discs in cd drives). How to signal media removal (or change)? >>> Destroy the existing and create a new disk(9)? >>> Or do some sort of geom spoil on it? >> >> Basically yes. > >Apologies, but yes to what? :) To Both :-) Look at g_wither_provider() as a starting point. -- 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 Apr 7 09:07:59 2011 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 BE8F4106566B for ; Thu, 7 Apr 2011 09:07:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 144528FC17 for ; Thu, 7 Apr 2011 09:07:58 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA11728; Thu, 07 Apr 2011 12:07:56 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Q7lC0-000Csj-14; Thu, 07 Apr 2011 12:07:56 +0300 Message-ID: <4D9D7EEB.3080607@FreeBSD.org> Date: Thu, 07 Apr 2011 12:07:55 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110308 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Poul-Henning Kamp References: <54077.1302165674@critter.freebsd.dk> In-Reply-To: <54077.1302165674@critter.freebsd.dk> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-geom@FreeBSD.org Subject: Re: geom and removable media 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, 07 Apr 2011 09:07:59 -0000 on 07/04/2011 11:41 Poul-Henning Kamp said the following: > In message <4D9D4B10.1080501@FreeBSD.org>, Andriy Gapon writes: >> on 07/04/2011 03:09 Poul-Henning Kamp said the following: >>> In message <4D9C7B52.5010207@FreeBSD.org>, Andriy Gapon writes: >>> >>>> Suppose we implemented a mechanism to detect removal or change of removable media >>>> (e.g. for optical discs in cd drives). How to signal media removal (or change)? >>>> Destroy the existing and create a new disk(9)? >>>> Or do some sort of geom spoil on it? >>> >>> Basically yes. >> >> Apologies, but yes to what? :) > > To Both :-) That's what I feared :-) > Look at g_wither_provider() as a starting point. I perceive the following problem with g_wither_provider: as I understand that call would lead to telling all consumers of a provider that they are orphaned now, and geom_dev rightfully destroys its cdev on such an event. So I see the following effect: remove a disk from a CD drive -> /dev/cdX disappears. Which I don't think would a right thing in the current world order where /dev/cdX represents both the drive and its media. -- Andriy Gapon From owner-freebsd-geom@FreeBSD.ORG Thu Apr 7 10:11:00 2011 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 C89C1106566C; Thu, 7 Apr 2011 10:10:59 +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 8E7C18FC1B; Thu, 7 Apr 2011 10:10:59 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 632DD5E26; Thu, 7 Apr 2011 10:10:58 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id p37AAwcR070253; Thu, 7 Apr 2011 10:10:58 GMT (envelope-from phk@critter.freebsd.dk) To: Andriy Gapon From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 07 Apr 2011 12:07:55 +0300." <4D9D7EEB.3080607@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1 Date: Thu, 07 Apr 2011 10:10:58 +0000 Message-ID: <70252.1302171058@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: freebsd-geom@FreeBSD.org Subject: Re: geom and removable media 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, 07 Apr 2011 10:11:00 -0000 In message <4D9D7EEB.3080607@FreeBSD.org>, Andriy Gapon writes: >Which I >don't think would a right thing in the current world order where /dev/cdX >represents both the drive and its media. You can create the new /dev/cdX right away, so there is no real window of inconsistency. And good observation btw, it was a big mistake to use the same /dev entry for both drive and media, but waaay to late to fix it now. -- 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 Apr 7 12:51:00 2011 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 D5D8A106566B for ; Thu, 7 Apr 2011 12:51:00 +0000 (UTC) (envelope-from freebsd@psconsult.nl) Received: from mx1.psconsult.nl (unknown [IPv6:2001:7b8:30f:e0::5059:ee8a]) by mx1.freebsd.org (Postfix) with ESMTP id 90B1B8FC14 for ; Thu, 7 Apr 2011 12:51:00 +0000 (UTC) Received: from mx1.psconsult.nl (psc11.adsl.iaf.nl [80.89.238.138]) by mx1.psconsult.nl (8.14.4/8.14.4) with ESMTP id p37CostG071277 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 7 Apr 2011 14:50:59 +0200 (CEST) (envelope-from freebsd@psconsult.nl) Received: (from paul@localhost) by mx1.psconsult.nl (8.14.4/8.14.4/Submit) id p37CosUI071276 for freebsd-geom@freebsd.org; Thu, 7 Apr 2011 14:50:54 +0200 (CEST) (envelope-from freebsd@psconsult.nl) X-Authentication-Warning: mx1.psconsult.nl: paul set sender to freebsd@psconsult.nl using -f Date: Thu, 7 Apr 2011 14:50:54 +0200 From: Paul Schenkeveld To: freebsd-geom@freebsd.org Message-ID: <20110407125054.GA71210@psconsult.nl> References: <4D9D7EEB.3080607@FreeBSD.org> <70252.1302171058@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <70252.1302171058@critter.freebsd.dk> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: geom and removable media 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, 07 Apr 2011 12:51:00 -0000 On Thu, Apr 07, 2011 at 10:10:58AM +0000, Poul-Henning Kamp wrote: > In message <4D9D7EEB.3080607@FreeBSD.org>, Andriy Gapon writes: > > >Which I > >don't think would a right thing in the current world order where /dev/cdX > >represents both the drive and its media. > > You can create the new /dev/cdX right away, so there is no real window of > inconsistency. > > And good observation btw, it was a big mistake to use the same /dev > entry for both drive and media, but waaay to late to fix it now. /dev/cd0.ctl ? Regards, Paul Schenkeveld From owner-freebsd-geom@FreeBSD.ORG Thu Apr 7 12:52:09 2011 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 957C61065677 for ; Thu, 7 Apr 2011 12:52:09 +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 5BC1A8FC17 for ; Thu, 7 Apr 2011 12:52:08 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 2D3745DF8; Thu, 7 Apr 2011 12:52:08 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id p37Cq72Q074334; Thu, 7 Apr 2011 12:52:07 GMT (envelope-from phk@critter.freebsd.dk) To: Paul Schenkeveld From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 07 Apr 2011 14:50:54 +0200." <20110407125054.GA71210@psconsult.nl> Content-Type: text/plain; charset=ISO-8859-1 Date: Thu, 07 Apr 2011 12:52:07 +0000 Message-ID: <74333.1302180727@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: freebsd-geom@freebsd.org Subject: Re: geom and removable media 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, 07 Apr 2011 12:52:09 -0000 In message <20110407125054.GA71210@psconsult.nl>, Paul Schenkeveld writes: >On Thu, Apr 07, 2011 at 10:10:58AM +0000, Poul-Henning Kamp wrote: >> And good observation btw, it was a big mistake to use the same /dev >> entry for both drive and media, but waaay to late to fix it now. > >/dev/cd0.ctl ? Breaks far too much software (DVD/CD burning etc) -- 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 Apr 7 14:46:58 2011 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 D9351106564A for ; Thu, 7 Apr 2011 14:46:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2D2668FC15 for ; Thu, 7 Apr 2011 14:46:57 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA17888; Thu, 07 Apr 2011 17:46:54 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4D9DCE5D.7040607@FreeBSD.org> Date: Thu, 07 Apr 2011 17:46:53 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110309 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Poul-Henning Kamp References: <70252.1302171058@critter.freebsd.dk> In-Reply-To: <70252.1302171058@critter.freebsd.dk> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-geom@FreeBSD.org Subject: Re: geom and removable media 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, 07 Apr 2011 14:46:58 -0000 on 07/04/2011 13:10 Poul-Henning Kamp said the following: > In message <4D9D7EEB.3080607@FreeBSD.org>, Andriy Gapon writes: > >> Which I >> don't think would a right thing in the current world order where /dev/cdX >> represents both the drive and its media. > > You can create the new /dev/cdX right away, so there is no real window of > inconsistency. Yes, true. But I am trying to see whether that would buy us much comparing to just doing spoil + re-taste dance. I.e. my main concern is that the other geoms do not have a stale view of the media. I am OK with leaving everything else as it is now, so that any requests could still go all the way down to hardware (and fail). To summarize: I am thinking about posting a spoil event when we detect that a drive has no media (e.g. via a SCSI sense code) and posting a a retaste event when we detect presence of new media (probably as a result of some request succeeding). -- Andriy Gapon From owner-freebsd-geom@FreeBSD.ORG Fri Apr 8 06:20:14 2011 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 D62B7106564A for ; Fri, 8 Apr 2011 06:20:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0ECB28FC08 for ; Fri, 8 Apr 2011 06:20:13 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA00590 for ; Fri, 08 Apr 2011 09:20:12 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Q853E-000GE7-F0 for freebsd-geom@FreeBSD.org; Fri, 08 Apr 2011 09:20:12 +0300 Message-ID: <4D9EA91B.80901@FreeBSD.org> Date: Fri, 08 Apr 2011 09:20:11 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110308 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: freebsd-geom@FreeBSD.org X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit Cc: Subject: EDIRIOCTL /* do direct ioctl in GEOM */ 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, 08 Apr 2011 06:20:14 -0000 It doesn't look like EDIRIOCTL is used anywhere in the code. Are there any plans to use it for something in the future or is it just a leftover? -- Andriy Gapon From owner-freebsd-geom@FreeBSD.ORG Fri Apr 8 08:02:25 2011 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 CE71D1065670; Fri, 8 Apr 2011 08:02:25 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id B06F78FC1B; Fri, 8 Apr 2011 08:02:25 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id p3882ODL056202 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 8 Apr 2011 01:02:24 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id p3882Olp056201; Fri, 8 Apr 2011 01:02:24 -0700 (PDT) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA04640; Fri, 8 Apr 11 00:52:30 PDT Date: Fri, 08 Apr 2011 00:51:58 -0700 From: perryh@pluto.rain.com To: phk@phk.freebsd.dk Message-Id: <4d9ebe9e.pIGnOm19kkj92XTf%perryh@pluto.rain.com> References: <70252.1302171058@critter.freebsd.dk> In-Reply-To: <70252.1302171058@critter.freebsd.dk> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: avg@freebsd.org, freebsd-geom@freebsd.org Subject: Re: geom and removable media 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, 08 Apr 2011 08:02:25 -0000 "Poul-Henning Kamp" wrote: > ... it was a big mistake to use the same /dev entry > for both drive and media Well, maybe, in hindsight :) If the drive and the media had separate /dev entries it might never have been necessary to invent ioctl. > but waaay to late to fix it now. Yep. The drive and its removeable media have shared the same /dev entry since, at least, Bell Labs 6th Edition. (I _know_ this is true of dectapes, half-inch magtapes, 8" floppies, and "rk" cartridge disks; I think the "rp" disk drive may also have had removeable packs.) From owner-freebsd-geom@FreeBSD.ORG Fri Apr 8 08:47:59 2011 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 8E220106564A; Fri, 8 Apr 2011 08:47:59 +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 52C178FC0C; Fri, 8 Apr 2011 08:47:59 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id C8AC35E26; Fri, 8 Apr 2011 08:47:57 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id p388lviO004661; Fri, 8 Apr 2011 08:47:57 GMT (envelope-from phk@critter.freebsd.dk) To: Andriy Gapon From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 08 Apr 2011 09:20:11 +0300." <4D9EA91B.80901@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1 Date: Fri, 08 Apr 2011 08:47:57 +0000 Message-ID: <4660.1302252477@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: freebsd-geom@FreeBSD.org Subject: Re: EDIRIOCTL /* do direct ioctl in GEOM */ 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, 08 Apr 2011 08:47:59 -0000 In message <4D9EA91B.80901@FreeBSD.org>, Andriy Gapon writes: > >It doesn't look like EDIRIOCTL is used anywhere in the code. >Are there any plans to use it for something in the future or is it just a leftover? I think it is a leftover. -- 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 Sat Apr 9 08:25:16 2011 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 CC077106564A for ; Sat, 9 Apr 2011 08:25:16 +0000 (UTC) (envelope-from uncle@devio.us) Received: from wolfman.devio.us (devious-1-pt.tunnel.tserv12.mia1.ipv6.he.net [IPv6:2001:470:4:2a5::2]) by mx1.freebsd.org (Postfix) with ESMTP id A9A8F8FC15 for ; Sat, 9 Apr 2011 08:25:16 +0000 (UTC) Received: by wolfman.devio.us (Postfix, from userid 3773) id 30C7E1A90F0; Sat, 9 Apr 2011 04:25:16 -0400 (EDT) Date: Sat, 9 Apr 2011 04:25:16 -0400 From: Nick Ulen To: freebsd-geom@freebsd.org Message-ID: <20110409082516.GA25384@wolfman.devio.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Subject: syntax for geli with using device's label(glabel) 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: Sat, 09 Apr 2011 08:25:16 -0000 Greetings, The problem is that I can't configure provider which must be attached on boot with using key and device's label. glabel list da0s2 Geom name: da0s2 Providers: 1. Name: label/tank I got "syntax error",when I used strings as below in loader.conf: geli_label/tank_keyfile0_load="YES" geli_label/tank_keyfile0_type="label/tank:geli_keyfile0" geli_label/tank_keyfile0_name="/boot/keys/label_tank.key" Which is correct syntax for loader.conf? Regards. Nick From owner-freebsd-geom@FreeBSD.ORG Sat Apr 9 19:25:19 2011 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 44A31106566C for ; Sat, 9 Apr 2011 19:25:19 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id E46768FC12 for ; Sat, 9 Apr 2011 19:25:18 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id BAB0045E93; Sat, 9 Apr 2011 21:25:17 +0200 (CEST) Received: from localhost (host-80-54-90-198.eimg.pl [80.54.90.198]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id C73D145E5C; Sat, 9 Apr 2011 21:25:12 +0200 (CEST) Date: Sat, 9 Apr 2011 21:25:07 +0200 From: Pawel Jakub Dawidek To: Nick Ulen Message-ID: <20110409192507.GB2330@garage.freebsd.pl> References: <20110409082516.GA25384@wolfman.devio.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qlTNgmc+xy1dBmNv" Content-Disposition: inline In-Reply-To: <20110409082516.GA25384@wolfman.devio.us> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=4.5 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-geom@freebsd.org Subject: Re: syntax for geli with using device's label(glabel) 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: Sat, 09 Apr 2011 19:25:19 -0000 --qlTNgmc+xy1dBmNv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 09, 2011 at 04:25:16AM -0400, Nick Ulen wrote: > Greetings, > The problem is that I can't configure provider which must be attached on= =20 > boot with using key and device's label. >=20 > glabel list da0s2 > Geom name: da0s2 > Providers: > 1. Name: label/tank >=20 > I got "syntax error",when I used strings as below in loader.conf: >=20 > geli_label/tank_keyfile0_load=3D"YES" > geli_label/tank_keyfile0_type=3D"label/tank:geli_keyfile0" > geli_label/tank_keyfile0_name=3D"/boot/keys/label_tank.key" >=20 > Which is correct syntax for loader.conf? Variable name should be meaningless, it should work with: geli_label_tank_keyfile0_load=3D"YES" geli_label_tank_keyfile0_type=3D"label/tank:geli_keyfile0" geli_label_tank_keyfile0_name=3D"/boot/keys/label_tank.key" --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --qlTNgmc+xy1dBmNv Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk2gspIACgkQForvXbEpPzT7JQCeLJZVl2nWQX/ftAlO+YP3AtAG ZHYAoMlS0SpEwpTxKJY6w5mfNs7woahG =idGw -----END PGP SIGNATURE----- --qlTNgmc+xy1dBmNv--