Hello community, here is the log from the commit of package snapper for openSUSE:Factory checked in at 2017-02-07 11:58:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/snapper (Old) and /work/SRC/openSUSE:Factory/.snapper.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "snapper" Changes: -------- --- /work/SRC/openSUSE:Factory/snapper/snapper.changes 2017-01-18 21:31:09.914886434 +0100 +++ /work/SRC/openSUSE:Factory/.snapper.new/snapper.changes 2017-02-07 11:58:57.383954417 +0100 @@ -1,0 +2,13 @@ +Thu Feb 02 19:07:40 CET 2017 - [email protected] + +- deal with CaaSP btrfs setup where certain subvolumes are + read-only (bsc#1018302 and bsc#1018095) +- version 0.4.3 + +------------------------------------------------------------------- +Thu Feb 02 14:49:59 CET 2017 - [email protected] + +- build SLE12 versions with quota support again (bsc#1021370) +- version 0.4.2 + +------------------------------------------------------------------- Old: ---- snapper-0.4.1.tar.bz2 New: ---- snapper-0.4.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ snapper.spec ++++++ --- /var/tmp/diff_new_pack.ZsFkIW/_old 2017-02-07 11:58:58.079855755 +0100 +++ /var/tmp/diff_new_pack.ZsFkIW/_new 2017-02-07 11:58:58.079855755 +0100 @@ -17,7 +17,7 @@ Name: snapper -Version: 0.4.1 +Version: 0.4.3 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: snapper-%{version}.tar.bz2 @@ -98,7 +98,7 @@ %if 0%{?suse_version} <= 1310 --disable-rollback \ %endif -%if 0%{?suse_version} <= 1320 +%if 0%{?suse_version} <= 1310 --disable-btrfs-quota \ %endif --disable-silent-rules --disable-ext4 ++++++ debian.tar.gz ++++++ ++++++ snapper-0.4.1.tar.bz2 -> snapper-0.4.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.4.1/VERSION new/snapper-0.4.3/VERSION --- old/snapper-0.4.1/VERSION 2016-12-21 11:27:09.000000000 +0100 +++ new/snapper-0.4.3/VERSION 2017-02-03 13:42:08.000000000 +0100 @@ -1 +1 @@ -0.4.1 +0.4.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.4.1/snapper/Btrfs.cc new/snapper-0.4.3/snapper/Btrfs.cc --- old/snapper-0.4.1/snapper/Btrfs.cc 2016-10-06 14:28:01.000000000 +0200 +++ new/snapper-0.4.3/snapper/Btrfs.cc 2017-02-03 13:42:08.000000000 +0100 @@ -296,6 +296,13 @@ } + SDir + Btrfs::openGeneralDir() const + { + return openInfosDir(); + } + + void Btrfs::createSnapshot(unsigned int num, unsigned int num_parent, bool read_only, bool quota) const @@ -1446,19 +1453,19 @@ { try { + SDir general_dir = openGeneralDir(); + if (num == 0) { SDir subvolume_dir = openSubvolumeDir(); subvolid_t id = get_id(subvolume_dir.fd()); - set_default_id(subvolume_dir.fd(), id); + set_default_id(general_dir.fd(), id); } else { SDir snapshot_dir = openSnapshotDir(num); subvolid_t id = get_id(snapshot_dir.fd()); - - SDir subvolume_dir = openSubvolumeDir(); - set_default_id(subvolume_dir.fd(), id); + set_default_id(general_dir.fd(), id); } } catch (const runtime_error& e) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.4.1/snapper/Btrfs.h new/snapper-0.4.3/snapper/Btrfs.h --- old/snapper-0.4.1/snapper/Btrfs.h 2016-08-02 10:02:11.000000000 +0200 +++ new/snapper-0.4.3/snapper/Btrfs.h 2017-02-03 13:42:08.000000000 +0100 @@ -60,6 +60,13 @@ virtual SDir openInfosDir() const; virtual SDir openSnapshotDir(unsigned int num) const; + /** + * A general read-write directory that can be used for ioctls. The + * exact directory can change to adapt to the system changes, + * e.g. which subvolumes are read-only. + */ + SDir openGeneralDir() const; + virtual void createSnapshot(unsigned int num, unsigned int num_parent, bool read_only, bool quota) const; virtual void createSnapshotOfDefault(unsigned int num, bool read_only, bool quota) const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.4.1/snapper/BtrfsUtils.cc new/snapper-0.4.3/snapper/BtrfsUtils.cc --- old/snapper-0.4.1/snapper/BtrfsUtils.cc 2016-08-02 13:32:11.000000000 +0200 +++ new/snapper-0.4.3/snapper/BtrfsUtils.cc 2017-02-03 13:42:08.000000000 +0100 @@ -77,6 +77,10 @@ #define BTRFS_IOC_SUBVOL_GETFLAGS _IOR(BTRFS_IOCTL_MAGIC, 25, __u64) #endif +#ifndef BTRFS_QGROUP_LEVEL_SHIFT +#define BTRFS_QGROUP_LEVEL_SHIFT 48 +#endif + namespace snapper { @@ -101,7 +105,7 @@ is_subvolume_read_only(int fd) { __u64 flags; - if (ioctl(fd, BTRFS_IOC_SUBVOL_GETFLAGS, &flags) != 0) + if (ioctl(fd, BTRFS_IOC_SUBVOL_GETFLAGS, &flags) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_SUBVOL_GETFLAGS) failed", errno); return flags & BTRFS_SUBVOL_RDONLY; @@ -116,7 +120,7 @@ strncpy(args.name, name.c_str(), sizeof(args.name) - 1); - if (ioctl(fddst, BTRFS_IOC_SUBVOL_CREATE, &args) != 0) + if (ioctl(fddst, BTRFS_IOC_SUBVOL_CREATE, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_SUBVOL_CREATE) failed", errno); } @@ -162,7 +166,7 @@ args.fd = fd; strncpy(args.name, name.c_str(), sizeof(args.name) - 1); - if (ioctl(fddst, BTRFS_IOC_SNAP_CREATE, &args) != 0) + if (ioctl(fddst, BTRFS_IOC_SNAP_CREATE, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_SNAP_CREATE) failed", errno); } @@ -175,7 +179,7 @@ strncpy(args.name, name.c_str(), sizeof(args.name) - 1); - if (ioctl(fd, BTRFS_IOC_SNAP_DESTROY, &args) != 0) + if (ioctl(fd, BTRFS_IOC_SNAP_DESTROY, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_SNAP_DESTROY) failed", errno); } @@ -185,7 +189,7 @@ void set_default_id(int fd, subvolid_t id) { - if (ioctl(fd, BTRFS_IOC_DEFAULT_SUBVOL, &id) != 0) + if (ioctl(fd, BTRFS_IOC_DEFAULT_SUBVOL, &id) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_DEFAULT_SUBVOL) failed", errno); } @@ -206,7 +210,7 @@ sk->max_offset = (__u64) -1; sk->max_transid = (__u64) -1; - if (ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args) != 0) + if (ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_TREE_SEARCH) failed", errno); if (sk->nr_items == 0) @@ -251,7 +255,7 @@ args.treeid = 0; args.objectid = BTRFS_FIRST_FREE_OBJECTID; - if (ioctl(fd, BTRFS_IOC_INO_LOOKUP, &args) != 0) + if (ioctl(fd, BTRFS_IOC_INO_LOOKUP, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_INO_LOOKUP) failed", errno); return args.treeid; @@ -275,7 +279,7 @@ sk->max_transid = (u64) -1; sk->nr_items = 1; - if (ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args) != 0) + if (ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_TREE_SEARCH) failed", errno); return sk->nr_items == 0; @@ -293,7 +297,7 @@ memset(&args, 0, sizeof(args)); args.cmd = BTRFS_QUOTA_CTL_ENABLE; - if (ioctl(fd, BTRFS_IOC_QUOTA_CTL, &args) != 0) + if (ioctl(fd, BTRFS_IOC_QUOTA_CTL, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_QUOTA_CTL) failed", errno); } @@ -305,7 +309,7 @@ memset(&args, 0, sizeof(args)); args.cmd = BTRFS_QUOTA_CTL_DISABLE; - if (ioctl(fd, BTRFS_IOC_QUOTA_CTL, &args) != 0) + if (ioctl(fd, BTRFS_IOC_QUOTA_CTL, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_QUOTA_CTL) failed", errno); } @@ -316,7 +320,7 @@ struct btrfs_ioctl_quota_rescan_args args; memset(&args, 0, sizeof(args)); - if (ioctl(fd, BTRFS_IOC_QUOTA_RESCAN, &args) != 0) + if (ioctl(fd, BTRFS_IOC_QUOTA_RESCAN, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_QUOTA_RESCAN) failed", errno); while (true) @@ -325,7 +329,7 @@ memset(&args, 0, sizeof(args)); - if (ioctl(fd, BTRFS_IOC_QUOTA_RESCAN_STATUS, &args) != 0) + if (ioctl(fd, BTRFS_IOC_QUOTA_RESCAN_STATUS, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_QUOTA_RESCAN_STATUS) failed", errno); if (!args.flags) @@ -396,7 +400,7 @@ args.create = 1; args.qgroupid = qgroup; - if (ioctl(fd, BTRFS_IOC_QGROUP_CREATE, &args) != 0) + if (ioctl(fd, BTRFS_IOC_QGROUP_CREATE, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_QGROUP_CREATE) failed", errno); } @@ -409,7 +413,7 @@ args.create = 0; args.qgroupid = qgroup; - if (ioctl(fd, BTRFS_IOC_QGROUP_CREATE, &args) != 0) + if (ioctl(fd, BTRFS_IOC_QGROUP_CREATE, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_QGROUP_CREATE) failed", errno); } @@ -423,7 +427,7 @@ args.src = src; args.dst = dst; - if (ioctl(fd, BTRFS_IOC_QGROUP_ASSIGN, &args) != 0) + if (ioctl(fd, BTRFS_IOC_QGROUP_ASSIGN, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_QGROUP_ASSIGN) failed", errno); } @@ -437,7 +441,7 @@ args.src = src; args.dst = dst; - if (ioctl(fd, BTRFS_IOC_QGROUP_ASSIGN, &args) != 0) + if (ioctl(fd, BTRFS_IOC_QGROUP_ASSIGN, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_QGROUP_ASSIGN) failed", errno); } @@ -486,7 +490,7 @@ while (true) { - if (ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args) != 0) + if (ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_TREE_SEARCH) failed", errno); if (sk->nr_items == 0) @@ -609,7 +613,7 @@ void sync(int fd) { - if (ioctl(fd, BTRFS_IOC_SYNC) != 0) + if (ioctl(fd, BTRFS_IOC_SYNC) < 0) throw runtime_error_with_errno("ioctl(BTRFS_IOC_SYNC) failed", errno); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.4.1/snapper/Snapper.cc new/snapper-0.4.3/snapper/Snapper.cc --- old/snapper-0.4.1/snapper/Snapper.cc 2016-12-16 13:22:14.000000000 +0100 +++ new/snapper-0.4.3/snapper/Snapper.cc 2017-02-03 13:42:08.000000000 +0100 @@ -661,15 +661,15 @@ if (btrfs->getQGroup() != no_qgroup) SN_THROW(QuotaException("qgroup already set")); - SDir subvolume_dir = openSubvolumeDir(); + SDir general_dir = btrfs->openGeneralDir(); - quota_enable(subvolume_dir.fd()); + quota_enable(general_dir.fd()); - qgroup_t qgroup = qgroup_find_free(subvolume_dir.fd(), 1); + qgroup_t qgroup = qgroup_find_free(general_dir.fd(), 1); y2mil("free qgroup:" << format_qgroup(qgroup)); - qgroup_create(subvolume_dir.fd(), qgroup); + qgroup_create(general_dir.fd(), qgroup); setConfigInfo({ { "QGROUP", format_qgroup(qgroup) } }); @@ -694,15 +694,15 @@ if (btrfs->getQGroup() == no_qgroup) SN_THROW(QuotaException("qgroup not set")); - SDir subvolume_dir = openSubvolumeDir(); + SDir general_dir = btrfs->openGeneralDir(); try { - vector<qgroup_t> children = qgroup_query_children(subvolume_dir.fd(), btrfs->getQGroup()); + vector<qgroup_t> children = qgroup_query_children(general_dir.fd(), btrfs->getQGroup()); sort(children.begin(), children.end()); - // Iterate all snapshot and ensure that those and only those with a - // cleanup algorithm are included in the high level qgroup. + // Iterate all snapshots and ensure that those and only those with + // a cleanup algorithm are included in the high level qgroup. for (const Snapshot& snapshot : snapshots) { @@ -716,11 +716,11 @@ if (!snapshot.getCleanup().empty() && !included) { - qgroup_assign(subvolume_dir.fd(), qgroup, btrfs->getQGroup()); + qgroup_assign(general_dir.fd(), qgroup, btrfs->getQGroup()); } else if (snapshot.getCleanup().empty() && included) { - qgroup_remove(subvolume_dir.fd(), qgroup, btrfs->getQGroup()); + qgroup_remove(general_dir.fd(), qgroup, btrfs->getQGroup()); } } } @@ -750,23 +750,23 @@ if (btrfs->getQGroup() == no_qgroup) SN_THROW(QuotaException("qgroup not set")); - SDir subvolume_dir = openSubvolumeDir(); + SDir general_dir = btrfs->openGeneralDir(); // Tests have shown that without a rescan and sync here the quota data // is incorrect. - quota_rescan(subvolume_dir.fd()); - sync(subvolume_dir.fd()); + quota_rescan(general_dir.fd()); + sync(general_dir.fd()); struct statvfs64 fsbuf; - if (fstatvfs64(subvolume_dir.fd(), &fsbuf) != 0) + if (fstatvfs64(general_dir.fd(), &fsbuf) != 0) SN_THROW(QuotaException("statvfs64 failed")); QuotaData quota_data; quota_data.size = fsbuf.f_blocks * fsbuf.f_bsize; - QGroupUsage qgroup_usage = qgroup_query_usage(subvolume_dir.fd(), btrfs->getQGroup()); + QGroupUsage qgroup_usage = qgroup_query_usage(general_dir.fd(), btrfs->getQGroup()); quota_data.used = qgroup_usage.exclusive; y2mil("size:" << quota_data.size << " used:" << quota_data.used); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.4.1/snapper.spec.in new/snapper-0.4.3/snapper.spec.in --- old/snapper-0.4.1/snapper.spec.in 2016-10-06 14:28:01.000000000 +0200 +++ new/snapper-0.4.3/snapper.spec.in 2017-02-02 15:07:10.000000000 +0100 @@ -98,7 +98,7 @@ %if 0%{?suse_version} <= 1310 --disable-rollback \ %endif -%if 0%{?suse_version} <= 1320 +%if 0%{?suse_version} <= 1310 --disable-btrfs-quota \ %endif --disable-silent-rules --disable-ext4 ++++++ snapper-Debian_7.0.dsc ++++++ --- /var/tmp/diff_new_pack.ZsFkIW/_old 2017-02-07 11:58:58.467800755 +0100 +++ /var/tmp/diff_new_pack.ZsFkIW/_new 2017-02-07 11:58:58.467800755 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.4.1 +Version: 0.4.3 Binary: snapper Maintainer: Arvin Schnell <[email protected]> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -b800a3b44e45729b21fc4491b84f72df 570781 snapper-0.4.1.tar.bz2 +cbb00dd1a74a65b05e41851a111173f9 571049 snapper-0.4.3.tar.bz2 ++++++ snapper-Debian_8.0.dsc ++++++ --- /var/tmp/diff_new_pack.ZsFkIW/_old 2017-02-07 11:58:58.491797352 +0100 +++ /var/tmp/diff_new_pack.ZsFkIW/_new 2017-02-07 11:58:58.491797352 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.4.1 +Version: 0.4.3 Binary: snapper Maintainer: Arvin Schnell <[email protected]> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -b800a3b44e45729b21fc4491b84f72df 570781 snapper-0.4.1.tar.bz2 +cbb00dd1a74a65b05e41851a111173f9 571049 snapper-0.4.3.tar.bz2 ++++++ snapper-xUbuntu_14.04.dsc ++++++ --- /var/tmp/diff_new_pack.ZsFkIW/_old 2017-02-07 11:58:58.507795085 +0100 +++ /var/tmp/diff_new_pack.ZsFkIW/_new 2017-02-07 11:58:58.511794518 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.4.1 +Version: 0.4.3 Binary: snapper Maintainer: Arvin Schnell <[email protected]> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -b800a3b44e45729b21fc4491b84f72df 570781 snapper-0.4.1.tar.bz2 +cbb00dd1a74a65b05e41851a111173f9 571049 snapper-0.4.3.tar.bz2 ++++++ snapper-xUbuntu_14.10.dsc ++++++ --- /var/tmp/diff_new_pack.ZsFkIW/_old 2017-02-07 11:58:58.527792249 +0100 +++ /var/tmp/diff_new_pack.ZsFkIW/_new 2017-02-07 11:58:58.527792249 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.4.1 +Version: 0.4.3 Binary: snapper Maintainer: Arvin Schnell <[email protected]> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -b800a3b44e45729b21fc4491b84f72df 570781 snapper-0.4.1.tar.bz2 +cbb00dd1a74a65b05e41851a111173f9 571049 snapper-0.4.3.tar.bz2 ++++++ snapper-xUbuntu_15.04.dsc ++++++ --- /var/tmp/diff_new_pack.ZsFkIW/_old 2017-02-07 11:58:58.551788847 +0100 +++ /var/tmp/diff_new_pack.ZsFkIW/_new 2017-02-07 11:58:58.551788847 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.4.1 +Version: 0.4.3 Binary: snapper Maintainer: Arvin Schnell <[email protected]> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -b800a3b44e45729b21fc4491b84f72df 570781 snapper-0.4.1.tar.bz2 +cbb00dd1a74a65b05e41851a111173f9 571049 snapper-0.4.3.tar.bz2 ++++++ snapper-xUbuntu_15.10.dsc ++++++ --- /var/tmp/diff_new_pack.ZsFkIW/_old 2017-02-07 11:58:58.571786012 +0100 +++ /var/tmp/diff_new_pack.ZsFkIW/_new 2017-02-07 11:58:58.575785445 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.4.1 +Version: 0.4.3 Binary: snapper Maintainer: Arvin Schnell <[email protected]> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -b800a3b44e45729b21fc4491b84f72df 570781 snapper-0.4.1.tar.bz2 +cbb00dd1a74a65b05e41851a111173f9 571049 snapper-0.4.3.tar.bz2 ++++++ snapper-xUbuntu_16.04.dsc ++++++ --- /var/tmp/diff_new_pack.ZsFkIW/_old 2017-02-07 11:58:58.591783177 +0100 +++ /var/tmp/diff_new_pack.ZsFkIW/_new 2017-02-07 11:58:58.591783177 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.4.1 +Version: 0.4.3 Binary: snapper Maintainer: Arvin Schnell <[email protected]> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -b800a3b44e45729b21fc4491b84f72df 570781 snapper-0.4.1.tar.bz2 +cbb00dd1a74a65b05e41851a111173f9 571049 snapper-0.4.3.tar.bz2 ++++++ snapper-xUbuntu_16.10.dsc ++++++ --- /var/tmp/diff_new_pack.ZsFkIW/_old 2017-02-07 11:58:58.611780342 +0100 +++ /var/tmp/diff_new_pack.ZsFkIW/_new 2017-02-07 11:58:58.611780342 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: snapper -Version: 0.4.1 +Version: 0.4.3 Binary: snapper Maintainer: Arvin Schnell <[email protected]> Architecture: any @@ -11,4 +11,4 @@ # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz # Files: -b800a3b44e45729b21fc4491b84f72df 570781 snapper-0.4.1.tar.bz2 +cbb00dd1a74a65b05e41851a111173f9 571049 snapper-0.4.3.tar.bz2
