Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libstorage-ng for openSUSE:Factory checked in at 2022-01-25 17:35:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old) and /work/SRC/openSUSE:Factory/.libstorage-ng.new.1938 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Tue Jan 25 17:35:48 2022 rev:147 rq:947881 version:4.4.76 Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes 2022-01-17 22:34:00.706242375 +0100 +++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.1938/libstorage-ng.changes 2022-01-25 17:36:41.402078167 +0100 @@ -1,0 +2,8 @@ +Fri Jan 21 08:43:56 UTC 2022 - aschn...@suse.com + +- merge gh#openSUSE/libstorage-ng#857 +- add support for RAID metadata versions 1.1 and 1.2 (for bsc#1168914) +- improved integration test for RAIDs +- 4.4.76 + +-------------------------------------------------------------------- Old: ---- libstorage-ng-4.4.75.tar.xz New: ---- libstorage-ng-4.4.76.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.BdmysX/_old 2022-01-25 17:36:42.042073759 +0100 +++ /var/tmp/diff_new_pack.BdmysX/_new 2022-01-25 17:36:42.050073704 +0100 @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 4.4.75 +Version: 4.4.76 Release: 0 Summary: Library for storage management License: GPL-2.0-only ++++++ libstorage-ng-4.4.75.tar.xz -> libstorage-ng-4.4.76.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/LIBVERSION new/libstorage-ng-4.4.76/LIBVERSION --- old/libstorage-ng-4.4.75/LIBVERSION 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/LIBVERSION 2022-01-21 09:43:56.000000000 +0100 @@ -1 +1 @@ -1.72.0 +1.72.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/VERSION new/libstorage-ng-4.4.76/VERSION --- old/libstorage-ng-4.4.75/VERSION 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/VERSION 2022-01-21 09:43:56.000000000 +0100 @@ -1 +1 @@ -4.4.75 +4.4.76 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/create-named.py new/libstorage-ng-4.4.76/integration-tests/md/create-named.py --- old/libstorage-ng-4.4.75/integration-tests/md/create-named.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/create-named.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,9 +1,8 @@ #!/usr/bin/python3 -# requirements: disk /dev/sdb with two empty and unused partitions (sdb1-sdb2) +# requirements: disk /dev/sdc with two empty and unused partitions (sdc1-sdc2) -from sys import exit from storage import * from storageitu import * @@ -17,17 +16,15 @@ staging = storage.get_staging() -sdb1 = Partition.find_by_name(staging, "/dev/sdb1") -sdb2 = Partition.find_by_name(staging, "/dev/sdb2") +sdc1 = Partition.find_by_name(staging, "/dev/sdc1") +sdc2 = Partition.find_by_name(staging, "/dev/sdc2") md_test = Md.create(staging, "/dev/md/test") md_test.set_md_level(MdLevel_RAID0) -md_test.add_device(sdb1) -sdb1.set_id(ID_RAID) - -md_test.add_device(sdb2) -sdb2.set_id(ID_RAID) +for partition in [sdc1, sdc2]: + md_test.add_device(partition) + partition.set_id(ID_RAID) print(staging) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/create-nested.py new/libstorage-ng-4.4.76/integration-tests/md/create-nested.py --- old/libstorage-ng-4.4.75/integration-tests/md/create-nested.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/create-nested.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,9 +1,9 @@ #!/usr/bin/python3 -# requirements: disk /dev/sdb with six empty and unused partitions (sdb1-sdb6) +# requirements: disk /dev/sdc and /dev/sdd with three empty and unused partitions (sdc1-sdc3 +# and sdd1-sdd3) -from sys import exit from storage import * from storageitu import * @@ -20,30 +20,30 @@ md0 = Md.create(staging, "/dev/md0") md0.set_md_level(MdLevel_RAID1) -sdb1 = Partition.find_by_name(staging, "/dev/sdb1") -sdb2 = Partition.find_by_name(staging, "/dev/sdb2") -sdb3 = Partition.find_by_name(staging, "/dev/sdb3") - -md0.add_device(sdb1) -md0.add_device(sdb2) -md0.add_device(sdb3) +sdc1 = Partition.find_by_name(staging, "/dev/sdc1") +sdc2 = Partition.find_by_name(staging, "/dev/sdc2") +sdc3 = Partition.find_by_name(staging, "/dev/sdc3") + +for partition in [sdc1, sdc2, sdc3]: + md0.add_device(partition) + partition.set_id(ID_RAID) md1 = Md.create(staging, "/dev/md1") md1.set_md_level(MdLevel_RAID1) -sdb4 = Partition.find_by_name(staging, "/dev/sdb4") -sdb5 = Partition.find_by_name(staging, "/dev/sdb5") -sdb6 = Partition.find_by_name(staging, "/dev/sdb6") - -md1.add_device(sdb4) -md1.add_device(sdb5) -md1.add_device(sdb6) +sdd1 = Partition.find_by_name(staging, "/dev/sdd1") +sdd2 = Partition.find_by_name(staging, "/dev/sdd2") +sdd3 = Partition.find_by_name(staging, "/dev/sdd3") + +for partition in [sdd1, sdd2, sdd3]: + md1.add_device(partition) + partition.set_id(ID_RAID) md2 = Md.create(staging, "/dev/md2") md2.set_md_level(MdLevel_RAID0) -md2.add_device(md0) -md2.add_device(md1) +for md in [md0, md1]: + md2.add_device(md) print(staging) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/create-raid0.py new/libstorage-ng-4.4.76/integration-tests/md/create-raid0.py --- old/libstorage-ng-4.4.75/integration-tests/md/create-raid0.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/create-raid0.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,9 +1,8 @@ #!/usr/bin/python3 -# requirements: disk /dev/sdb with two empty and unused partitions (sdb1-sdb2) +# requirements: disks /dev/sdc and /dev/sdd with one empty and unused partitions each (sdc1 and sdd1) -from sys import exit from storage import * from storageitu import * @@ -17,17 +16,16 @@ staging = storage.get_staging() -sdb1 = Partition.find_by_name(staging, "/dev/sdb1") -sdb2 = Partition.find_by_name(staging, "/dev/sdb2") +sdc1 = Partition.find_by_name(staging, "/dev/sdc1") +sdd1 = Partition.find_by_name(staging, "/dev/sdd1") md = Md.create(staging, "/dev/md0") +md.set_metadata("default") md.set_md_level(MdLevel_RAID0) -md.add_device(sdb1) -sdb1.set_id(ID_RAID) - -md.add_device(sdb2) -sdb2.set_id(ID_RAID) +for partition in [sdc1, sdd1]: + md.add_device(partition) + partition.set_id(ID_RAID) print(staging) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/create-raid1.py new/libstorage-ng-4.4.76/integration-tests/md/create-raid1.py --- old/libstorage-ng-4.4.75/integration-tests/md/create-raid1.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/create-raid1.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,9 +1,8 @@ #!/usr/bin/python3 -# requirements: disk /dev/sdb and /dev/sdc each with one empty and unused partitions (sdb1 and sdc1) +# requirements: disks /dev/sdc and /dev/sdd with one empty and unused partitions each (sdc1 and sdd1) -from sys import exit from storage import * from storageitu import * @@ -17,17 +16,16 @@ staging = storage.get_staging() -sdb1 = Partition.find_by_name(staging, "/dev/sdb1") sdc1 = Partition.find_by_name(staging, "/dev/sdc1") +sdd1 = Partition.find_by_name(staging, "/dev/sdd1") md = Md.create(staging, "/dev/md0") +md.set_metadata("1.0") md.set_md_level(MdLevel_RAID1) -md.add_device(sdb1) -sdb1.set_id(ID_RAID) - -md.add_device(sdc1) -sdc1.set_id(ID_RAID) +for partition in [sdc1, sdd1]: + md.add_device(partition) + partition.set_id(ID_RAID) print(staging) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/create-raid10.py new/libstorage-ng-4.4.76/integration-tests/md/create-raid10.py --- old/libstorage-ng-4.4.75/integration-tests/md/create-raid10.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/create-raid10.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,10 +1,9 @@ #!/usr/bin/python3 -# requirements: disks /dev/sdb and /dev/sdc with six empty and unused -# partitions (sdb1-sdb3, sdc1-sdc3) +# requirements: disks /dev/sdc and /dev/sdd with six empty and unused +# partitions (sdc1-sdc3, sdd1-sdd3) -from sys import exit from storage import * from storageitu import * @@ -18,24 +17,21 @@ staging = storage.get_staging() -sdb1 = Partition.find_by_name(staging, "/dev/sdb1") -sdb2 = Partition.find_by_name(staging, "/dev/sdb2") -sdb3 = Partition.find_by_name(staging, "/dev/sdb3") - sdc1 = Partition.find_by_name(staging, "/dev/sdc1") sdc2 = Partition.find_by_name(staging, "/dev/sdc2") sdc3 = Partition.find_by_name(staging, "/dev/sdc3") +sdd1 = Partition.find_by_name(staging, "/dev/sdd1") +sdd2 = Partition.find_by_name(staging, "/dev/sdd2") +sdd3 = Partition.find_by_name(staging, "/dev/sdd3") + md = Md.create(staging, "/dev/md0") +md.set_metadata("default") md.set_md_level(MdLevel_RAID10) -md.add_device(sdb1).set_sort_key(1) -md.add_device(sdb2).set_sort_key(3) -md.add_device(sdb3).set_sort_key(5) - -md.add_device(sdc1).set_sort_key(2) -md.add_device(sdc2).set_sort_key(4) -md.add_device(sdc3).set_sort_key(6) +for count, partition in enumerate([sdc1, sdd1, sdc2, sdd2, sdc3, sdd3], start=1): + md.add_device(partition).set_sort_key(count) + partition.set_id(ID_RAID) print(staging) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/create-raid4.py new/libstorage-ng-4.4.76/integration-tests/md/create-raid4.py --- old/libstorage-ng-4.4.75/integration-tests/md/create-raid4.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/create-raid4.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,9 +1,8 @@ #!/usr/bin/python3 -# requirements: disk /dev/sdb with three empty and unused partitions (sdb1-sdb3) +# requirements: disk /dev/sdc with three empty and unused partitions (sdc1-sdc3) -from sys import exit from storage import * from storageitu import * @@ -17,16 +16,16 @@ staging = storage.get_staging() -sdb1 = Partition.find_by_name(staging, "/dev/sdb1") -sdb2 = Partition.find_by_name(staging, "/dev/sdb2") -sdb3 = Partition.find_by_name(staging, "/dev/sdb3") +sdc1 = Partition.find_by_name(staging, "/dev/sdc1") +sdc2 = Partition.find_by_name(staging, "/dev/sdc2") +sdc3 = Partition.find_by_name(staging, "/dev/sdc3") md = Md.create(staging, "/dev/md0") md.set_md_level(MdLevel_RAID4) -md.add_device(sdb1) -md.add_device(sdb2) -md.add_device(sdb3) +for partition in [sdc1, sdc2, sdc3]: + md.add_device(partition) + partition.set_id(ID_RAID) print(staging) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/create-raid5.py new/libstorage-ng-4.4.76/integration-tests/md/create-raid5.py --- old/libstorage-ng-4.4.75/integration-tests/md/create-raid5.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/create-raid5.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,9 +1,8 @@ #!/usr/bin/python3 -# requirements: disk /dev/sdb with four empty and unused partitions (sdb1-sdb4) +# requirements: disk /dev/sdc with four empty and unused partitions (sdc1-sdc4) -from sys import exit from storage import * from storageitu import * @@ -17,18 +16,18 @@ staging = storage.get_staging() -sdb1 = Partition.find_by_name(staging, "/dev/sdb1") -sdb2 = Partition.find_by_name(staging, "/dev/sdb2") -sdb3 = Partition.find_by_name(staging, "/dev/sdb3") -sdb4 = Partition.find_by_name(staging, "/dev/sdb4") +sdc1 = Partition.find_by_name(staging, "/dev/sdc1") +sdc2 = Partition.find_by_name(staging, "/dev/sdc2") +sdc3 = Partition.find_by_name(staging, "/dev/sdc3") +sdc4 = Partition.find_by_name(staging, "/dev/sdc4") md = Md.create(staging, "/dev/md0") +md.set_metadata("1.2") md.set_md_level(MdLevel_RAID5) -md.add_device(sdb1) -md.add_device(sdb2) -md.add_device(sdb3) -md.add_device(sdb4) +for partition in [sdc1, sdc2, sdc3, sdc4]: + md.add_device(partition) + partition.set_id(ID_RAID) print(staging) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/create-raid6.py new/libstorage-ng-4.4.76/integration-tests/md/create-raid6.py --- old/libstorage-ng-4.4.75/integration-tests/md/create-raid6.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/create-raid6.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,9 +1,8 @@ #!/usr/bin/python3 -# requirements: disk /dev/sdb with five empty and unused partitions (sdb1-sdb5) +# requirements: disk /dev/sdc with five empty and unused partitions (sdc1-sdc5) -from sys import exit from storage import * from storageitu import * @@ -17,20 +16,20 @@ staging = storage.get_staging() -sdb1 = Partition.find_by_name(staging, "/dev/sdb1") -sdb2 = Partition.find_by_name(staging, "/dev/sdb2") -sdb3 = Partition.find_by_name(staging, "/dev/sdb3") -sdb4 = Partition.find_by_name(staging, "/dev/sdb4") -sdb5 = Partition.find_by_name(staging, "/dev/sdb5") +sdc1 = Partition.find_by_name(staging, "/dev/sdc1") +sdc2 = Partition.find_by_name(staging, "/dev/sdc2") +sdc3 = Partition.find_by_name(staging, "/dev/sdc3") +sdc4 = Partition.find_by_name(staging, "/dev/sdc4") +sdc5 = Partition.find_by_name(staging, "/dev/sdc5") md = Md.create(staging, "/dev/md0") md.set_md_level(MdLevel_RAID6) -md.add_device(sdb1) -md.add_device(sdb2) -md.add_device(sdb3) -md.add_device(sdb4) -md.add_device(sdb5).set_spare(True) +md.add_device(sdc1) +md.add_device(sdc2) +md.add_device(sdc3) +md.add_device(sdc4) +md.add_device(sdc5).set_spare(True) print(staging) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/create-with-ext4.py new/libstorage-ng-4.4.76/integration-tests/md/create-with-ext4.py --- old/libstorage-ng-4.4.75/integration-tests/md/create-with-ext4.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/create-with-ext4.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,9 +1,8 @@ #!/usr/bin/python3 -# requirements: disk /dev/sdb with two empty and unused partitions (sdb1-sdb2) +# requirements: disk /dev/sdc with two empty and unused partitions (sdc1-sdc2) -from sys import exit from storage import * from storageitu import * @@ -17,17 +16,15 @@ staging = storage.get_staging() -sdb1 = Partition.find_by_name(staging, "/dev/sdb1") -sdb2 = Partition.find_by_name(staging, "/dev/sdb2") +sdc1 = Partition.find_by_name(staging, "/dev/sdc1") +sdc2 = Partition.find_by_name(staging, "/dev/sdc2") md = Md.create(staging, "/dev/md0") md.set_md_level(MdLevel_RAID0) -md.add_device(sdb1) -sdb1.set_id(ID_RAID) - -md.add_device(sdb2) -sdb2.set_id(ID_RAID) +for partition in [sdc1, sdc2]: + md.add_device(partition) + partition.set_id(ID_RAID) ext4 = md.create_blk_filesystem(FsType_EXT4) ext4.set_label("TEST") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/create-with-gpt.py new/libstorage-ng-4.4.76/integration-tests/md/create-with-gpt.py --- old/libstorage-ng-4.4.75/integration-tests/md/create-with-gpt.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/create-with-gpt.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,9 +1,8 @@ #!/usr/bin/python3 -# requirements: disk /dev/sdb with two empty and unused partitions (sdb1-sdb2) +# requirements: disk /dev/sdc with two empty and unused partitions (sdc1-sdc2) -from sys import exit from storage import * from storageitu import * @@ -17,17 +16,15 @@ staging = storage.get_staging() -sdb1 = Partition.find_by_name(staging, "/dev/sdb1") -sdb2 = Partition.find_by_name(staging, "/dev/sdb2") +sdc1 = Partition.find_by_name(staging, "/dev/sdc1") +sdc2 = Partition.find_by_name(staging, "/dev/sdc2") md = Md.create(staging, "/dev/md0") md.set_md_level(MdLevel_RAID0) -md.add_device(sdb1) -sdb1.set_id(ID_RAID) - -md.add_device(sdb2) -sdb2.set_id(ID_RAID) +for partition in [sdc1, sdc2]: + md.add_device(partition) + partition.set_id(ID_RAID) gpt = to_gpt(md.create_partition_table(PtType_GPT)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/create-with-lvm.py new/libstorage-ng-4.4.76/integration-tests/md/create-with-lvm.py --- old/libstorage-ng-4.4.75/integration-tests/md/create-with-lvm.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/create-with-lvm.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,9 +1,8 @@ #!/usr/bin/python3 -# requirements: disk /dev/sdb with two empty and unused partitions (sdb1-sdb2) +# requirements: disk /dev/sdc with two empty and unused partitions (sdc1-sdc2) -from sys import exit from storage import * from storageitu import * @@ -17,17 +16,15 @@ staging = storage.get_staging() -sdb1 = Partition.find_by_name(staging, "/dev/sdb1") -sdb2 = Partition.find_by_name(staging, "/dev/sdb2") +sdc1 = Partition.find_by_name(staging, "/dev/sdc1") +sdc2 = Partition.find_by_name(staging, "/dev/sdc2") md = Md.create(staging, "/dev/md0") md.set_md_level(MdLevel_RAID0) -md.add_device(sdb1) -sdb1.set_id(ID_RAID) - -md.add_device(sdb2) -sdb2.set_id(ID_RAID) +for partition in [sdc1, sdc2]: + md.add_device(partition) + partition.set_id(ID_RAID) test = LvmVg.create(staging, "test") test.add_lvm_pv(md) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/create-with-swap.py new/libstorage-ng-4.4.76/integration-tests/md/create-with-swap.py --- old/libstorage-ng-4.4.75/integration-tests/md/create-with-swap.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/create-with-swap.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,9 +1,8 @@ #!/usr/bin/python3 -# requirements: disk /dev/sdb with two empty and unused partitions (sdb1-sdb2) +# requirements: disk /dev/sdc with two empty and unused partitions (sdc1-sdc2) -from sys import exit from storage import * from storageitu import * @@ -17,17 +16,15 @@ staging = storage.get_staging() -sdb1 = Partition.find_by_name(staging, "/dev/sdb1") -sdb2 = Partition.find_by_name(staging, "/dev/sdb2") +sdc1 = Partition.find_by_name(staging, "/dev/sdc1") +sdc2 = Partition.find_by_name(staging, "/dev/sdc2") md = Md.create(staging, "/dev/md0") md.set_md_level(MdLevel_RAID0) -md.add_device(sdb1) -sdb1.set_id(ID_RAID) - -md.add_device(sdb2) -sdb2.set_id(ID_RAID) +for partition in [sdc1, sdc2]: + md.add_device(partition) + partition.set_id(ID_RAID) swap = md.create_blk_filesystem(FsType_SWAP) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/delete-named.py new/libstorage-ng-4.4.76/integration-tests/md/delete-named.py --- old/libstorage-ng-4.4.75/integration-tests/md/delete-named.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/delete-named.py 2022-01-21 09:43:56.000000000 +0100 @@ -3,7 +3,6 @@ # requirements: md raid /dev/md/test -from sys import exit from storage import * from storageitu import * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/delete.py new/libstorage-ng-4.4.76/integration-tests/md/delete.py --- old/libstorage-ng-4.4.75/integration-tests/md/delete.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/delete.py 2022-01-21 09:43:56.000000000 +0100 @@ -3,7 +3,6 @@ # requirements: md raid md0 -from sys import exit from storage import * from storageitu import * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/extend.py new/libstorage-ng-4.4.76/integration-tests/md/extend.py --- old/libstorage-ng-4.4.75/integration-tests/md/extend.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/extend.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,9 +1,8 @@ #!/usr/bin/python3 -# requirements: md raid /dev/md0 with partitions sdb[1-4] and unused partition sdb5 +# requirements: md raid /dev/md0 with partitions sdc[1-4] and unused partition sdc5 -from sys import exit from storage import * from storageitu import * @@ -17,11 +16,11 @@ staging = storage.get_staging() -sdb5 = Partition.find_by_name(staging, "/dev/sdb5") +sdc5 = Partition.find_by_name(staging, "/dev/sdc5") md = Md.find_by_name(staging, "/dev/md0") -md_user = md.add_device(sdb5) +md_user = md.add_device(sdc5) md_user.set_spare(True) print(staging) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/free-numeric-name.py new/libstorage-ng-4.4.76/integration-tests/md/free-numeric-name.py --- old/libstorage-ng-4.4.75/integration-tests/md/free-numeric-name.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/free-numeric-name.py 2022-01-21 09:43:56.000000000 +0100 @@ -3,7 +3,6 @@ # requirements: none -from sys import exit from storage import * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/reduce.py new/libstorage-ng-4.4.76/integration-tests/md/reduce.py --- old/libstorage-ng-4.4.75/integration-tests/md/reduce.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/reduce.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,9 +1,8 @@ #!/usr/bin/python3 -# requirements: md raid /dev/md0 with partitions sdb[1-5] +# requirements: md raid /dev/md0 with partitions sdc[1-5] -from sys import exit from storage import * from storageitu import * @@ -17,11 +16,11 @@ staging = storage.get_staging() -sdb5 = Partition.find_by_name(staging, "/dev/sdb5") +sdc5 = Partition.find_by_name(staging, "/dev/sdc5") md = Md.find_by_name(staging, "/dev/md0") -md.remove_device(sdb5) +md.remove_device(sdc5) print(staging) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/set-in-etc-mdadm.py new/libstorage-ng-4.4.76/integration-tests/md/set-in-etc-mdadm.py --- old/libstorage-ng-4.4.75/integration-tests/md/set-in-etc-mdadm.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/set-in-etc-mdadm.py 2022-01-21 09:43:56.000000000 +0100 @@ -3,7 +3,6 @@ # requirements: md raid md0 -from sys import exit from storage import * from storageitu import * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/integration-tests/md/size-and-topology.py new/libstorage-ng-4.4.76/integration-tests/md/size-and-topology.py --- old/libstorage-ng-4.4.75/integration-tests/md/size-and-topology.py 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/integration-tests/md/size-and-topology.py 2022-01-21 09:43:56.000000000 +0100 @@ -1,7 +1,6 @@ #!/usr/bin/python3 -# requirements: disk /dev/sdb with 8 empty and unused partitions preferably of -# slightly different size (sdb1-sdb8) +# requirements: unused partitions listed below # TODO create the partitions in the program so that tests are run several # times with partitions of different sizes @@ -9,12 +8,17 @@ # TODO add spare devices -from sys import exit from os import system from storage import * from storageitu import * +# should be of slightly different size +# should be at least 130 GiB so that mdadm reserves the max limit for bitmap + +partitions = ["/dev/sdc1", "/dev/sdd1", "/dev/sdc2", "/dev/sdd2"] + + results = open("size-and-topology.txt", 'w') @@ -29,10 +33,11 @@ return int(line) -def doit(level, devices, chunk_size): +def doit(metadata, level, num_devices, chunk_size): print() - print("level:", get_md_level_name(level), "devices:", devices, "chunk-size:", chunk_size) + print("metadata:", metadata, "level:", get_md_level_name(level), "devices:", num_devices, + "chunk-size:", chunk_size) print() storage = Storage(environment) @@ -41,11 +46,13 @@ staging = storage.get_staging() md = Md.create(staging, "/dev/md0") + md.set_in_etc_mdadm(False) + md.set_metadata(metadata) md.set_md_level(level) md.set_chunk_size(chunk_size) - for number in range(1, devices + 1): - partition = Partition.find_by_name(staging, '/dev/sdb%d' % number) + for number in range(num_devices): + partition = Partition.find_by_name(staging, partitions[number]) md.add_device(partition) expected_size = md.get_size() @@ -60,18 +67,19 @@ size_ok = expected_size == seen_size io_size_ok = expected_io_size == seen_io_size - results.write("level:%s, devices:%d, chunk-size:%d" %(get_md_level_name(level), devices, chunk_size)) + results.write("metadata:%s, level:%s, devices:%d, chunk-size:%d" %(metadata, get_md_level_name(level), + num_devices, chunk_size)) if size_ok: results.write(", size %d" % (expected_size)) else: if expected_size < seen_size: results.write(", size %d < %d" % (expected_size, seen_size)) else: - results.write(", size %d > %d" % (expected_size, seen_size)) + results.write(", size! %d > %d" % (expected_size, seen_size)) if io_size_ok: results.write(", io-size %d" % (expected_io_size)) else: - results.write(", io-size %d != %d" % (expected_io_size, seen_io_size)) + results.write(", io-size! %d != %d" % (expected_io_size, seen_io_size)) results.write("\n") results.flush() @@ -85,44 +93,50 @@ commit(storage) -max_devices = 8 +max_devices = len(partitions) -for devices in range(2, max_devices + 1): +for num_devices in range(2, max_devices + 1): for chunk_size in range(15, 20): - doit(MdLevel_RAID0, devices, 2**chunk_size) - cleanup() + for metadata in ["1.0", "1.2"]: + doit(metadata, MdLevel_RAID0, num_devices, 2**chunk_size) + cleanup() results.write("\n") -for devices in range(2, max_devices + 1): - doit(MdLevel_RAID1, devices, 0) - cleanup() +for num_devices in range(2, max_devices + 1): + for metadata in ["1.0", "1.2"]: + doit(metadata, MdLevel_RAID1, 2, 0) + cleanup() results.write("\n") -for devices in range(3, max_devices + 1): +for num_devices in range(3, max_devices + 1): for chunk_size in range(15, 20): - doit(MdLevel_RAID4, devices, 2**chunk_size) - cleanup() + for metadata in ["1.0", "1.2"]: + doit(metadata, MdLevel_RAID4, num_devices, 2**chunk_size) + cleanup() results.write("\n") -for devices in range(3, max_devices + 1): +for num_devices in range(3, max_devices + 1): for chunk_size in range(15, 20): - doit(MdLevel_RAID5, devices, 2**chunk_size) - cleanup() + for metadata in ["1.0", "1.2"]: + doit(metadata, MdLevel_RAID5, num_devices, 2**chunk_size) + cleanup() results.write("\n") -for devices in range(4, max_devices + 1): +for num_devices in range(4, max_devices + 1): for chunk_size in range(15, 20): - doit(MdLevel_RAID6, devices, 2**chunk_size) - cleanup() + for metadata in ["1.0", "1.2"]: + doit(metadata, MdLevel_RAID6, num_devices, 2**chunk_size) + cleanup() results.write("\n") -for devices in range(2, max_devices + 1): +for num_devices in range(2, max_devices + 1): for chunk_size in range(15, 20): - doit(MdLevel_RAID10, devices, 2**chunk_size) - cleanup() + for metadata in ["1.0", "1.2"]: + doit(metadata, MdLevel_RAID10, num_devices, 2**chunk_size) + cleanup() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/storage/Devices/Md.h new/libstorage-ng-4.4.76/storage/Devices/Md.h --- old/libstorage-ng-4.4.75/storage/Devices/Md.h 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/storage/Devices/Md.h 2022-01-21 09:43:56.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) [2016-2021] SUSE LLC + * Copyright (c) [2016-2022] SUSE LLC * * All Rights Reserved. * @@ -207,7 +207,12 @@ const std::string& get_metadata() const; /** - * Currently only creating metadata 1.0 is supported. Although others might work. + * Set metadata for new created Linux RAID. Allowed values are "1.0", "1.1", "1.2" + * and "default" (as long as mdadm treats "default" as "1.2"). Other values might + * also work. + * + * If a specific metadata version is required it should be set since the default + * can change. */ void set_metadata(const std::string& metadata); @@ -289,7 +294,8 @@ * desired size. * * Calculation is not accurate. Does not consider details like alignment, chunk - * size, bitmap location or metadata version. + * size, bitmap location or metadata version. It may also change in future + * versions. * * @throw Exception */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/storage/Devices/MdImpl.cc new/libstorage-ng-4.4.76/storage/Devices/MdImpl.cc --- old/libstorage-ng-4.4.75/storage/Devices/MdImpl.cc 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/storage/Devices/MdImpl.cc 2022-01-21 09:43:56.000000000 +0100 @@ -199,7 +199,12 @@ } // see calculate_region_and_topology + underlying_size += max(128 * KiB, underlying_size / 1024); + underlying_size += get_default_chunk_size(); + underlying_size += 1 * MiB; + underlying_size += 8 * KiB; underlying_size += min(128 * MiB, underlying_size / 64); + underlying_size += 16 * KiB; return underlying_size; } @@ -352,7 +357,7 @@ unsigned long - Md::Impl::get_default_chunk_size() const + Md::Impl::get_default_chunk_size() { return 512 * KiB; } @@ -908,9 +913,13 @@ // big can lead to severe problems later on, e.g. a partition not // fitting anymore, we make a conservative calculation. - // For combining disks with different block sizes, see doc/md-raid.md. + // The size depends slightly on the metadata version but this effect is not + // considered here. + + // Location of superblock, data offset and more can be seen with "mdadm --examine + // /dev/sdxn" for each device. - const bool conservative = true; + // For combining disks with different block sizes, see doc/md-raid.md. // Since our size calculation is not accurate we must not recalculate // the size of an RAID existing on disk. That would cause a resize @@ -947,21 +956,28 @@ bool spare = md_user->is_spare(); bool journal = md_user->is_journal(); - // metadata for version 1.0 is 4 KiB block at end aligned to 4 KiB, - // https://raid.wiki.kernel.org/index.php/RAID_superblock_formats - size = (size & ~(0x1000ULL - 1)) - 0x2000; + // see super1.c in mdadm sources for hints - // size used for bitmap depends on device size + // includes some alignment + unsigned long long superblock_size = 16 * KiB; - if (conservative) - { - // trim device size by 128 MiB but not more than roughly 1% - size -= min(128 * MiB, size / 64); - } + // roughly 1% with 128 MiB limit + unsigned long long bitmap_size = min(128 * MiB, size / 64); + + // man page says 4 KiB but from the code it looks like 8 KiB + unsigned long long badblocklog_size = 8 * KiB; + + size = subtract_saturated(size, superblock_size + bitmap_size + badblocklog_size + real_chunk_size); + + // for metadata version 1.1 and 1.2 the data-offset is rounded by 1 MiB + size = round_down(size, 1 * MiB); long rest = size % real_chunk_size; if (rest > 0) - size -= rest; + size = subtract_saturated(size, rest); + + // safety net + size = subtract_saturated(size, max(128 * KiB, size / 1024)); if (!spare && !journal) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/storage/Devices/MdImpl.h new/libstorage-ng-4.4.76/storage/Devices/MdImpl.h --- old/libstorage-ng-4.4.75/storage/Devices/MdImpl.h 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/storage/Devices/MdImpl.h 2022-01-21 09:43:56.000000000 +0100 @@ -95,7 +95,7 @@ unsigned long get_chunk_size() const { return chunk_size; } void set_chunk_size(unsigned long chunk_size); - unsigned long get_default_chunk_size() const; + static unsigned long get_default_chunk_size(); const string& get_uuid() const { return uuid; } void set_uuid(const string& uuid) { Impl::uuid = uuid; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/storage/Utils/Math.h new/libstorage-ng-4.4.76/storage/Utils/Math.h --- old/libstorage-ng-4.4.75/storage/Utils/Math.h 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/storage/Utils/Math.h 2022-01-21 09:43:56.000000000 +0100 @@ -79,6 +79,16 @@ return __builtin_clzll(i); } + + /** + * Saturated subtraction. + */ + inline unsigned long long + subtract_saturated(unsigned long long a, unsigned long long b) + { + return b < a ? a - b : 0; + } + } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/testsuite/CompoundAction/md-sentence.cc new/libstorage-ng-4.4.76/testsuite/CompoundAction/md-sentence.cc --- old/libstorage-ng-4.4.75/testsuite/CompoundAction/md-sentence.cc 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/testsuite/CompoundAction/md-sentence.cc 2022-01-21 09:43:56.000000000 +0100 @@ -93,7 +93,7 @@ BOOST_REQUIRE( compound_action ) ; string expected = - "Create RAID6 /dev/md0 (1023.75 GiB) for /data with ext4\n" + "Create RAID6 /dev/md0 (1022.75 GiB) for /data with ext4\n" "from /dev/sda (512.00 GiB), /dev/sdb (512.00 GiB), /dev/sdc (512.00 GiB) and /dev/sdd (512.00 GiB)"; BOOST_CHECK_EQUAL( compound_action->sentence(), expected ); @@ -120,7 +120,7 @@ BOOST_REQUIRE( compound_action ) ; string expected = - "Create encrypted RAID1 /dev/md0 (511.87 GiB) for /secret with xfs\n" + "Create encrypted RAID1 /dev/md0 (511.37 GiB) for /secret with xfs\n" "from /dev/sda (512.00 GiB) and /dev/sdb (512.00 GiB)"; BOOST_CHECK_EQUAL( compound_action->sentence(), expected ); @@ -145,7 +145,7 @@ BOOST_REQUIRE( compound_action ) ; string expected = - "Create encrypted RAID1 /dev/md0 (511.87 GiB) with xfs\n" + "Create encrypted RAID1 /dev/md0 (511.37 GiB) with xfs\n" "from /dev/sda (512.00 GiB) and /dev/sdb (512.00 GiB)"; BOOST_CHECK_EQUAL( compound_action->sentence(), expected ); @@ -167,7 +167,7 @@ BOOST_REQUIRE( compound_action ) ; string expected = - "Create RAID1 /dev/md0 (511.87 GiB) from /dev/sda (512.00 GiB) and /dev/sdb (512.00 GiB)"; + "Create RAID1 /dev/md0 (511.37 GiB) from /dev/sda (512.00 GiB) and /dev/sdb (512.00 GiB)"; BOOST_CHECK_EQUAL( compound_action->sentence(), expected ); @@ -192,7 +192,7 @@ BOOST_REQUIRE( compound_action ) ; - string expected = "Format RAID6 /dev/md0 (1023.75 GiB) for /data with ext4"; + string expected = "Format RAID6 /dev/md0 (1022.75 GiB) for /data with ext4"; BOOST_CHECK_EQUAL( compound_action->sentence(), expected ); @@ -218,7 +218,7 @@ BOOST_REQUIRE( compound_action ) ; - string expected = "Encrypt RAID5 /dev/md0 (1023.75 GiB) for /data with xfs"; + string expected = "Encrypt RAID5 /dev/md0 (1022.75 GiB) for /data with xfs"; BOOST_CHECK_EQUAL( compound_action->sentence(), expected ); @@ -243,7 +243,7 @@ BOOST_REQUIRE( compound_action ) ; - string expected = "Mount RAID5 /dev/md0 (1023.75 GiB) at /data"; + string expected = "Mount RAID5 /dev/md0 (1022.75 GiB) at /data"; BOOST_CHECK_EQUAL( compound_action->sentence(), expected ); @@ -268,7 +268,7 @@ BOOST_REQUIRE( compound_action ) ; string expected = - "Create encrypted RAID1 /dev/md1 (511.87 GiB) for swap\n" + "Create encrypted RAID1 /dev/md1 (511.37 GiB) for swap\n" "from /dev/sda (512.00 GiB) and /dev/sdb (512.00 GiB)" "\nare you serious?!"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.75/testsuite/md4.cc new/libstorage-ng-4.4.76/testsuite/md4.cc --- old/libstorage-ng-4.4.75/testsuite/md4.cc 2022-01-17 13:24:42.000000000 +0100 +++ new/libstorage-ng-4.4.76/testsuite/md4.cc 2022-01-21 09:43:56.000000000 +0100 @@ -36,13 +36,13 @@ md0->add_device(sdb); - BOOST_CHECK_EQUAL(md0->get_size(), 10079961088); + BOOST_CHECK_EQUAL(md0->get_size(), 10066974720); md0->add_device(sdc); - BOOST_CHECK_EQUAL(md0->get_size(), 15119941632); + BOOST_CHECK_EQUAL(md0->get_size(), 15100462080); md0->remove_device(sdc); - BOOST_CHECK_EQUAL(md0->get_size(), 10079961088); + BOOST_CHECK_EQUAL(md0->get_size(), 10066974720); }