Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jan 2013 19:13:38 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Alexander Motin <mav@FreeBSD.org>
Cc:        Andriy Gapon <avg@FreeBSD.org>, freebsd-geom@FreeBSD.org
Subject:   Re: kern/175323: Fail to use ZVOL as a gmirror component
Message-ID:  <20130122181338.GE1714@garage.freebsd.pl>
In-Reply-To: <50FED0D5.6060105@FreeBSD.org>
References:  <50FD0E99.8010305@FreeBSD.org> <CAKNWxEU8PVtnRrN6%2BEsx835OHqSGSbgWV9xCOzVjUXKmZQvaLA@mail.gmail.com> <50FEBE55.1040009@FreeBSD.org> <50FED0D5.6060105@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
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 Алексей Волков 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 = md->md_dflags;
> >>      error = g_getattr("GEOM::candelete", disk->d_consumer, &i);
> >>      if (error != 0)
> >> -        goto fail;
> >> +        i=0;
> >>      if (i)
> >>          disk->d_flags |= G_MIRROR_DISK_FLAG_CANDELETE;
> >>      if (md->md_provider[0] != '\0')
> >>
> > 
> > So any comments from the GEOM / gmirror guys?
> 
> That looks fine to me. I would just do it as:
> 
> --- 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 = md->md_priority;
>         disk->d_flags = md->md_dflags;
>         error = g_getattr("GEOM::candelete", disk->d_consumer, &i);
> -       if (error != 0)
> -               goto fail;
> -       if (i)
> +       if (error == 0 && i != 0)
>                 disk->d_flags |= G_MIRROR_DISK_FLAG_CANDELETE;
>         if (md->md_provider[0] != '\0')
>                 disk->d_flags |= G_MIRROR_DISK_FLAG_HARDCODED;

Looks good to me.

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://tupytaj.pl

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlD+1tIACgkQForvXbEpPzSYJACgmBOj+Fkz9co/wW1XXaQWJ0RR
TyUAn01Bv9JubrdgGnXYfAV/N/u6T8k9
=LtIO
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130122181338.GE1714>