From owner-freebsd-fs@FreeBSD.ORG Thu Sep 3 13:48:42 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 379961065672; Thu, 3 Sep 2009 13:48:42 +0000 (UTC) (envelope-from mel.flynn+fbsd.fs@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id DB21C8FC0A; Thu, 3 Sep 2009 13:48:41 +0000 (UTC) Received: from smoochies.rachie.is-a-geek.net (mailhub.lan.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 7A2AB7E818; Thu, 3 Sep 2009 05:48:51 -0800 (AKDT) From: Mel Flynn To: freebsd-fs@freebsd.org Date: Thu, 3 Sep 2009 15:48:37 +0200 User-Agent: KMail/1.11.4 (FreeBSD/8.0-BETA3; KDE/4.2.4; i386; ; ) References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> <20090903124407.GJ1821@garage.freebsd.pl> In-Reply-To: <20090903124407.GJ1821@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_1k8nKwVXxDS7SoY" Message-Id: <200909031548.37887.mel.flynn+fbsd.fs@mailing.thruhere.net> Cc: freeebsd-geom@freebsd.org, Pawel Jakub Dawidek Subject: Re: Patch to allow gmirror to set priority of a disk X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2009 13:48:42 -0000 --Boundary-00=_1k8nKwVXxDS7SoY Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Thursday 03 September 2009 14:44:07 Pawel Jakub Dawidek wrote: > On Thu, Sep 03, 2009 at 12:00:11AM +0200, Mel Flynn wrote: > > Unfortunately, due to geographic relocation, I no longer have physical > > access to the machine, so I have only compile tested this patch, but I > > wanted to get some feedback about it: > > - Have I made some mistakes that would trash my mirror? ;) > > - Is there any desire to have this feature other then my own? > > - Any style issues? > > Thank you for working on this, this is a long missing bit, although I've > some comments. > > You assume that you can write to the mirror component, so you also > assume that your mirror if offline, because if it would be online you > won't be able to write to one of its components. Ah, that's a gotcha I didn't catch. > So what we need more is to be able to change priority of a mirror > component which is part of an online mirror, so we need to comunicate > with the kernel. Would you like to implement this functionality this > way? Yes. > I'd suggest doing this not as separate gmirror(8) subcommand, but as an > extension to 'configure' subcommand, where one can provide priority by > giving '-p' argument. Except I didn't see how configure was implemented. Am I correct that this is g_mirror_ctl_configure in sys/geom/mirror/g_mirror_ctl.c? > PS. In case of 'gmirror insert' you already can change the priority with > the '-p' option. Right. Dunno how I missed that. On a related note, perhaps the attached can be applied so that there's no question about the priority numbering? -- Mel --Boundary-00=_1k8nKwVXxDS7SoY Content-Type: text/plain; charset="UTF-8"; name="gmirror.8.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gmirror.8.txt" Index: sbin/geom/class/mirror/gmirror.8 =================================================================== --- sbin/geom/class/mirror/gmirror.8 (revision 196776) +++ sbin/geom/class/mirror/gmirror.8 (working copy) @@ -115,8 +115,8 @@ .It Cm label Create a mirror. The order of components is important, because a component's priority is based on its position -(starting from 0). -The component with the biggest priority is used by the +(starting from 0 to 255). +The component with the biggest priority (the lowest number) is used by the .Cm prefer balance algorithm and is also used as a master component when resynchronization is needed, --Boundary-00=_1k8nKwVXxDS7SoY--