From owner-freebsd-geom@FreeBSD.ORG Tue Jan 22 18:13:02 2013 Return-Path: Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3F1ADAEF; Tue, 22 Jan 2013 18:13:02 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 0480AA63; Tue, 22 Jan 2013 18:13:01 +0000 (UTC) Received: from localhost (global-1-11.nat.csx.cam.ac.uk [131.111.184.11]) by mail.dawidek.net (Postfix) with ESMTPSA id BD75FAEE; Tue, 22 Jan 2013 19:10:27 +0100 (CET) Date: Tue, 22 Jan 2013 19:13:38 +0100 From: Pawel Jakub Dawidek To: Alexander Motin Subject: Re: kern/175323: Fail to use ZVOL as a gmirror component Message-ID: <20130122181338.GE1714@garage.freebsd.pl> References: <50FD0E99.8010305@FreeBSD.org> <50FEBE55.1040009@FreeBSD.org> <50FED0D5.6060105@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CGDBiGfvSTbxKZlW" Content-Disposition: inline In-Reply-To: <50FED0D5.6060105@FreeBSD.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Andriy Gapon , freebsd-geom@FreeBSD.org X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2013 18:13:02 -0000 --CGDBiGfvSTbxKZlW Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 22, 2013 at 07:48:05PM +0200, Alexander Motin wrote: > On 22.01.2013 18:29, Andriy Gapon wrote: > > on 21/01/2013 14:39 =D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9 =D0=92= =D0=BE=D0=BB=D0=BA=D0=BE=D0=B2 said the following: > >> Eventually this patch works for me just fine. > >> > >> --- sys/geom/mirror/g_mirror.c (revision 245741) > >> +++ sys/geom/mirror/g_mirror.c (working copy) > >> @@ -456,7 +456,7 @@ > >> disk->d_flags =3D md->md_dflags; > >> error =3D g_getattr("GEOM::candelete", disk->d_consumer, &i); > >> if (error !=3D 0) > >> - goto fail; > >> + i=3D0; > >> if (i) > >> disk->d_flags |=3D G_MIRROR_DISK_FLAG_CANDELETE; > >> if (md->md_provider[0] !=3D '\0') > >> > >=20 > > So any comments from the GEOM / gmirror guys? >=20 > That looks fine to me. I would just do it as: >=20 > --- g_mirror.c (revision 245794) > +++ g_mirror.c (working copy) > @@ -457,9 +457,7 @@ g_mirror_init_disk(struct g_mirror_softc *sc, stru > disk->d_priority =3D md->md_priority; > disk->d_flags =3D md->md_dflags; > error =3D g_getattr("GEOM::candelete", disk->d_consumer, &i); > - if (error !=3D 0) > - goto fail; > - if (i) > + if (error =3D=3D 0 && i !=3D 0) > disk->d_flags |=3D G_MIRROR_DISK_FLAG_CANDELETE; > if (md->md_provider[0] !=3D '\0') > disk->d_flags |=3D G_MIRROR_DISK_FLAG_HARDCODED; Looks good to me. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --CGDBiGfvSTbxKZlW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlD+1tIACgkQForvXbEpPzSYJACgmBOj+Fkz9co/wW1XXaQWJ0RR TyUAn01Bv9JubrdgGnXYfAV/N/u6T8k9 =LtIO -----END PGP SIGNATURE----- --CGDBiGfvSTbxKZlW--