From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Reinecke Subject: Re: [PATCH] multipath: rlookup WWIDs with spaces by alias Date: Mon, 14 Nov 2011 10:17:54 +0100 Message-ID: <4EC0DCC2.8060804@suse.de> References: <20111112045426.GD24133@ether.msp.redhat.com> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20111112045426.GD24133@ether.msp.redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: device-mapper development Cc: Christophe Varoqui List-Id: dm-devel.ids On 11/12/2011 05:54 AM, Benjamin Marzinski wrote: > If a WWID contained spaces, the rlookup code wasn't able to look it up > by its user_friendly_name, since the code was only reading the wwid till > the first space. It now reads to the end of the line. > > Signed-off-by: Benjamin Marzinski > --- > libmultipath/alias.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index: multipath-tools-110412/libmultipath/alias.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- multipath-tools-110412.orig/libmultipath/alias.c > +++ multipath-tools-110412/libmultipath/alias.c > @@ -288,7 +288,7 @@ rlookup_binding(FILE *f, char **map_wwid > curr_id =3D scan_devname(alias, NULL); /* TBD: Why this call? */ > if (curr_id>=3D id) > id =3D curr_id + 1; > - wwid =3D strtok(NULL, " \t"); > + wwid =3D strtok(NULL, ""); > if (!wwid){ > condlog(3, > "Ignoring malformed line %u in bindings file", > Please, don't. We keep on changing this one back and forth about every year. (The original patch was by you, back in 2008. Then I changed it back = because it breaks compability with existing configuration files. Now you = go and change it _again_). The real problem here is 'If the WWID contains spaces' The WWID _never_ should contain spaces. I pretty certain we can't handle = WWID with spaces in the bindings file; eg we don't have any quotation = mechanism implemented. So can't we just settle on 'The WWID must not contain spaces' ? Cheers, Hannes -- = Dr. Hannes Reinecke zSeries & Storage hare@suse.de +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg GF: Markus Rex, HRB 16746 (AG N=FCrnberg)