diff --git a/.gitignore b/.gitignore
index 29d9295..7ce16ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-SOURCES/glib-2.50.3.tar.xz
+SOURCES/glib-2.54.2.tar.xz
diff --git a/.glib2.metadata b/.glib2.metadata
index 8132db2..ab4ad8f 100644
--- a/.glib2.metadata
+++ b/.glib2.metadata
@@ -1 +1 @@
-3177471fb11fd2fd5abb77ec0675ee0049521009 SOURCES/glib-2.50.3.tar.xz
+85b5d649fc3d18f8d8197bd971dfbebd94b5f96d SOURCES/glib-2.54.2.tar.xz
diff --git a/SOURCES/0001-Build-with-old-libmount-too.patch b/SOURCES/0001-Build-with-old-libmount-too.patch
new file mode 100644
index 0000000..8e81770
--- /dev/null
+++ b/SOURCES/0001-Build-with-old-libmount-too.patch
@@ -0,0 +1,57 @@
+From a78c36d7f4e0e3038005305efd84f66a7d157f20 Mon Sep 17 00:00:00 2001
+From: Colin Walters <walters@verbum.org>
+Date: Wed, 1 Nov 2017 10:21:34 -0400
+Subject: [PATCH] Build with old libmount too
+
+Downstream: https://bugzilla.redhat.com/show_bug.cgi?id=1508056
+
+This is an easy change, and lets us build with RHEL7's libmount.
+
+See also https://github.com/ostreedev/ostree/commit/cee57a0268334d51cd312c6cdcf367bedfd3e30d
+---
+ configure.ac      | 6 ++++--
+ gio/gunixmounts.c | 4 ++--
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index fcbb62e7d..0beb3898c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1760,8 +1760,10 @@ AS_IF([ test $have_libmount = maybe ], [
+   glib_save_LIBS=$LIBS
+   AC_CHECK_HEADER([libmount/libmount.h], [:], [have_libmount=no])
+ 
+-  # Check for a recent enough libmount
+-  AC_CHECK_LIB([mount], [mnt_unref_table], [:], [have_libmount=no])
++  # We used to check for mnt_unref_table(), but now for compat with
++  # e.g. RHEL7 just use mnt_free_table().  Let's keep this check
++  # anyways.
++  AC_CHECK_LIB([mount], [mnt_free_table], [:], [have_libmount=no])
+   LIBS=$glib_save_LIBS
+ 
+   if test $have_libmount != no; then
+diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
+index ef7899dff..a3c40f5c1 100644
+--- a/gio/gunixmounts.c
++++ b/gio/gunixmounts.c
+@@ -505,7 +505,7 @@ _g_get_unix_mounts (void)
+   mnt_free_iter (iter);
+ 
+  out:
+-  mnt_unref_table (table);
++  mnt_free_table (table);
+ 
+   return g_list_reverse (return_list);
+ }
+@@ -1029,7 +1029,7 @@ _g_get_unix_mount_points (void)
+   mnt_free_iter (iter);
+ 
+  out:
+-  mnt_unref_table (table);
++  mnt_free_table (table);
+ 
+   return g_list_reverse (return_list);
+ }
+-- 
+2.13.6
+
diff --git a/SOURCES/0001-gdbus-codegen-Call-abspath-earlier.patch b/SOURCES/0001-gdbus-codegen-Call-abspath-earlier.patch
new file mode 100644
index 0000000..d04b86b
--- /dev/null
+++ b/SOURCES/0001-gdbus-codegen-Call-abspath-earlier.patch
@@ -0,0 +1,43 @@
+From 9d80b0bca3f90e2489aac8e7765081c47e8a66f5 Mon Sep 17 00:00:00 2001
+From: Colin Walters <walters@verbum.org>
+Date: Tue, 31 Oct 2017 12:51:09 -0400
+Subject: [PATCH] gdbus-codegen: Call abspath() earlier
+
+The previous change from https://bugzilla.gnome.org/show_bug.cgi?id=786785
+didn't actually work (for me at least) in the `/bin/gdbus-codegen` case
+as the relative `/bin/../share` path works, but then `os.path.abspath()`
+breaks it (as it's not doing `realpath()`, and let's not go there).
+
+Fix this by doing the `abspath` first.
+
+Downstream: https://bugzilla.redhat.com/show_bug.cgi?id=1507661
+---
+ gio/gdbus-2.0/codegen/gdbus-codegen.in | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in
+index e3f4f00f8..67d367543 100755
+--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in
++++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in
+@@ -37,6 +37,9 @@ else:
+     # parent directory to the python path.
+     path = os.path.join(filedir, '..')
+ 
++# Canonicalize, then do further testing
++path = os.path.abspath(path)
++
+ # If the above path detection failed, use the hard-coded datadir. This can
+ # happen when, for instance, bindir and datadir are not in the same prefix or
+ # on Windows where we cannot make any guarantees about the directory structure.
+@@ -46,7 +49,7 @@ else:
+ if not os.path.isfile(os.path.join(path, 'codegen', 'codegen_main.py')):
+     path = os.path.join('@DATADIR@', 'glib-2.0')
+ 
+-sys.path.insert(0, os.path.abspath(path))
++sys.path.insert(0, path)
+ from codegen import codegen_main
+ 
+ sys.exit(codegen_main.codegen_main())
+-- 
+2.13.6
+
diff --git a/SOURCES/0001-gdbus-codegen-Don-t-assume-bindir-and-datadir-share-.patch b/SOURCES/0001-gdbus-codegen-Don-t-assume-bindir-and-datadir-share-.patch
new file mode 100644
index 0000000..d898468
--- /dev/null
+++ b/SOURCES/0001-gdbus-codegen-Don-t-assume-bindir-and-datadir-share-.patch
@@ -0,0 +1,53 @@
+From b9f2ea423526735f7fe7371fb1339eae91a618c2 Mon Sep 17 00:00:00 2001
+From: Nirbheek Chauhan <nirbheek@centricular.com>
+Date: Tue, 12 Sep 2017 15:46:57 +0530
+Subject: [PATCH] gdbus-codegen: Don't assume bindir and datadir share prefix
+
+This assumption breaks when, for instance:
+
+* Called as /bin/gdbus-codegen
+* Installed on Windows in a directory that is not `bin/`
+
+For such cases, we cannot make any assumptions about the directory
+structure, and must hard-code the datadir.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=786785
+---
+ gio/gdbus-2.0/codegen/Makefile.am      | 2 +-
+ gio/gdbus-2.0/codegen/gdbus-codegen.in | 9 +++++++++
+ gio/gdbus-2.0/codegen/meson.build      | 1 +
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/gio/gdbus-2.0/codegen/Makefile.am b/gio/gdbus-2.0/codegen/Makefile.am
+index b3fb2c292..b4e500cb0 100644
+--- a/gio/gdbus-2.0/codegen/Makefile.am
++++ b/gio/gdbus-2.0/codegen/Makefile.am
+@@ -21,7 +21,7 @@ CLEANFILES += gdbus-codegen
+ EXTRA_DIST += gdbus-codegen.in
+ 
+ gdbus-codegen: gdbus-codegen.in Makefile $(codegen_PYTHON)
+-	$(AM_V_GEN) sed -e 's,@datadir\@,$(datadir),' -e 's,@PYTHON\@,$(PYTHON),' $< > $@.tmp && mv $@.tmp $@
++	$(AM_V_GEN) sed -e 's,@DATADIR\@,$(datadir),' -e 's,@PYTHON\@,$(PYTHON),' $< > $@.tmp && mv $@.tmp $@
+ 	@chmod a+x $@
+ 
+ clean-local:
+diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in
+index 805098188..e3f4f00f8 100644
+--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in
++++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in
+@@ -37,6 +37,15 @@ else:
+     # parent directory to the python path.
+     path = os.path.join(filedir, '..')
+ 
++# If the above path detection failed, use the hard-coded datadir. This can
++# happen when, for instance, bindir and datadir are not in the same prefix or
++# on Windows where we cannot make any guarantees about the directory structure.
++#
++# In these cases our installation cannot be relocatable, but at least we should
++# be able to find the codegen module.
++if not os.path.isfile(os.path.join(path, 'codegen', 'codegen_main.py')):
++    path = os.path.join('@DATADIR@', 'glib-2.0')
++
+ sys.path.insert(0, os.path.abspath(path))
+ from codegen import codegen_main
+ 
diff --git a/SOURCES/0001-gdbus-fix-use-after-free.patch b/SOURCES/0001-gdbus-fix-use-after-free.patch
deleted file mode 100644
index 6ff21f2..0000000
--- a/SOURCES/0001-gdbus-fix-use-after-free.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 0751ccd31505cd2774053553263466c6933b3c42 Mon Sep 17 00:00:00 2001
-From: Lars Uebernickel <lars.uebernickel@canonical.com>
-Date: Thu, 28 Jan 2016 15:39:18 +0100
-Subject: [PATCH] gdbus: fix use-after-free
-
-g_dbus_connection_call_internal() accesses the user data it passes to
-g_dbus_connection_send_message_with_reply() after the call. That data
-might be freed already in the case that the callback is called
-immediately.
-
-Fix this by removing the 'serial' field from the user data altogether
-and fetch the serial from the message in the callback.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=748263
----
- gio/gdbusconnection.c | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
-index 4a4f403..8263419 100644
---- a/gio/gdbusconnection.c
-+++ b/gio/gdbusconnection.c
-@@ -5660,7 +5660,6 @@ typedef struct
- {
-   GVariantType *reply_type;
-   gchar *method_name; /* for error message */
--  guint32 serial;
- 
-   GUnixFDList *fd_list;
- } CallState;
-@@ -5701,7 +5700,7 @@ g_dbus_connection_call_done (GObject      *source,
-                " <<<< ASYNC COMPLETE %s() (serial %d)\n"
-                "      ",
-                state->method_name,
--               state->serial);
-+               g_dbus_message_get_reply_serial (reply));
-       if (reply != NULL)
-         {
-           g_print ("SUCCESS\n");
-@@ -5798,11 +5797,10 @@ g_dbus_connection_call_internal (GDBusConnection        *connection,
-                                                  message,
-                                                  G_DBUS_SEND_MESSAGE_FLAGS_NONE,
-                                                  timeout_msec,
--                                                 &state->serial,
-+                                                 &serial,
-                                                  cancellable,
-                                                  g_dbus_connection_call_done,
-                                                  task);
--      serial = state->serial;
-     }
-   else
-     {
--- 
-2.9.4
-
diff --git a/SOURCES/0001-gio-fam-Remove-leftover-debug-print.patch b/SOURCES/0001-gio-fam-Remove-leftover-debug-print.patch
deleted file mode 100644
index 9a009da..0000000
--- a/SOURCES/0001-gio-fam-Remove-leftover-debug-print.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From dd914da1c80941ed1c435671cac20ca4f5f7f0e6 Mon Sep 17 00:00:00 2001
-From: Colin Walters <walters@verbum.org>
-Date: Thu, 16 Mar 2017 09:12:26 -0400
-Subject: [PATCH] gio/fam: Remove leftover debug print
-
-This leftover debug print was introduced by d682df186e9cca2b8db0e921450a4db31cf0c467
-and is obviously bad for applications that are expecting something
-else on stdout, etc.
-
-See: https://bugzilla.redhat.com/show_bug.cgi?id=1396386
-
-https://bugzilla.gnome.org/show_bug.cgi?id=780144
----
- gio/fam/gfamfilemonitor.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/gio/fam/gfamfilemonitor.c b/gio/fam/gfamfilemonitor.c
-index 50474c8..551b3c2 100644
---- a/gio/fam/gfamfilemonitor.c
-+++ b/gio/fam/gfamfilemonitor.c
-@@ -140,8 +140,6 @@ g_fam_file_monitor_is_supported (void)
- 
-   g_mutex_unlock (&fam_lock);
- 
--  g_print ("II %d\n", fam_initialised);
--
-   return fam_initialised;
- }
- 
--- 
-2.9.3
-
diff --git a/SOURCES/0001-gio-fix-race-condition-in-GDBusObjectManagerClient.patch b/SOURCES/0001-gio-fix-race-condition-in-GDBusObjectManagerClient.patch
new file mode 100644
index 0000000..0c91bab
--- /dev/null
+++ b/SOURCES/0001-gio-fix-race-condition-in-GDBusObjectManagerClient.patch
@@ -0,0 +1,50 @@
+From aeecd81dd13e4d8ef609149f82770ad06a8fccdb Mon Sep 17 00:00:00 2001
+From: Beniamino Galvani <bgalvani@redhat.com>
+Date: Sat, 30 Sep 2017 11:26:29 +0200
+Subject: [PATCH] gio: fix race condition in GDBusObjectManagerClient
+
+priv->map_object_path_to_object_proxy must be protected to avoid
+concurrent access by multiple threads. Move the hash table insertion
+into the critical section.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=788368
+---
+ gio/gdbusobjectmanagerclient.c | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/gio/gdbusobjectmanagerclient.c b/gio/gdbusobjectmanagerclient.c
+index 1c00797cd165..08c94d5068ef 100644
+--- a/gio/gdbusobjectmanagerclient.c
++++ b/gio/gdbusobjectmanagerclient.c
+@@ -1542,6 +1542,13 @@ add_interfaces (GDBusObjectManagerClient *manager,
+       g_variant_unref (properties);
+     }
+ 
++  if (added)
++    {
++      g_hash_table_insert (manager->priv->map_object_path_to_object_proxy,
++                           g_strdup (object_path),
++                           op);
++    }
++
+   g_mutex_unlock (&manager->priv->lock);
+ 
+   /* now that we don't hold the lock any more, emit signals */
+@@ -1555,12 +1562,8 @@ add_interfaces (GDBusObjectManagerClient *manager,
+   g_list_free (interface_added_signals);
+ 
+   if (added)
+-    {
+-      g_hash_table_insert (manager->priv->map_object_path_to_object_proxy,
+-                           g_strdup (object_path),
+-                           op);
+-      g_signal_emit_by_name (manager, "object-added", op);
+-    }
++    g_signal_emit_by_name (manager, "object-added", op);
++
+   g_object_unref (manager);
+   g_object_unref (op);
+ }
+-- 
+2.14.2
+
diff --git a/SPECS/glib2.spec b/SPECS/glib2.spec
index 0ec8aab..d46ca6b 100644
--- a/SPECS/glib2.spec
+++ b/SPECS/glib2.spec
@@ -1,13 +1,13 @@
 %global _changelog_trimtime %(date +%s -d "1 year ago")
 
 Name: glib2
-Version: 2.50.3
-Release: 3%{?dist}
+Version: 2.54.2
+Release: 2%{?dist}
 Summary: A library of handy utility functions
 
 License: LGPLv2+
 URL: http://www.gtk.org
-Source0: http://download.gnome.org/sources/glib/2.50/glib-%{version}.tar.xz
+Source0: http://download.gnome.org/sources/glib/2.54/glib-%{version}.tar.xz
 
 BuildRequires: git
 BuildRequires: pkgconfig
@@ -35,9 +35,10 @@ BuildRequires: chrpath
 Patch0: revert-g-source-remove-critical.patch
 Patch1: add-back-g-memmove.patch
 
-# Patches on top of 2.50+
-Patch2: 0001-gio-fam-Remove-leftover-debug-print.patch
-Patch3: 0001-gdbus-fix-use-after-free.patch
+Patch2: 0001-gdbus-codegen-Don-t-assume-bindir-and-datadir-share-.patch
+Patch3: 0001-gdbus-codegen-Call-abspath-earlier.patch
+Patch4: 0001-Build-with-old-libmount-too.patch
+Patch5: 0001-gio-fix-race-condition-in-GDBusObjectManagerClient.patch
 
 # for GIO content-type support
 Requires: shared-mime-info
@@ -198,6 +199,7 @@ gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules
 %{_bindir}/glib-compile-resources
 %{_bindir}/gresource
 %{_datadir}/glib-2.0/codegen
+%{_datadir}/glib-2.0/valgrind/glib.supp
 %attr (0755, root, root) %{_bindir}/gtester-report
 %{_mandir}/man1/glib-genmarshal.1*
 %{_mandir}/man1/glib-gettextize.1*
@@ -230,6 +232,23 @@ gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules
 %{_datadir}/installed-tests
 
 %changelog
+* Fri Nov 10 2017 Kalev Lember <klember@redhat.com> - 2.54.2-2
+- Backport patch to fix race condition in GDBusObjectManagerClient
+- Resolves: #1494065
+
+* Wed Nov 01 2017 Kalev Lember <klember@redhat.com> - 2.54.2-1
+- Update to 2.54.2
+- Related: #1481386
+
+* Tue Oct 31 2017 Colin Walters <walters@verbum.org> - 2.54.1-3
+- Backport patch to fix invocations of /bin/gdbus-codegen
+- Related: #1481386
+  See also bug 1507661
+
+* Wed Oct 18 2017 Florian Müllner <fmuellner@redhat.com> - 2.54.1-1
+- Update to 2.54.1
+- Related: #1481386
+
 * Tue Jun 06 2017 Colin Walters <walters@verbum.org> - 2.50.3-3
 - Add patch to fix use-after-free in GDBus
 - Resolves: #1437669