Hello community, here is the log from the commit of package libstorage-ng for openSUSE:Factory checked in at 2018-04-07 20:52:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old) and /work/SRC/openSUSE:Factory/.libstorage-ng.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Sat Apr 7 20:52:01 2018 rev:17 rq:594009 version:3.3.207 Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes 2018-03-26 12:16:02.998899686 +0200 +++ /work/SRC/openSUSE:Factory/.libstorage-ng.new/libstorage-ng.changes 2018-04-07 20:52:04.617205528 +0200 @@ -1,0 +2,58 @@ +Fri Apr 6 13:44:41 UTC 2018 - aschn...@suse.de + +- merge gh#openSUSE/libstorage-ng#508 +- added helper function +- support lock within same process +- 3.3.207 + +-------------------------------------------------------------------- +Thu Apr 5 10:52:43 UTC 2018 - aschn...@suse.de + +- merge gh#openSUSE/libstorage-ng#507 +- added function to set freq and passno +- removed unneeded const +- added documentation +- 3.3.206 + +-------------------------------------------------------------------- +Wed Apr 4 12:26:56 UTC 2018 - aschn...@suse.de + +- merge gh#openSUSE/libstorage-ng#506 +- added minix to enum of filesystem types +- 3.3.205 + +-------------------------------------------------------------------- +Tue Apr 3 08:49:29 UTC 2018 - aschn...@suse.de + +- merge gh#openSUSE/libstorage-ng#505 +- enable system-wide lock +- 3.3.204 + +-------------------------------------------------------------------- +Tue Apr 3 08:07:38 UTC 2018 - aschn...@suse.de + +- merge gh#openSUSE/libstorage-ng#504 +- handle pid_t in bindings +- extended integration test +- 3.3.203 + +-------------------------------------------------------------------- +Wed Mar 28 10:16:06 UTC 2018 - aschn...@suse.de + +- merge gh#openSUSE/libstorage-ng#503 +- only insert resize action for devices existing in LHS and RHS + (bsc#1085523) +- added action dependency +- added unit tests +- fixed typo +- added documentation +- 3.3.202 + +-------------------------------------------------------------------- +Mon Mar 26 13:44:56 UTC 2018 - shundham...@suse.de + +- merge gh#openSUSE/libstorage-ng#502 +- Simplified supplements for lang subpkg (bsc#1081454) +- 3.3.201 + +-------------------------------------------------------------------- Old: ---- libstorage-ng-3.3.200.tar.xz New: ---- libstorage-ng-3.3.207.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.TpLqkI/_old 2018-04-07 20:52:05.701166296 +0200 +++ /var/tmp/diff_new_pack.TpLqkI/_new 2018-04-07 20:52:05.705166152 +0200 @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 3.3.200 +Version: 3.3.207 Release: 0 Summary: Library for storage management License: GPL-2.0 @@ -61,7 +61,7 @@ %package lang Summary: Languages for package %{name} Group: System/Localization -Supplements: packageand(bundle-lang-other:%{name}) +Supplements: %{name} Provides: %{name}-lang-all = %{version} BuildArch: noarch ++++++ libstorage-ng-3.3.200.tar.xz -> libstorage-ng-3.3.207.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/VERSION new/libstorage-ng-3.3.207/VERSION --- old/libstorage-ng-3.3.200/VERSION 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/VERSION 2018-04-06 15:44:41.000000000 +0200 @@ -1 +1 @@ -3.3.200 +3.3.207 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/bindings/storage.i new/libstorage-ng-3.3.207/bindings/storage.i --- old/libstorage-ng-3.3.200/bindings/storage.i 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/bindings/storage.i 2018-04-06 15:44:41.000000000 +0200 @@ -12,6 +12,8 @@ %rename("==") "operator=="; %rename("!=") "operator!="; +%typedef int pid_t; + use_ostream(storage::Devicegraph); use_ostream(storage::Device); use_ostream(storage::Holder); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/integration-tests/misc/probe.py new/libstorage-ng-3.3.207/integration-tests/misc/probe.py --- old/libstorage-ng-3.3.200/integration-tests/misc/probe.py 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/integration-tests/misc/probe.py 2018-04-06 15:44:41.000000000 +0200 @@ -28,9 +28,14 @@ my_probe_callbacks = MyProbeCallbacks() -environment = Environment(False) +environment = Environment(True) -storage = Storage(environment) +try: + storage = Storage(environment) +except LockException as exception: + print(exception.what()) + print("locker pid %d" % exception.get_locker_pid()) + exit(1) try: storage.probe(my_probe_callbacks) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/libstorage-ng.spec.in new/libstorage-ng-3.3.207/libstorage-ng.spec.in --- old/libstorage-ng-3.3.200/libstorage-ng.spec.in 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/libstorage-ng.spec.in 2018-04-06 15:44:41.000000000 +0200 @@ -61,7 +61,7 @@ %package lang Summary: Languages for package %{name} Group: System/Localization -Supplements: packageand(bundle-lang-other:%{name}) +Supplements: %{name} Provides: %{name}-lang-all = %{version} BuildArch: noarch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Devices/BlkDeviceImpl.cc new/libstorage-ng-3.3.207/storage/Devices/BlkDeviceImpl.cc --- old/libstorage-ng-3.3.200/storage/Devices/BlkDeviceImpl.cc 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Devices/BlkDeviceImpl.cc 2018-04-06 15:44:41.000000000 +0200 @@ -435,7 +435,7 @@ } // Only tmp unmounts are inserted in the actiongraph. tmp mounts - // are simple handled in the do_resize() functions. + // are simply handled in the do_resize() functions. bool need_tmp_unmount = false; @@ -445,17 +445,22 @@ need_tmp_unmount = true; } + // Only insert mount and resize actions if the devices exist in + // LHS and RHS. + vector<Action::Base*> actions; if (need_tmp_unmount && blk_filesystem_lhs) { - blk_filesystem_lhs->get_impl().insert_unmount_action(actions); + if (blk_filesystem_lhs->exists_in_devicegraph(actiongraph.get_devicegraph(RHS))) + blk_filesystem_lhs->get_impl().insert_unmount_action(actions); } if (resize_mode == ResizeMode::SHRINK) { for (const Device* device_to_resize : boost::adaptors::reverse(devices_to_resize_lhs)) - actions.push_back(new Action::Resize(device_to_resize->get_sid(), resize_mode)); + if (device_to_resize->exists_in_devicegraph(actiongraph.get_devicegraph(RHS))) + actions.push_back(new Action::Resize(device_to_resize->get_sid(), resize_mode)); } actions.push_back(new Action::Resize(get_sid(), resize_mode)); @@ -463,12 +468,14 @@ if (resize_mode == ResizeMode::GROW) { for (const Device* device_to_resize : devices_to_resize_rhs) - actions.push_back(new Action::Resize(device_to_resize->get_sid(), resize_mode)); + if (device_to_resize->exists_in_devicegraph(actiongraph.get_devicegraph(LHS))) + actions.push_back(new Action::Resize(device_to_resize->get_sid(), resize_mode)); } if (need_tmp_unmount && blk_filesystem_rhs) { - blk_filesystem_rhs->get_impl().insert_mount_action(actions); + if (blk_filesystem_rhs->exists_in_devicegraph(actiongraph.get_devicegraph(LHS))) + blk_filesystem_rhs->get_impl().insert_mount_action(actions); } actiongraph.add_chain(actions); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Devices/DeviceImpl.cc new/libstorage-ng-3.3.207/storage/Devices/DeviceImpl.cc --- old/libstorage-ng-3.3.200/storage/Devices/DeviceImpl.cc 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Devices/DeviceImpl.cc 2018-04-06 15:44:41.000000000 +0200 @@ -466,6 +466,49 @@ } + void + Resize::add_dependencies(Actiongraph::Impl::vertex_descriptor vertex, + Actiongraph::Impl& actiongraph) const + { + Modify::add_dependencies(vertex, actiongraph); + + // The disabled dependencies are already created in + // Action.cc. TODO Should be more consistent. + + /* + const Devicegraph* devicegraph_lhs = actiongraph.get_devicegraph(LHS); + const Device* device_lhs = devicegraph_lhs->find_device(actiongraph[vertex]->sid); + */ + + const Devicegraph* devicegraph_rhs = actiongraph.get_devicegraph(RHS); + const Device* device_rhs = devicegraph_rhs->find_device(actiongraph[vertex]->sid); + + for (Actiongraph::Impl::vertex_descriptor tmp : actiongraph.vertices()) + { + Action::Base* action = actiongraph[tmp]; + + if (is_create(action) && is_child(device_rhs, action->sid)) + actiongraph.add_edge(vertex, tmp); + + /* + if (is_delete(action) && is_child(device_lhs, action->sid)) + actiongraph.add_edge(tmp, vertex); + */ + } + } + + + bool + Resize::is_child(const Device* device, sid_t sid) const + { + vector<const Device*> children = device->get_impl().get_children_of_type<const Device>(); + + return any_of(children.begin(), children.end(), [sid](const Device* child) { + return child->get_sid() == sid; + }); + } + + Text Reallot::text(const CommitData& commit_data) const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Devices/DeviceImpl.h new/libstorage-ng-3.3.207/storage/Devices/DeviceImpl.h --- old/libstorage-ng-3.3.200/storage/Devices/DeviceImpl.h 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Devices/DeviceImpl.h 2018-04-06 15:44:41.000000000 +0200 @@ -431,10 +431,17 @@ virtual Text text(const CommitData& commit_data) const override; virtual void commit(CommitData& commit_data, const CommitOptions& commit_options) const override; + virtual void add_dependencies(Actiongraph::Impl::vertex_descriptor vertex, + Actiongraph::Impl& actiongraph) const override; + Side get_side() const { return resize_mode == ResizeMode::GROW ? RHS : LHS; } const ResizeMode resize_mode; + private: + + bool is_child(const Device* device, sid_t sid) const; + }; @@ -461,9 +468,9 @@ private: /** - * Checks if the given action is a Reallot::REDUCE performed on the - * same device (PV) than this action. - * */ + * Checks if the given action is a Reallot::REDUCE performed on the + * same device (PV) than this action. + */ bool action_removes_device(const Action::Base* action) const; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Devices/Encryption.cc new/libstorage-ng-3.3.207/storage/Devices/Encryption.cc --- old/libstorage-ng-3.3.200/storage/Devices/Encryption.cc 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Devices/Encryption.cc 2018-04-06 15:44:41.000000000 +0200 @@ -63,7 +63,7 @@ void - Encryption::set_mount_by(const MountByType mount_by) + Encryption::set_mount_by(MountByType mount_by) { get_impl().set_mount_by(mount_by); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Devices/Encryption.h new/libstorage-ng-3.3.207/storage/Devices/Encryption.h --- old/libstorage-ng-3.3.200/storage/Devices/Encryption.h 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Devices/Encryption.h 2018-04-06 15:44:41.000000000 +0200 @@ -65,7 +65,7 @@ * Set the mount-by method. For encrypted devices the mount-by method * defines the name used for the second parameter in /etc/crypttab. */ - void set_mount_by(const MountByType mount_by); + void set_mount_by(MountByType mount_by); /** * Set the mount-by method to the global default, see diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Devices/EncryptionImpl.h new/libstorage-ng-3.3.207/storage/Devices/EncryptionImpl.h --- old/libstorage-ng-3.3.200/storage/Devices/EncryptionImpl.h 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Devices/EncryptionImpl.h 2018-04-06 15:44:41.000000000 +0200 @@ -63,7 +63,7 @@ void set_password(const string& password) { Impl::password = password; } MountByType get_mount_by() const { return mount_by; } - void set_mount_by(const MountByType mount_by) { Impl::mount_by = mount_by; } + void set_mount_by(MountByType mount_by) { Impl::mount_by = mount_by; } void set_default_mount_by(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/EnvironmentImpl.cc new/libstorage-ng-3.3.207/storage/EnvironmentImpl.cc --- old/libstorage-ng-3.3.200/storage/EnvironmentImpl.cc 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/EnvironmentImpl.cc 2018-04-06 15:44:41.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) [2014-2015] Novell, Inc. + * Copyright (c) 2018 SUSE LLC * * All Rights Reserved. * @@ -60,6 +61,26 @@ } + bool + Environment::Impl::is_do_lock() const + { + switch (probe_mode) + { + case ProbeMode::STANDARD: + case ProbeMode::STANDARD_WRITE_DEVICEGRAPH: + case ProbeMode::STANDARD_WRITE_MOCKUP: + return true; + + case ProbeMode::NONE: + case ProbeMode::READ_DEVICEGRAPH: + case ProbeMode::READ_MOCKUP: + return false; + } + + return true; + } + + std::ostream& operator<<(std::ostream& out, const Environment::Impl& environment) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/EnvironmentImpl.h new/libstorage-ng-3.3.207/storage/EnvironmentImpl.h --- old/libstorage-ng-3.3.200/storage/EnvironmentImpl.h 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/EnvironmentImpl.h 2018-04-06 15:44:41.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (c) [2014-2015] Novell, Inc. + * Copyright (c) 2018 SUSE LLC * * All Rights Reserved. * @@ -57,6 +58,8 @@ bool is_debug_credentials() const { return false; } + bool is_do_lock() const; + friend std::ostream& operator<<(std::ostream& out, const Impl& environment); private: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Filesystems/MountPoint.cc new/libstorage-ng-3.3.207/storage/Filesystems/MountPoint.cc --- old/libstorage-ng-3.3.200/storage/Filesystems/MountPoint.cc 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Filesystems/MountPoint.cc 2018-04-06 15:44:41.000000000 +0200 @@ -82,7 +82,7 @@ void - MountPoint::set_mount_by(const MountByType mount_by) + MountPoint::set_mount_by(MountByType mount_by) { get_impl().set_mount_by(mount_by); } @@ -130,6 +130,13 @@ } + void + MountPoint::set_freq(int freq) + { + get_impl().set_freq(freq); + } + + int MountPoint::get_passno() const { @@ -137,6 +144,13 @@ } + void + MountPoint::set_passno(int passno) + { + get_impl().set_passno(passno); + } + + bool MountPoint::is_active() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Filesystems/MountPoint.h new/libstorage-ng-3.3.207/storage/Filesystems/MountPoint.h --- old/libstorage-ng-3.3.200/storage/Filesystems/MountPoint.h 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Filesystems/MountPoint.h 2018-04-06 15:44:41.000000000 +0200 @@ -74,7 +74,7 @@ /** * Set the mount-by method. */ - void set_mount_by(const MountByType mount_by); + void set_mount_by(MountByType mount_by); /** * Set the mount-by method to the global default, see @@ -108,11 +108,34 @@ */ void set_default_mount_options(); + /** + * Get the freq field from fstab(5). The freq field is used by the + * dump(8) command to determine which filesystems need to be + * dumped. The field is likely obsolete. + */ int get_freq() const; + /** + * Set the freq field. + * + * @see get_freq(). + */ + void set_freq(int freq); + + /** + * Get the passno field from fstab(5). The passno field is used by the + * fsck(8) program to determine the order in which filesystem checks + * are done at reboot time. + */ int get_passno() const; /** + * + * @see get_passno(). + */ + void set_passno(int passno); + + /** * Return whether the mount point is active (mounted). */ bool is_active() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Filesystems/MountPointImpl.h new/libstorage-ng-3.3.207/storage/Filesystems/MountPointImpl.h --- old/libstorage-ng-3.3.200/storage/Filesystems/MountPointImpl.h 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Filesystems/MountPointImpl.h 2018-04-06 15:44:41.000000000 +0200 @@ -63,7 +63,7 @@ void set_path(const string& path); MountByType get_mount_by() const { return mount_by; } - void set_mount_by(const MountByType mount_by) { Impl::mount_by = mount_by; } + void set_mount_by(MountByType mount_by) { Impl::mount_by = mount_by; } vector<MountByType> possible_mount_bys() const; @@ -76,8 +76,10 @@ void set_default_mount_options(); int get_freq() const { return freq; } + void set_freq(int freq) { Impl::freq = freq; } int get_passno() const { return passno; } + void set_passno(int passno) { Impl::passno = passno; } bool is_in_etc_fstab() const { return in_etc_fstab; } void set_in_etc_fstab(bool in_etc_fstab) { Impl::in_etc_fstab = in_etc_fstab; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Filesystems/Mountable.h new/libstorage-ng-3.3.207/storage/Filesystems/Mountable.h --- old/libstorage-ng-3.3.200/storage/Filesystems/Mountable.h 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Filesystems/Mountable.h 2018-04-06 15:44:41.000000000 +0200 @@ -40,7 +40,7 @@ enum class FsType { UNKNOWN, REISERFS, EXT2, EXT3, EXT4, BTRFS, VFAT, XFS, JFS, HFS, NTFS, - SWAP, HFSPLUS, NFS, NFS4, TMPFS, ISO9660, UDF, NILFS2 + SWAP, HFSPLUS, NFS, NFS4, TMPFS, ISO9660, UDF, NILFS2, MINIX }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Filesystems/MountableImpl.cc new/libstorage-ng-3.3.207/storage/Filesystems/MountableImpl.cc --- old/libstorage-ng-3.3.200/storage/Filesystems/MountableImpl.cc 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Filesystems/MountableImpl.cc 2018-04-06 15:44:41.000000000 +0200 @@ -53,7 +53,7 @@ // always the same. const vector<string> EnumTraits<FsType>::names({ "unknown", "reiserfs", "ext2", "ext3", "ext4", "btrfs", "vfat", "xfs", "jfs", "hfs", - "ntfs", "swap", "hfsplus", "nfs", "nfs4", "tmpfs", "iso9660", "udf", "nilfs2" + "ntfs", "swap", "hfsplus", "nfs", "nfs4", "tmpfs", "iso9660", "udf", "nilfs2", "minix" }); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/StorageImpl.cc new/libstorage-ng-3.3.207/storage/StorageImpl.cc --- old/libstorage-ng-3.3.200/storage/StorageImpl.cc 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/StorageImpl.cc 2018-04-06 15:44:41.000000000 +0200 @@ -35,14 +35,16 @@ #include "storage/SystemInfo/SystemInfo.h" #include "storage/Actiongraph.h" #include "storage/Prober.h" +#include "storage/EnvironmentImpl.h" namespace storage { Storage::Impl::Impl(Storage& storage, const Environment& environment) - : storage(storage), environment(environment), arch(false), default_mount_by(MountByType::UUID), - tmp_dir("libstorage-XXXXXX") + : storage(storage), environment(environment), arch(false), + lock(environment.is_read_only(), !environment.get_impl().is_do_lock()), + default_mount_by(MountByType::UUID), tmp_dir("libstorage-XXXXXX") { y2mil("constructed Storage with " << environment); y2mil("libstorage-ng version " VERSION); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/StorageImpl.h new/libstorage-ng-3.3.207/storage/StorageImpl.h --- old/libstorage-ng-3.3.200/storage/StorageImpl.h 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/StorageImpl.h 2018-04-06 15:44:41.000000000 +0200 @@ -28,6 +28,7 @@ #include <map> #include "storage/Utils/FileUtils.h" +#include "storage/Utils/LockImpl.h" #include "storage/Storage.h" #include "storage/Environment.h" #include "storage/SystemInfo/Arch.h" @@ -107,6 +108,8 @@ Arch arch; + Lock lock; + map<string, Devicegraph> devicegraphs; MountByType default_mount_by; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Utils/Lock.h new/libstorage-ng-3.3.207/storage/Utils/Lock.h --- old/libstorage-ng-3.3.200/storage/Utils/Lock.h 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Utils/Lock.h 2018-04-06 15:44:41.000000000 +0200 @@ -45,7 +45,10 @@ LockException(pid_t locker_pid); /** - * pid of process holding lock or 0 if it could not be determined. + * pid of one of the process holding a lock. The pid is 0 if it could + * not be determined, -1 if the lock is held by a open file descriptor + * lock and -2 if the lock is held by the same process. Note that the + * pid may already be out of date by the time the function returns. */ pid_t get_locker_pid() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Utils/LockImpl.cc new/libstorage-ng-3.3.207/storage/Utils/LockImpl.cc --- old/libstorage-ng-3.3.200/storage/Utils/LockImpl.cc 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Utils/LockImpl.cc 2018-04-06 15:44:41.000000000 +0200 @@ -33,6 +33,7 @@ #include "storage/Utils/LoggerImpl.h" #include "storage/Utils/LockImpl.h" #include "storage/Utils/ExceptionImpl.h" +#include "storage/Utils/StorageTmpl.h" #define LOCK_DIR "/run/libstorage-ng" @@ -41,55 +42,94 @@ namespace storage { + + vector<const Lock*> Lock::locks; + + int Lock::fd = -1; + + Lock::Lock(bool read_only, bool disable) - : disabled(disable), fd(-1) + : read_only(read_only), disabled(disable) { if (disabled) return; y2mil("getting " << (read_only ? "read-only" : "read-write") << " lock"); - if (mkdir(LOCK_DIR, 0755) == -1 && errno != EEXIST) + if (locks.empty()) { - y2err("creating directory for lock-file failed: " << strerror(errno)); - } + // If there are no locks within the same process try to take the + // system-wide lock. - fd = open(LOCK_DIR "/lock", (read_only ? O_RDONLY : O_WRONLY) | O_CREAT | O_CLOEXEC, - S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); - if (fd < 0) - { - // Opening lock-file failed. - y2err("opening lock-file failed: " << strerror(errno)); - ST_THROW(LockException(0)); - } + if (mkdir(LOCK_DIR, 0755) == -1 && errno != EEXIST) + { + y2err("creating directory for lock-file failed: " << strerror(errno)); + } - struct flock lock; - memset(&lock, 0, sizeof(lock)); - lock.l_whence = SEEK_SET; - lock.l_type = (read_only ? F_RDLCK : F_WRLCK); - if (fcntl(fd, F_SETLK, &lock) < 0) + fd = open(LOCK_DIR "/lock", (read_only ? O_RDONLY : O_WRONLY) | O_CREAT | O_CLOEXEC, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); + if (fd < 0) + { + // Opening lock-file failed. + y2err("opening lock-file failed: " << strerror(errno)); + ST_THROW(LockException(0)); + } + + struct flock lock; + memset(&lock, 0, sizeof(lock)); + lock.l_type = (read_only ? F_RDLCK : F_WRLCK); + lock.l_whence = SEEK_SET; + if (fcntl(fd, F_SETLK, &lock) < 0) + { + switch (errno) + { + case EACCES: + case EAGAIN: + // Another process has a lock. Between the two fcntl + // calls the lock of the other process could be + // release. In that case we don't get the pid (and it is + // still 0). + fcntl(fd, F_GETLK, &lock); + close(fd); + y2err("locked by process " << lock.l_pid); + ST_THROW(LockException(lock.l_pid)); + + default: + // Some other error. + close(fd); + y2err("getting lock failed: " << strerror(errno)); + ST_THROW(LockException(0)); + } + } + } + else { - switch (errno) + // If there are locks within the same process check if a further + // lock is allowed. + + if (read_only) { - case EACCES: - case EAGAIN: - // Another process has a lock. Between the two fcntl - // calls the lock of the other process could be - // release. In that case we don't get the pid (and it is - // still 0). - fcntl(fd, F_GETLK, &lock); - close(fd); - y2err("locked by process " << lock.l_pid); - ST_THROW(LockException(lock.l_pid)); - - default: - // Some other error. - close(fd); - y2err("getting lock failed: " << strerror(errno)); - ST_THROW(LockException(0)); + // no read-write lock of the process allowed + + if (any_of(locks.begin(), locks.end(), [](const Lock* tmp) { return !tmp->read_only; })) + { + y2err("read-write lock by same process exists"); + ST_THROW(LockException(-2)); + } + } + else + { + // no other lock of the process allowed + + y2err("lock by same process exists"); + ST_THROW(LockException(-2)); } } + // Add this lock to the list of locks in the same process. + + locks.push_back(this); + y2mil("lock succeeded"); } @@ -99,10 +139,21 @@ if (disabled) return; - close(fd); + // Remove this lock from the list of locks in the same process. + + erase(locks, this); + + if (locks.empty()) + { + // If this process has no further locks release the system-wide + // lock. + + close(fd); + fd = -1; - // Do not bother deleting lock-file. Likelihood of race conditions is - // to high. + // Do not bother deleting lock-file. Likelihood of race conditions + // is to high. + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Utils/LockImpl.h new/libstorage-ng-3.3.207/storage/Utils/LockImpl.h --- old/libstorage-ng-3.3.200/storage/Utils/LockImpl.h 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Utils/LockImpl.h 2018-04-06 15:44:41.000000000 +0200 @@ -25,6 +25,7 @@ #define STORAGE_LOCK_IMPL_H +#include <vector> #include <boost/noncopyable.hpp> #include "storage/Utils/Lock.h" @@ -33,8 +34,18 @@ namespace storage { + using namespace std; + + /** * Implement a system-wide read-only or read-write lock. + * + * Implemented using traditional ("process-associated") locks (for locks + * across processes) and a global list (for locks within a single + * process). + * + * An implementation using only open file descriptor (OFD) locks would be + * simpler but does not provide the pid of the process holding a lock. */ class Lock : private boost::noncopyable { @@ -47,8 +58,18 @@ private: + const bool read_only; const bool disabled; - int fd; + + /** + * Locks within the same process. + */ + static vector<const Lock*> locks; + + /** + * File descriptor for system-wide lock. + */ + static int fd; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/storage/Utils/StorageTmpl.h new/libstorage-ng-3.3.207/storage/Utils/StorageTmpl.h --- old/libstorage-ng-3.3.200/storage/Utils/StorageTmpl.h 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/storage/Utils/StorageTmpl.h 2018-04-06 15:44:41.000000000 +0200 @@ -181,12 +181,22 @@ // might become C++ standard, see + // http://en.cppreference.com/w/cpp/experimental/vector/erase + template <class T, class U> + void + erase(vector<T>& c, const U& value) + { + c.erase(remove(c.begin(), c.end(), value), c.end()); + } + + + // might become C++ standard, see // http://en.cppreference.com/w/cpp/experimental/vector/erase_if - template <typename Type, typename Predicate> + template <class T, class Predicate> void - erase_if(vector<Type>& v, Predicate pred) + erase_if(vector<T>& c, Predicate pred) { - v.erase(remove_if(v.begin(), v.end(), pred), v.end()); + c.erase(remove_if(c.begin(), c.end(), pred), c.end()); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/testsuite/dependencies/resize/Makefile.am new/libstorage-ng-3.3.207/testsuite/dependencies/resize/Makefile.am --- old/libstorage-ng-3.3.200/testsuite/dependencies/resize/Makefile.am 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/testsuite/dependencies/resize/Makefile.am 2018-04-06 15:44:41.000000000 +0200 @@ -8,7 +8,7 @@ -lboost_unit_test_framework check_PROGRAMS = \ - resize1.test resize2.test resize3.test + resize1.test resize2.test resize3.test resize4.test resize5.test AM_DEFAULT_SOURCE_EXT = .cc @@ -17,5 +17,7 @@ EXTRA_DIST = \ resize1-probed.xml resize1-staging.xml resize1-expected.txt \ resize2-probed.xml resize2-staging.xml resize2-expected.txt \ - resize3-probed.xml resize3-staging.xml resize3-expected.txt + resize3-probed.xml resize3-staging.xml resize3-expected.txt \ + resize4-probed.xml resize4-staging.xml resize4-expected.txt \ + resize5-probed.xml resize5-staging.xml resize5-expected.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize1-expected.txt new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize1-expected.txt --- old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize1-expected.txt 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize1-expected.txt 2018-04-06 15:44:41.000000000 +0200 @@ -1,4 +1,4 @@ 1 - Unmount /dev/sda1 at /test -> 2 -2 - Shrink ext4 on /dev/sda1 from 8.00 GiB to 6.00 GiB -> 3 +2 - Shrink ext4 on /dev/sda1 from 8.00 GiB to 6.00 GiB -> 3 4 3 - Shrink partition /dev/sda1 from 8.00 GiB to 6.00 GiB -> 4 4 - Mount /dev/sda1 at /test -> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize3-expected.txt new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize3-expected.txt --- old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize3-expected.txt 2018-03-23 10:31:06.000000000 +0100 +++ new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize3-expected.txt 2018-04-06 15:44:41.000000000 +0200 @@ -1,3 +1,3 @@ -1 - Shrink ext4 on /dev/sda1 from 8.00 GiB to 6.00 GiB -> 2 +1 - Shrink ext4 on /dev/sda1 from 8.00 GiB to 6.00 GiB -> 2 3 2 - Shrink partition /dev/sda1 from 8.00 GiB to 6.00 GiB -> 3 3 - Mount /dev/sda1 at /test -> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize4-expected.txt new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize4-expected.txt --- old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize4-expected.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize4-expected.txt 2018-04-06 15:44:41.000000000 +0200 @@ -0,0 +1,7 @@ +1a - Remove mount point /test of /dev/sda1 from /etc/fstab -> 1b +1b - Unmount /dev/sda1 at /test -> 1c +1c - Delete ext4 on /dev/sda1 (8.00 GiB) -> 2 3a +2 - Grow partition /dev/sda1 from 8.00 GiB to 12.00 GiB -> 3a +3a - Create ext4 on /dev/sda1 (12.00 GiB) -> 3b +3b - Mount /dev/sda1 at /test -> 3c +3c - Add mount point /test of /dev/sda1 to /etc/fstab -> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize4-probed.xml new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize4-probed.xml --- old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize4-probed.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize4-probed.xml 2018-04-06 15:44:41.000000000 +0200 @@ -0,0 +1,65 @@ +<?xml version="1.0"?> +<Devicegraph> + <Devices> + <Disk> + <sid>42</sid> + <name>/dev/sda</name> + <sysfs-name>sda</sysfs-name> + <sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda</sysfs-path> + <region> + <length>33554432</length> + <block-size>512</block-size> + </region> + <topology/> + <range>256</range> + <rotational>true</rotational> + <transport>SATA</transport> + </Disk> + <Msdos> + <sid>43</sid> + </Msdos> + <Partition> + <sid>44</sid> + <name>/dev/sda1</name> + <sysfs-name>sda1</sysfs-name> + <sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1</sysfs-path> + <region> + <start>2048</start> + <length>16777216</length> + <block-size>512</block-size> + </region> + <type>primary</type> + <id>131</id> + <boot>true</boot> + </Partition> + <Ext4> + <sid>45</sid> + <mount-by>uuid</mount-by> + <uuid>2c724d55-2b15-4cf4-afa6-2b8abe968ffb</uuid> + </Ext4> + <MountPoint> + <sid>46</sid> + <path>/test</path> + <mount-by>uuid</mount-by> + <active>true</active> + </MountPoint> + </Devices> + <Holders> + <User> + <source-sid>42</source-sid> + <target-sid>43</target-sid> + </User> + <Subdevice> + <source-sid>43</source-sid> + <target-sid>44</target-sid> + </Subdevice> + <User> + <source-sid>44</source-sid> + <target-sid>45</target-sid> + </User> + <User> + <source-sid>45</source-sid> + <target-sid>46</target-sid> + </User> + </Holders> +</Devicegraph> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize4-staging.xml new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize4-staging.xml --- old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize4-staging.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize4-staging.xml 2018-04-06 15:44:41.000000000 +0200 @@ -0,0 +1,64 @@ +<?xml version="1.0"?> +<Devicegraph> + <Devices> + <Disk> + <sid>42</sid> + <name>/dev/sda</name> + <sysfs-name>sda</sysfs-name> + <sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda</sysfs-path> + <region> + <length>33554432</length> + <block-size>512</block-size> + </region> + <topology/> + <range>256</range> + <rotational>true</rotational> + <transport>SATA</transport> + </Disk> + <Msdos> + <sid>43</sid> + </Msdos> + <Partition> + <sid>44</sid> + <name>/dev/sda1</name> + <sysfs-name>sda1</sysfs-name> + <sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1</sysfs-path> + <region> + <start>2048</start> + <length>25165824</length> + <block-size>512</block-size> + </region> + <type>primary</type> + <id>131</id> + <boot>true</boot> + </Partition> + <Ext4> + <sid>47</sid> + <mount-by>uuid</mount-by> + </Ext4> + <MountPoint> + <sid>48</sid> + <path>/test</path> + <mount-by>uuid</mount-by> + <active>true</active> + </MountPoint> + </Devices> + <Holders> + <User> + <source-sid>42</source-sid> + <target-sid>43</target-sid> + </User> + <Subdevice> + <source-sid>43</source-sid> + <target-sid>44</target-sid> + </Subdevice> + <User> + <source-sid>44</source-sid> + <target-sid>47</target-sid> + </User> + <User> + <source-sid>47</source-sid> + <target-sid>48</target-sid> + </User> + </Holders> +</Devicegraph> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize4.cc new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize4.cc --- old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize4.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize4.cc 2018-04-06 15:44:41.000000000 +0200 @@ -0,0 +1,23 @@ + +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE libstorage + +#include <boost/test/unit_test.hpp> + +#include "storage/Utils/Logger.h" +#include "testsuite/helpers/TsCmp.h" + + +using namespace storage; + + +BOOST_AUTO_TEST_CASE(dependencies) +{ + set_logger(get_stdout_logger()); + + // Check that filesystems on a grown blk device are deleted before and + // created after the blk device is resized. + + TsCmpActiongraph cmp("resize4"); + BOOST_CHECK_MESSAGE(cmp.ok(), cmp); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize5-expected.txt new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize5-expected.txt --- old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize5-expected.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize5-expected.txt 2018-04-06 15:44:41.000000000 +0200 @@ -0,0 +1,7 @@ +1a - Remove mount point /test of /dev/sda1 from /etc/fstab -> 1b +1b - Unmount /dev/sda1 at /test -> 1c +1c - Delete ext4 on /dev/sda1 (8.00 GiB) -> 2 3a +2 - Shrink partition /dev/sda1 from 8.00 GiB to 4.00 GiB -> 3a +3a - Create ext4 on /dev/sda1 (4.00 GiB) -> 3b +3b - Mount /dev/sda1 at /test -> 3c +3c - Add mount point /test of /dev/sda1 to /etc/fstab -> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize5-probed.xml new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize5-probed.xml --- old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize5-probed.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize5-probed.xml 2018-04-06 15:44:41.000000000 +0200 @@ -0,0 +1,65 @@ +<?xml version="1.0"?> +<Devicegraph> + <Devices> + <Disk> + <sid>42</sid> + <name>/dev/sda</name> + <sysfs-name>sda</sysfs-name> + <sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda</sysfs-path> + <region> + <length>33554432</length> + <block-size>512</block-size> + </region> + <topology/> + <range>256</range> + <rotational>true</rotational> + <transport>SATA</transport> + </Disk> + <Msdos> + <sid>43</sid> + </Msdos> + <Partition> + <sid>44</sid> + <name>/dev/sda1</name> + <sysfs-name>sda1</sysfs-name> + <sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1</sysfs-path> + <region> + <start>2048</start> + <length>16777216</length> + <block-size>512</block-size> + </region> + <type>primary</type> + <id>131</id> + <boot>true</boot> + </Partition> + <Ext4> + <sid>45</sid> + <mount-by>uuid</mount-by> + <uuid>2c724d55-2b15-4cf4-afa6-2b8abe968ffb</uuid> + </Ext4> + <MountPoint> + <sid>46</sid> + <path>/test</path> + <mount-by>uuid</mount-by> + <active>true</active> + </MountPoint> + </Devices> + <Holders> + <User> + <source-sid>42</source-sid> + <target-sid>43</target-sid> + </User> + <Subdevice> + <source-sid>43</source-sid> + <target-sid>44</target-sid> + </Subdevice> + <User> + <source-sid>44</source-sid> + <target-sid>45</target-sid> + </User> + <User> + <source-sid>45</source-sid> + <target-sid>46</target-sid> + </User> + </Holders> +</Devicegraph> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize5-staging.xml new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize5-staging.xml --- old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize5-staging.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize5-staging.xml 2018-04-06 15:44:41.000000000 +0200 @@ -0,0 +1,64 @@ +<?xml version="1.0"?> +<Devicegraph> + <Devices> + <Disk> + <sid>42</sid> + <name>/dev/sda</name> + <sysfs-name>sda</sysfs-name> + <sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda</sysfs-path> + <region> + <length>33554432</length> + <block-size>512</block-size> + </region> + <topology/> + <range>256</range> + <rotational>true</rotational> + <transport>SATA</transport> + </Disk> + <Msdos> + <sid>43</sid> + </Msdos> + <Partition> + <sid>44</sid> + <name>/dev/sda1</name> + <sysfs-name>sda1</sysfs-name> + <sysfs-path>/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1</sysfs-path> + <region> + <start>2048</start> + <length>8388608</length> + <block-size>512</block-size> + </region> + <type>primary</type> + <id>131</id> + <boot>true</boot> + </Partition> + <Ext4> + <sid>47</sid> + <mount-by>uuid</mount-by> + </Ext4> + <MountPoint> + <sid>48</sid> + <path>/test</path> + <mount-by>uuid</mount-by> + <active>true</active> + </MountPoint> + </Devices> + <Holders> + <User> + <source-sid>42</source-sid> + <target-sid>43</target-sid> + </User> + <Subdevice> + <source-sid>43</source-sid> + <target-sid>44</target-sid> + </Subdevice> + <User> + <source-sid>44</source-sid> + <target-sid>47</target-sid> + </User> + <User> + <source-sid>47</source-sid> + <target-sid>48</target-sid> + </User> + </Holders> +</Devicegraph> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize5.cc new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize5.cc --- old/libstorage-ng-3.3.200/testsuite/dependencies/resize/resize5.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/libstorage-ng-3.3.207/testsuite/dependencies/resize/resize5.cc 2018-04-06 15:44:41.000000000 +0200 @@ -0,0 +1,23 @@ + +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE libstorage + +#include <boost/test/unit_test.hpp> + +#include "storage/Utils/Logger.h" +#include "testsuite/helpers/TsCmp.h" + + +using namespace storage; + + +BOOST_AUTO_TEST_CASE(dependencies) +{ + set_logger(get_stdout_logger()); + + // Check that filesystems on a grown blk device are deleted before and + // created after the blk device is resized. + + TsCmpActiongraph cmp("resize5"); + BOOST_CHECK_MESSAGE(cmp.ok(), cmp); +}