FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 11-12-2011, 03:54 AM
Benjamin Marzinski
 
Default multipath: rlookup WWIDs with spaces by alias

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 <bmarzins@redhat.com>
---
libmultipath/alias.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: multipath-tools-110412/libmultipath/alias.c
================================================== =================
--- 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 = scan_devname(alias, NULL); /* TBD: Why this call? */
if (curr_id >= id)
id = curr_id + 1;
- wwid = strtok(NULL, " ");
+ wwid = strtok(NULL, "");
if (!wwid){
condlog(3,
"Ignoring malformed line %u in bindings file",

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 11-12-2011, 09:18 AM
Christophe Varoqui
 
Default multipath: rlookup WWIDs with spaces by alias

On ven., 2011-11-11 at 22:54 -0600, 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.
>
Applied

> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
> libmultipath/alias.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: multipath-tools-110412/libmultipath/alias.c
> ================================================== =================
> --- 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 = scan_devname(alias, NULL); /* TBD: Why this call? */
> if (curr_id >= id)
> id = curr_id + 1;
> - wwid = strtok(NULL, " ");
> + wwid = strtok(NULL, "");
> if (!wwid){
> condlog(3,
> "Ignoring malformed line %u in bindings file",



--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 11-14-2011, 08:17 AM
Hannes Reinecke
 
Default multipath: rlookup WWIDs with spaces by alias

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<bmarzins@redhat.com>
---
libmultipath/alias.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: multipath-tools-110412/libmultipath/alias.c
================================================== =================
--- 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 = scan_devname(alias, NULL); /* TBD: Why this call? */
if (curr_id>= id)
id = curr_id + 1;
- wwid = strtok(NULL, " ");
+ wwid = 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ürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 11-15-2011, 07:41 PM
Christophe Varoqui
 
Default multipath: rlookup WWIDs with spaces by alias

On lun., 2011-11-14 at 12:34 -0600, Benjamin Marzinski wrote:
> On Mon, Nov 14, 2011 at 10:17:54AM +0100, Hannes Reinecke wrote:
> > 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<bmarzins@redhat.com>
> >> ---
> >> libmultipath/alias.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> Index: multipath-tools-110412/libmultipath/alias.c
> >> ================================================== =================
> >> --- 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 = scan_devname(alias, NULL); /* TBD: Why this call? */
> >> if (curr_id>= id)
> >> id = curr_id + 1;
> >> - wwid = strtok(NULL, " ");
> >> + wwid = 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' ?
>
> I suppose that since we're using the "--replace-whitespace" option to
> scsi_id by default, I'm fine with not including this patch.
>
Reverted.

--
Christophe Varoqui
OpenSVC - Tools to scale
http://www.opensvc.com/

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 03:48 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org