From owner-freebsd-geom@FreeBSD.ORG Wed Nov 10 22:02:37 2010 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 7C11E106566C; Wed, 10 Nov 2010 22:02:37 +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 265BD8FC15; Wed, 10 Nov 2010 22:02:37 +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 oAAM2YI4081666 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 10 Nov 2010 14:02:36 -0800 (PST) (envelope-from mj@feral.com) Message-ID: <4CDB1674.1000606@feral.com> Date: Wed, 10 Nov 2010 14:02:28 -0800 From: Matthew Jacob Organization: Feral Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Oleg Sharoyko References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; 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, 10 Nov 2010 14:02:36 -0800 (PST) Cc: mjacob@freebsd.org, freebsd-geom@freebsd.org Subject: Re: [patch] [geom_multipath] detached device used as an active path 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, 10 Nov 2010 22:02:37 -0000 It's going to take me a bit to digest this. I have a huge set of diffs I haven't brought in yet. On 11/10/2010 12:41 PM, Oleg Sharoyko wrote: > Hi Matthew, > > Please take a look at the patch I'm attaching to this mail. It fixes > couple of issues with cp->active being left pointing to detached > device. I have as well tried to remove code duplication a bit by using > g_multipath_rotate() in g_mpd() and g_multipath_done_error() instead > of identical loops. > > One thing which I'm not 100% sure about is this part (this is within > g_multipath_access()): > > @@ -258,7 +268,7 @@ > > LIST_FOREACH(cp,&gp->consumer, consumer) { > error = g_access(cp, dr, dw, de); > - if (error) { > + if (error&& error != ENXIO) { > badcp = cp; > goto fail; > } > > This change fixes undesired behavior in the following case: > > While running > > while true; do > echo > date > dd if=/dev/multipath/test of=/dev/null bs=512 count=1 > sleep 1 > done > > disconnect currently active path of /dev/multipath/test. > > Without "&& error != ENXIO" I have exactly one failed dd. Whith it - > none of dd fails. > > Shouldn't the overall logic of g_multipath_access() be as follows: try > to do what we're asked to do while there are at least one available > path, and remove from g_multipath any path for which g_access() call > has failed? I would suppose that multipath device should try to work > as long as there is at least one workable path, and any path which has > failed (no matter if it was a physical failure or, f.e. ENOMEM in > device driver) should be detached from multipath device. >