Author: aschnell Date: Tue Oct 5 10:25:54 2010 New Revision: 62532 URL: http://svn.opensuse.org/viewcvs/yast?rev=62532&view=rev Log: - do not read /var/run/mdadm/map since the UUID is "reversed" depending on metadata version and endianness Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/MdPartCo.cc branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/MdPartCo.h branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/MdPartCo.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/MdPartCo.cc?rev=62532&r1=62531&r2=62532&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/MdPartCo.cc (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/MdPartCo.cc Tue Oct 5 10:25:54 2010 @@ -1751,30 +1751,6 @@ } } -bool MdPartCo::findMdMap(std::ifstream& file) -{ - const char* mdadm_map[] = {"/var/run/mdadm/map", - "/var/run/mdadm.map", - "/dev/.mdadm.map", - 0}; - classic(file); - int i=0; - while( mdadm_map[i] ) - { - file.open( mdadm_map[i] ); - if( file.is_open() ) - { - return true; - } - else - { - i++; - } - } - y2war(" Map File not found"); - return false; -} - /* Will try to set: UUID, Name.*/ /* Format: mdX metadata uuid /dev/md/md_name */ @@ -1786,33 +1762,7 @@ uuid.clear(); mdName.clear(); - /* Got file, now parse output. */ - if( MdPartCo::findMdMap(file) ) - { - while( !file.eof() ) - { - string val; - getline(file,line); - val = extractNthWord( MAP_DEV, line ); - if( val == dev ) - { - size_t pos; - uuid = extractNthWord( MAP_UUID, line ); - val = extractNthWord( MAP_NAME, line ); - // if md_name then /dev/md/name other /dev/mdxxx - if( val.find("/md/")!=string::npos) - { - pos = val.find_last_of("/"); - mdName = val.substr(pos+1); - } - file.close(); - return true; - } - } - file.close(); - } - else - { + string tmp; string::size_type pos; //No file, employ mdadm -D name --export @@ -1839,7 +1789,7 @@ { return true; } - } + return false; } Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/MdPartCo.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/MdPartCo.h?rev=62532&r1=62531&r2=62532&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/MdPartCo.h (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/MdPartCo.h Tue Oct 5 10:25:54 2010 @@ -319,10 +319,6 @@ /* returns devices listed as slaves in sysfs directory */ void getSlaves(const string name, std::list<string>& devs_list ); - /* fields in 'map' file */ - enum mdMap { MAP_DEV=0, MAP_META, MAP_UUID, MAP_NAME, }; - static bool findMdMap(std::ifstream& file); - string getContMember() const; //Input: 'mdXXX' device. Modified: branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes?rev=62532&r1=62531&r2=62532&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Tue Oct 5 10:25:54 2010 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Oct 05 10:21:24 CEST 2010 - aschnell@suse.de + +- do not read /var/run/mdadm/map since the UUID is "reversed" + depending on metadata version and endianness + +------------------------------------------------------------------- Mon Aug 16 11:41:30 CEST 2010 - fehr@suse.de - backport support for 4k disks and adapted disk layout from -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org