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-09-04 22:11:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old) and /work/SRC/openSUSE:Factory/.libstorage-ng.new.2083 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Sun Sep 4 22:11:31 2022 rev:180 rq:1000934 version:4.5.43 Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes 2022-08-23 14:26:39.503227663 +0200 +++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.2083/libstorage-ng.changes 2022-09-04 22:11:32.624245440 +0200 @@ -1,0 +2,8 @@ +Fri Sep 2 15:07:51 UTC 2022 - aschn...@suse.com + +- merge gh#openSUSE/libstorage-ng#896 +- avoid problems with duplicate MD device names during activation + (bsc#1199307) +- 4.5.43 + +-------------------------------------------------------------------- Old: ---- libstorage-ng-4.5.42.tar.xz New: ---- libstorage-ng-4.5.43.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.XShtAE/_old 2022-09-04 22:11:33.236247161 +0200 +++ /var/tmp/diff_new_pack.XShtAE/_new 2022-09-04 22:11:33.240247173 +0200 @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 4.5.42 +Version: 4.5.43 Release: 0 Summary: Library for storage management License: GPL-2.0-only ++++++ libstorage-ng-4.5.42.tar.xz -> libstorage-ng-4.5.43.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.42/VERSION new/libstorage-ng-4.5.43/VERSION --- old/libstorage-ng-4.5.42/VERSION 2022-08-12 12:13:06.000000000 +0200 +++ new/libstorage-ng-4.5.43/VERSION 2022-09-02 17:07:51.000000000 +0200 @@ -1 +1 @@ -4.5.42 +4.5.43 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.42/storage/Devices/MdImpl.cc new/libstorage-ng-4.5.43/storage/Devices/MdImpl.cc --- old/libstorage-ng-4.5.42/storage/Devices/MdImpl.cc 2022-08-12 12:13:06.000000000 +0200 +++ new/libstorage-ng-4.5.43/storage/Devices/MdImpl.cc 2022-09-02 17:07:51.000000000 +0200 @@ -32,7 +32,7 @@ #include "storage/Action.h" #include "storage/Storage.h" #include "storage/Prober.h" -#include "storage/Environment.h" +#include "storage/EnvironmentImpl.h" #include "storage/SystemInfo/SystemInfoImpl.h" #include "storage/Utils/AppUtil.h" #include "storage/Utils/Exception.h" @@ -370,7 +370,6 @@ } - bool Md::Impl::is_valid_sysfs_name(const string& name) { @@ -396,22 +395,41 @@ // digit string). Using 'mdadm --assemble --scan --config=partitions' // the members of containers are not started at all. - string filename = tmp_dir.get_fullname() + "/mdadm.conf"; + // But using the additional step with --examine causes problems with duplicate MD + // device names (see bsc #1199307). + + switch (mdadm_activate_method()) + { + case 0: + { + SystemCmd cmd(MDADM_BIN " --assemble --scan"); + + if (cmd.retcode() == 0) + SystemCmd(UDEVADM_BIN_SETTLE); - string cmd_line1 = MDADM_BIN " --examine --scan > " + quote(filename); + return cmd.retcode() == 0; + } + + case 1: + { + string filename = tmp_dir.get_fullname() + "/mdadm.conf"; - SystemCmd cmd1(cmd_line1); + string cmd_line1 = MDADM_BIN " --examine --scan > " + quote(filename); + SystemCmd cmd1(cmd_line1); - string cmd_line2 = MDADM_BIN " --assemble --scan --config=" + quote(filename); + string cmd_line2 = MDADM_BIN " --assemble --scan --config=" + quote(filename); + SystemCmd cmd2(cmd_line2); - SystemCmd cmd2(cmd_line2); + if (cmd2.retcode() == 0) + SystemCmd(UDEVADM_BIN_SETTLE); - if (cmd2.retcode() == 0) - SystemCmd(UDEVADM_BIN_SETTLE); + unlink(filename.c_str()); - unlink(filename.c_str()); + return cmd2.retcode() == 0; + } + } - return cmd2.retcode() == 0; + return false; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.42/storage/EnvironmentImpl.cc new/libstorage-ng-4.5.43/storage/EnvironmentImpl.cc --- old/libstorage-ng-4.5.42/storage/EnvironmentImpl.cc 2022-08-12 12:13:06.000000000 +0200 +++ new/libstorage-ng-4.5.43/storage/EnvironmentImpl.cc 2022-09-02 17:07:51.000000000 +0200 @@ -142,6 +142,14 @@ } + int + mdadm_activate_method() + { + const char* p = getenv("LIBSTORAGE_MDADM_ACTIVATE_METHOD"); + return p ? atoi(p) : 0; + } + + void Environment::Impl::extra_log() { @@ -152,12 +160,13 @@ "LD_LIBRARY_PATH", "LD_PRELOAD", "LIBSTORAGE_BTRFS_QGROUPS", - "LIBSTORAGE_MULTIPLE_DEVICES_BTRFS", - "LIBSTORAGE_PFSOEMS", "LIBSTORAGE_BTRFS_SNAPSHOT_RELATIONS", "LIBSTORAGE_DEVELOPER_MODE", - "LIBSTORAGE_ROOTPREFIX", "LIBSTORAGE_LOCKFILE_ROOT", + "LIBSTORAGE_MDADM_ACTIVATE_METHOD", + "LIBSTORAGE_MULTIPLE_DEVICES_BTRFS", + "LIBSTORAGE_PFSOEMS", + "LIBSTORAGE_ROOTPREFIX", }; for (const char* env_var : env_vars) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.42/storage/EnvironmentImpl.h new/libstorage-ng-4.5.43/storage/EnvironmentImpl.h --- old/libstorage-ng-4.5.42/storage/EnvironmentImpl.h 2022-08-12 12:13:06.000000000 +0200 +++ new/libstorage-ng-4.5.43/storage/EnvironmentImpl.h 2022-09-02 17:07:51.000000000 +0200 @@ -121,6 +121,11 @@ */ bool cryptsetup_for_bitlocker(); + /** + * There are several methods to use mdadm for activation. + */ + int mdadm_activate_method(); + } #endif