From 8117846f4ef6fd1cee3e7e92a5fe7d1833c930165937c110dca06973c632d4e0 Mon Sep 17 00:00:00 2001 From: Robert Milasan Date: Thu, 13 Dec 2012 09:24:00 +0000 Subject: [PATCH] Accepting request 145035 from home:elvigia:branches:Base:System OBS-URL: https://build.opensuse.org/request/show/145035 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=322 --- detect-btrfs-ssd.patch | 97 +++++++++++++++++++ systemd-mini.changes | 8 ++ systemd-mini.spec | 6 ++ systemd.changes | 8 ++ systemd.spec | 6 ++ ...ed-donot-close-bogus-dbus-connection.patch | 36 +++++++ 6 files changed, 161 insertions(+) create mode 100644 detect-btrfs-ssd.patch create mode 100644 timedated-donot-close-bogus-dbus-connection.patch diff --git a/detect-btrfs-ssd.patch b/detect-btrfs-ssd.patch new file mode 100644 index 00000000..4bd64690 --- /dev/null +++ b/detect-btrfs-ssd.patch @@ -0,0 +1,97 @@ +commit d7228cb8529de83115af04bf653b4d204dad8fae +Author: Lennart Poettering +Date: Thu Nov 22 01:51:06 2012 +0100 + + readahead: properly detect btrfs on SSD + +diff --git a/src/readahead/readahead-common.c b/src/readahead/readahead-common.c +index 10b0ccc..41aaff0 100644 +--- a/src/readahead/readahead-common.c ++++ b/src/readahead/readahead-common.c +@@ -32,6 +32,7 @@ + #include "log.h" + #include "readahead-common.h" + #include "util.h" ++#include "missing.h" + + int file_verify(int fd, const char *fn, off_t file_size_max, struct stat *st) { + assert(fd >= 0); +@@ -62,14 +63,63 @@ int fs_on_ssd(const char *p) { + struct udev_device *udev_device = NULL, *look_at = NULL; + bool b = false; + const char *devtype, *rotational, *model, *id; ++ int r; + + assert(p); + + if (stat(p, &st) < 0) + return -errno; + +- if (major(st.st_dev) == 0) ++ if (major(st.st_dev) == 0) { ++ _cleanup_fclose_ FILE *f = NULL; ++ int mount_id; ++ struct file_handle *h; ++ ++ /* Might be btrfs, which exposes "ssd" as mount flag if it is on ssd. ++ * ++ * We first determine the mount ID here, if we can, ++ * and then lookup the mount ID in mountinfo to find ++ * the mount options. */ ++ ++ h = alloca(MAX_HANDLE_SZ); ++ h->handle_bytes = MAX_HANDLE_SZ; ++ r = name_to_handle_at(AT_FDCWD, p, h, &mount_id, AT_SYMLINK_FOLLOW); ++ if (r < 0) ++ return false; ++ ++ f = fopen("/proc/self/mountinfo", "re"); ++ if (!f) ++ return false; ++ ++ for (;;) { ++ char line[LINE_MAX], *e; ++ _cleanup_free_ char *opts = NULL; ++ int mid; ++ ++ if (!fgets(line, sizeof(line), f)) ++ return false; ++ ++ truncate_nl(line); ++ ++ if (sscanf(line, "%i", &mid) != 1) ++ continue; ++ ++ if (mid != mount_id) ++ continue; ++ ++ e = strstr(line, " - "); ++ if (!e) ++ continue; ++ ++ if (sscanf(e+3, "%*s %*s %ms", &opts) != 1) ++ continue; ++ ++ if (streq(opts, "ssd") || startswith(opts, "ssd,") || endswith(opts, ",ssd") || strstr(opts, ",ssd,")) ++ return true; ++ } ++ + return false; ++ } + + udev = udev_new(); + if (!udev) +@@ -97,9 +147,10 @@ int fs_on_ssd(const char *p) { + + /* Second, try kernel attribute */ + rotational = udev_device_get_sysattr_value(look_at, "queue/rotational"); +- if (rotational) +- if ((b = streq(rotational, "0"))) +- goto finish; ++ if (rotational) { ++ b = streq(rotational, "0"); ++ goto finish; ++ } + + /* Finally, fallback to heuristics */ + look_at = udev_device_get_parent(look_at); diff --git a/systemd-mini.changes b/systemd-mini.changes index 036dd8c0..7b9830f6 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Dec 11 00:22:50 UTC 2012 - crrodriguez@opensuse.org + +- detect-btrfs-ssd.patch: Fix btrfs detection on SSD. +- timedated-donot-close-bogus-dbus-connection.patch: Avoid + closing an non-existent dbus connection and getting assertion + failures. + ------------------------------------------------------------------- Mon Dec 10 14:22:21 UTC 2012 - coolo@suse.com diff --git a/systemd-mini.spec b/systemd-mini.spec index 810469bf..dac1ea23 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -158,6 +158,10 @@ Patch69: switch-root-try-pivot-root.patch Patch70: remount-ro-before-unmount.patch # PATCH-FIX-UPSTREAM revert-of-9279749b84cc87c7830280b7895a48bed03c9429.patch crrodriguez@opensuse.org -- do not consider failure to umount / and /usr an error. Patch73: revert-of-9279749b84cc87c7830280b7895a48bed03c9429.patch +# PATCH-FIX-UPSTREAM detect-btrfs-ssd.patch crrodriguez@opensuse.org -- fix BTRFS detection on systemd-readhead +Patch74: detect-btrfs-ssd.patch +# PATCH-FIX-UPSTREAM timedated-donot-close-bogus-dbus-connection.patch crrodriguez@opensuse.org -- Fix assertion failure when dbus is gone. +Patch75: timedated-donot-close-bogus-dbus-connection.patch # udev patches # PATCH-FIX-OPENSUSE 0001-Reinstate-TIMEOUT-handling.patch @@ -376,6 +380,8 @@ cp %{SOURCE7} m4/ %patch71 -p1 %patch72 -p1 %patch73 -p1 +%patch74 -p1 +%patch75 -p1 %build autoreconf -fiv diff --git a/systemd.changes b/systemd.changes index 036dd8c0..7b9830f6 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Dec 11 00:22:50 UTC 2012 - crrodriguez@opensuse.org + +- detect-btrfs-ssd.patch: Fix btrfs detection on SSD. +- timedated-donot-close-bogus-dbus-connection.patch: Avoid + closing an non-existent dbus connection and getting assertion + failures. + ------------------------------------------------------------------- Mon Dec 10 14:22:21 UTC 2012 - coolo@suse.com diff --git a/systemd.spec b/systemd.spec index 4ab279c3..05c3fcd3 100644 --- a/systemd.spec +++ b/systemd.spec @@ -153,6 +153,10 @@ Patch69: switch-root-try-pivot-root.patch Patch70: remount-ro-before-unmount.patch # PATCH-FIX-UPSTREAM revert-of-9279749b84cc87c7830280b7895a48bed03c9429.patch crrodriguez@opensuse.org -- do not consider failure to umount / and /usr an error. Patch73: revert-of-9279749b84cc87c7830280b7895a48bed03c9429.patch +# PATCH-FIX-UPSTREAM detect-btrfs-ssd.patch crrodriguez@opensuse.org -- fix BTRFS detection on systemd-readhead +Patch74: detect-btrfs-ssd.patch +# PATCH-FIX-UPSTREAM timedated-donot-close-bogus-dbus-connection.patch crrodriguez@opensuse.org -- Fix assertion failure when dbus is gone. +Patch75: timedated-donot-close-bogus-dbus-connection.patch # udev patches # PATCH-FIX-OPENSUSE 0001-Reinstate-TIMEOUT-handling.patch @@ -371,6 +375,8 @@ cp %{SOURCE7} m4/ %patch71 -p1 %patch72 -p1 %patch73 -p1 +%patch74 -p1 +%patch75 -p1 %build autoreconf -fiv diff --git a/timedated-donot-close-bogus-dbus-connection.patch b/timedated-donot-close-bogus-dbus-connection.patch new file mode 100644 index 00000000..6ee6f3bc --- /dev/null +++ b/timedated-donot-close-bogus-dbus-connection.patch @@ -0,0 +1,36 @@ +commit b779821b8fdcb3f2bdd0c362bceaae3c76ed9678 +Author: Shawn Landden +Date: Mon Dec 3 00:50:55 2012 +0000 + + timedated: do not incorrectly close non-opened dbus connection + + Fix the fallowing error when no system dbus available: + + Failed to get system D-Bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory + process 14920: arguments to dbus_connection_close() were incorrect, assertion "connection != NULL" failed in file ../../dbus/dbus-connection.c line 2889. + This is normally a bug in some application using the D-Bus library. + process 14920: arguments to dbus_connection_unref() were incorrect, assertion "connection != NULL" failed in file ../../dbus/dbus-connection.c line 2776. + This is normally a bug in some application using the D-Bus library. + +diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c +index 40ba255..784dadc 100644 +--- a/src/timedate/timedated.c ++++ b/src/timedate/timedated.c +@@ -936,7 +936,7 @@ static int connect_bus(DBusConnection **_bus) { + if (!bus) { + log_error("Failed to get system D-Bus connection: %s", bus_error_message(&error)); + r = -ECONNREFUSED; +- goto fail; ++ goto fail2; + } + + dbus_connection_set_exit_on_disconnect(bus, FALSE); +@@ -968,7 +968,7 @@ static int connect_bus(DBusConnection **_bus) { + fail: + dbus_connection_close(bus); + dbus_connection_unref(bus); +- ++fail2: + dbus_error_free(&error); + + return r;