commit libstorage for openSUSE:Factory
![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package libstorage for openSUSE:Factory checked in at Fri Sep 9 13:20:39 CEST 2011. -------- --- libstorage/libstorage.changes 2011-08-25 13:09:40.000000000 +0200 +++ /mounts/work_src_done/STABLE/libstorage/libstorage.changes 2011-09-08 17:18:16.000000000 +0200 @@ -1,0 +2,25 @@ +Wed Sep 7 16:47:34 CEST 2011 - fehr@suse.de + +- version 2.21.6 +- ignore btrfs fs when blockid does not see also btrfs (bnc#716058) +- call zeroDevice always before formatting to prevent multiple + signatures being present (bnc#716058) +- use wipefs to remove any existing signatures in zeroDevice + +------------------------------------------------------------------- +Mon Sep 5 16:01:05 CEST 2011 - fehr@suse.de + +- fix detection of mount by label on btrfs +- use "btrfs filesystem label" to handle label on btrfs + +------------------------------------------------------------------- +Mon Sep 05 14:17:29 CEST 2011 - aschnell@suse.de + +- handle device name change in btrfs (bnc#715652) + +------------------------------------------------------------------- +Tue Aug 30 11:09:46 CEST 2011 - aschnell@suse.de + +- fixed setting of size for partitions on MD RAID (bnc#714397) + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- libstorage-2.21.5.tar.bz2 New: ---- libstorage-2.21.6.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage.spec ++++++ --- /var/tmp/diff_new_pack.xA1IIq/_old 2011-09-09 13:20:34.000000000 +0200 +++ /var/tmp/diff_new_pack.xA1IIq/_new 2011-09-09 13:20:34.000000000 +0200 @@ -19,7 +19,7 @@ Name: libstorage -Version: 2.21.5 +Version: 2.21.6 Release: 1 License: GPL Group: System/Libraries @@ -89,6 +89,7 @@ Obsoletes: libstorage < 2.21.2 Provides: libstorage = %{version} Summary: Library for storage management +Group: System/Libraries %description -n libstorage3 This package contains libstorage, a library for storage management. @@ -173,4 +174,5 @@ %defattr(-,root,root) %dir /usr/lib/libstorage /usr/lib/libstorage/testsuite-real + %changelog ++++++ libstorage-2.21.5.tar.bz2 -> libstorage-2.21.6.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.21.5/VERSION new/libstorage-2.21.6/VERSION --- old/libstorage-2.21.5/VERSION 2011-08-25 13:03:00.000000000 +0200 +++ new/libstorage-2.21.6/VERSION 2011-09-08 12:06:22.000000000 +0200 @@ -1 +1 @@ -2.21.5 +2.21.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.21.5/storage/Btrfs.cc new/libstorage-2.21.6/storage/Btrfs.cc --- old/libstorage-2.21.5/storage/Btrfs.cc 2011-08-09 15:39:44.000000000 +0200 +++ new/libstorage-2.21.6/storage/Btrfs.cc 2011-09-07 16:52:25.000000000 +0200 @@ -43,7 +43,8 @@ y2mil("constructed btrfs vol size:" << sz << " devs:" << devs ); y2mil("constructed btrfs vol from:" << v ); setFs(BTRFS); - changeMountBy(MOUNTBY_UUID); + if( getMountBy()!=MOUNTBY_LABEL ) + changeMountBy(MOUNTBY_UUID); setSize( sz ); } @@ -476,12 +477,31 @@ if( devices.size()>1 ) { for( list<string>::const_iterator s=devices.begin(); s!=devices.end(); ++s ) - getContainer()->getStorage()->zeroDevice(*s,0); + getContainer()->getStorage()->zeroDevice(*s); } y2mil( "ret:" << ret ); return( ret ); } + + void + Btrfs::changeDeviceName( const string& old, const string& nw ) + { + if (dev == old) + { + Volume const* v; + if (getStorage()->findVolume(old, v)) + setNameDevice(v->name(), nw); + else + y2err("device " << old << " not fount"); + } + + list<string>::iterator i = find(dev_add.begin(), dev_add.end(), old); + if (i != dev_add.end()) + *i = nw; + } + + Text Btrfs::removeText(bool doing) const { Text txt; @@ -494,9 +514,9 @@ else { // displayed text before action, %1$s is replaced by device names e.g /dev/sda1 /dev/sda2 - // %2$s is replaced by size (e.g. 623.5 MB) - txt = sformat( _("Delete Btrfs volume on devices %1$s (%2$s)"), - d.c_str(), sizeString().c_str() ); + // %2$s is replaced by size (e.g. 623.5 MB) + txt = sformat( _("Delete Btrfs volume on devices %1$s (%2$s)"), + d.c_str(), sizeString().c_str() ); } return( txt ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.21.5/storage/Btrfs.h new/libstorage-2.21.6/storage/Btrfs.h --- old/libstorage-2.21.5/storage/Btrfs.h 2011-08-09 15:39:44.000000000 +0200 +++ new/libstorage-2.21.6/storage/Btrfs.h 2011-09-05 16:42:45.000000000 +0200 @@ -84,6 +84,7 @@ void unuseDev() const; int clearSignature(); + void changeDeviceName( const string& old, const string& nw ); static bool notDeleted( const Btrfs& l ) { return( !l.deleted() ); } static bool needCreateSubvol( const Btrfs& v ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.21.5/storage/BtrfsCo.cc new/libstorage-2.21.6/storage/BtrfsCo.cc --- old/libstorage-2.21.5/storage/BtrfsCo.cc 2011-08-15 17:00:30.000000000 +0200 +++ new/libstorage-2.21.6/storage/BtrfsCo.cc 2011-09-07 17:11:05.000000000 +0200 @@ -98,6 +98,16 @@ i!=ub.end(); ++i ) { forbidden = i->type()!=UB_BTRFS; + if( forbidden ) + y2mil( "forbidden:" << v->device() << + " used by non-btrfs:" << v->getUsedBy() ); + } + if( !forbidden ) + { + forbidden = v->getFs()!=BTRFS; + if( forbidden ) + y2mil( "forbidden:" << v->device() << + " non-btrfs:" << v->fsTypeString() ); } if( !ub.empty() ) y2mil( "used_by:" << ub ); @@ -151,7 +161,7 @@ if( !mp.empty() ) { i->clearSubvol(); - SystemCmd cmd( "btrfs subvolume list " + mp ); + SystemCmd cmd( BTRFSBIN " subvolume list " + mp ); for( vector<string>::const_iterator s=cmd.stdout().begin(); s!=cmd.stdout().end(); ++s ) { @@ -470,6 +480,18 @@ return( ret ); } + + void + BtrfsCo::changeDeviceName( const string& old, const string& nw ) + { + BtrfsPair p = btrfsPair(); + for (BtrfsIter i = p.begin(); i != p.end(); ++i) + { + i->changeDeviceName( old, nw ); + } + } + + void BtrfsCo::logData(const string& Dir) const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.21.5/storage/BtrfsCo.h new/libstorage-2.21.6/storage/BtrfsCo.h --- old/libstorage-2.21.5/storage/BtrfsCo.h 2011-08-09 15:39:44.000000000 +0200 +++ new/libstorage-2.21.6/storage/BtrfsCo.h 2011-09-05 16:42:45.000000000 +0200 @@ -57,6 +57,8 @@ int doRemove( Volume* v ); + void changeDeviceName( const string& old, const string& nw ); + static storage::CType staticType() { return storage::BTRFSC; } friend std::ostream& operator<< (std::ostream&, const BtrfsCo& ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.21.5/storage/Disk.cc new/libstorage-2.21.6/storage/Disk.cc --- old/libstorage-2.21.5/storage/Disk.cc 2011-08-24 16:59:00.000000000 +0200 +++ new/libstorage-2.21.6/storage/Disk.cc 2011-09-05 16:42:45.000000000 +0200 @@ -1782,7 +1782,7 @@ ret = true; - if( !dmp_slave && p->type() != EXTENDED ) + if( !no_addpart && p->type() != EXTENDED ) { ProcParts parts; unsigned long long s = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.21.5/storage/MdCo.cc new/libstorage-2.21.6/storage/MdCo.cc --- old/libstorage-2.21.5/storage/MdCo.cc 2010-11-03 12:41:22.000000000 +0100 +++ new/libstorage-2.21.6/storage/MdCo.cc 2011-09-07 16:52:25.000000000 +0200 @@ -539,7 +539,7 @@ y2mil("zeroNew:" << getStorage()->getZeroNewPartitions() << " used_as_pv:" << used_as_pv); if( used_as_pv || getStorage()->getZeroNewPartitions() ) { - ret = Storage::zeroDevice(m->device(), m->sizeK()); + ret = Storage::zeroDevice(m->device()); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.21.5/storage/Partition.cc new/libstorage-2.21.6/storage/Partition.cc --- old/libstorage-2.21.5/storage/Partition.cc 2011-03-24 14:09:20.000000000 +0100 +++ new/libstorage-2.21.6/storage/Partition.cc 2011-09-07 16:52:25.000000000 +0200 @@ -367,7 +367,7 @@ if (zero_new || used_as_pv) { - ret = getContainer()->getStorage()->zeroDevice(device(), sizeK()); + ret = getContainer()->getStorage()->zeroDevice(device()); } return ret; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.21.5/storage/Storage.cc new/libstorage-2.21.6/storage/Storage.cc --- old/libstorage-2.21.5/storage/Storage.cc 2011-08-10 16:42:40.000000000 +0200 +++ new/libstorage-2.21.6/storage/Storage.cc 2011-09-07 17:13:52.000000000 +0200 @@ -26,6 +26,7 @@ #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> +#include <sys/mount.h> #include <pwd.h> #include <signal.h> #include <set> @@ -7302,12 +7303,36 @@ return ret; } +unsigned long long Storage::sizeK( const string& device ) + { + unsigned long long ret = 0; + int fd = open(device.c_str(), O_RDONLY); + if (fd >= 0) + { + uint64_t bytes = 0; + int rcode = ioctl(fd, BLKGETSIZE64, &bytes); + y2mil("BLKGETSIZE64 rcode:" << rcode << " bytes:" << bytes); + if (rcode == 0 && bytes != 0) + ret = bytes / 1024; + else + { + unsigned long blocks; + rcode = ioctl(fd, BLKGETSIZE, &blocks); + y2mil("BLKGETSIZE rcode:" << rcode << " blocks:" << blocks); + if (rcode == 0 && blocks != 0) + ret = blocks*2; + } + close(fd); + } + y2mil("device:" << device << " ret:" << ret ); + return( ret ); + } int -Storage::zeroDevice(const string& device, unsigned long long sizeK, bool random, +Storage::zeroDevice(const string& device, bool random, unsigned long long startK, unsigned long long endK) { - y2mil("device:" << device << " sizeK:" << sizeK << " random:" << random << + y2mil("device:" << device << " random:" << random << " startK:" << startK << " endK:" << endK); waitForDevice(device); @@ -7319,20 +7344,16 @@ SystemCmd c; string cmd; - if( sizeK>0 ) - startK = min(startK, sizeK); + cmd = WIPEFSBIN " -a " + quote(device); + c.execute(cmd); + + unsigned long long sz = sizeK(device); + if( sz>0 ) + startK = min(startK, sz); cmd = DDBIN " if=" + source + " of=" + quote(device) + " bs=1k count=" + decString(startK) + " conv=nocreat"; if (c.execute(cmd) != 0) ret = STORAGE_ZERO_DEVICE_FAILED; - if( sizeK>0 ) - { - endK = min(endK, sizeK); - cmd = DDBIN " if=" + source + " of=" + quote(device) + " seek=" + decString(sizeK - endK) + - " bs=1k count=" + decString(endK) + " conv=nocreat"; - if (c.execute(cmd) != 0) - ret = STORAGE_ZERO_DEVICE_FAILED; - } y2mil("ret:" << ret); return ret; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.21.5/storage/Storage.h new/libstorage-2.21.6/storage/Storage.h --- old/libstorage-2.21.5/storage/Storage.h 2011-08-09 15:39:44.000000000 +0200 +++ new/libstorage-2.21.6/storage/Storage.h 2011-09-07 16:52:25.000000000 +0200 @@ -558,8 +558,9 @@ static void waitForDevice(); static int waitForDevice(const string& device); - static int zeroDevice(const string& device, unsigned long long sizeK, bool random = false, + static int zeroDevice(const string& device, bool random = false, unsigned long long beginK = 200, unsigned long long endK = 10); + static unsigned long long sizeK( const string& device ); void getDiskList( bool (* CheckFnc)( const Disk& ), std::list<Disk*>& dl ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.21.5/storage/StorageDefines.h new/libstorage-2.21.6/storage/StorageDefines.h --- old/libstorage-2.21.5/storage/StorageDefines.h 2011-08-24 16:59:01.000000000 +0200 +++ new/libstorage-2.21.6/storage/StorageDefines.h 2011-09-07 16:52:25.000000000 +0200 @@ -60,6 +60,7 @@ #define DMSETUPBIN "/sbin/dmsetup" #define DMRAIDBIN "/sbin/dmraid" #define BTRFSBIN "/sbin/btrfs" +#define WIPEFSBIN "/sbin/wipefs" #define MOUNTBIN "/bin/mount" #define UMOUNTBIN "/bin/umount" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-2.21.5/storage/Volume.cc new/libstorage-2.21.6/storage/Volume.cc --- old/libstorage-2.21.5/storage/Volume.cc 2011-08-23 15:02:14.000000000 +0200 +++ new/libstorage-2.21.6/storage/Volume.cc 2011-09-07 17:14:31.000000000 +0200 @@ -833,8 +833,6 @@ SystemCmd c; string defvol = getStorage()->getDefaultSubvolName(); string cmd = "/sbin/mkfs.btrfs " + quote(mountDevice()); - if( !label.empty() ) - cmd += " -L" + label; c.execute( cmd ); if( c.retcode()!=0 ) { @@ -945,18 +943,13 @@ { getStorage()->removeDmTableTo( *this ); } - if( ret==0 && encryption!=ENC_NONE ) - { - ret = Storage::zeroDevice(mountDevice(), size_k, true); - } if( ret==0 && mountDevice()!=dev && !getStorage()->testmode() ) { ret = checkDevice(mountDevice()); } - if( ret==0 && mountDevice().find( "/dev/md" )!=0 && - mountDevice().find( "/dev/loop" )!=0 ) + if( ret==0 ) { - SystemCmd(MDADMBIN " --zero-superblock " + quote(mountDevice())); + ret = Storage::zeroDevice(mountDevice(), encryption!=ENC_NONE); } if( ret==0 ) { @@ -1113,7 +1106,7 @@ uuid = "testmode-0123-4567-6666-98765432"+decString(fcount++); } } - if( ret==0 && !label.empty() && fs!=BTRFS ) + if( ret==0 && !label.empty() ) { ret = doSetLabel(); } @@ -2429,6 +2422,10 @@ cmd += " -U " + quote(uuid); cmd += " " + quote(mountDevice()); break; + case BTRFS: + cmd = BTRFSBIN " filesystem label " + quote(mountDevice()); + cmd += " " + quote(label); + break; default: ret = VOLUME_MKLABEL_FS_UNABLE; break; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de