Date: Wed, 10 Nov 2010 14:02:28 -0800 From: Matthew Jacob <mj@feral.com> To: Oleg Sharoyko <osharoiko@gmail.com> Cc: mjacob@freebsd.org, freebsd-geom@freebsd.org Subject: Re: [patch] [geom_multipath] detached device used as an active path Message-ID: <4CDB1674.1000606@feral.com> In-Reply-To: <AANLkTi=B2Gniv3RDmLexN8Br8W0Q4t=V_0A57XPkQe4g@mail.gmail.com> References: <AANLkTi=B2Gniv3RDmLexN8Br8W0Q4t=V_0A57XPkQe4g@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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. >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CDB1674.1000606>