https://bugzilla.novell.com/show_bug.cgi?id=287080#c1
Chris Ray changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #1 from Chris Ray 2007-06-27 06:26:05 MST ---
The problem seems to be in the YaST module yast2-storage-2.14.18, I think.
There is a code source called Disk.cc that contains this section:
Disk::Disk( Storage * const s, const string& Name,
unsigned long long SizeK ) :
Container(s,"",staticType())
{
init_disk = dmp_slave = false;
nm = Name;
string::size_type pos = nm.rfind( '/' );
if( pos!=string::npos )
nm.erase( pos+1 );
logfile_name = Name;
if( Name.find( "/dev/" )==0 )
dev = Name;
else
dev = "/dev/" + Name;
size_k = SizeK;
y2debug( "constructed disk %s", dev.c_str() );
}
Which deletes everything the the right of the rightmost / in any device name
coming through the code. So in my case /dev/rd/c0d0 comes through this code as
just rd/ . This screws up later sections. I don't know what range of values
gets passed to this section, but it's a very big assumption that it's safe to
delete everything after the last /, if one is found (and why leave the final /
in place??) Screws up Hardware RAID cards for a start.
I modified the "if" test as follows:
if( pos!=string::npos && nm.find( "rd/" )!=0 )
So now it doesn't do the erase if the name contains rd/, as in my case. I think
this is a bit loose, but don't have access to the range of names that might
come through the code segment, so best I can do. It works for me.
Here is the final version of the code that I compiled and tested. (not quite
true, I did about 12 compiles before I got it down to this)
Disk::Disk( Storage * const s, const string& Name,
unsigned long long SizeK ) :
Container(s,"",staticType())
{
init_disk = dmp_slave = false;
nm = Name;
string::size_type pos = nm.rfind( '/' );
if( pos!=string::npos && nm.find( "rd/" )!=0 )
nm.erase( pos+1 );
logfile_name = Name;
if( Name.find( "/dev/" )==0 )
dev = Name;
else
dev = "/dev/" + Name;
size_k = SizeK;
y2debug( "constructed disk %s", dev.c_str() );
}
Best Regards,
Chris Ray.
Bazaar Systems Ltd, UK
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.