diff --git a/0001-gio-Allow-no-atime-from-statx.patch b/0001-gio-Allow-no-atime-from-statx.patch new file mode 100644 index 0000000..a91a9ff --- /dev/null +++ b/0001-gio-Allow-no-atime-from-statx.patch @@ -0,0 +1,52 @@ +From 6fc143bba81a02cac0ca6bc47e8249b65ffc0ad9 Mon Sep 17 00:00:00 2001 +From: Valentin David +Date: Sun, 23 Aug 2020 16:41:17 +0200 +Subject: [PATCH] gio: Allow no atime from statx + +statx does not provide stx_atime when querying a file in a read-only +mounted file system. So call to statx should not expect it to be in +the mask. Otherwise we would fail with ERANGE for querying any file in +a read-only file system. + +Fixes #2189. +--- + gio/glocalfileinfo.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c +index a34c1b78a..0690e1da2 100644 +--- a/gio/glocalfileinfo.c ++++ b/gio/glocalfileinfo.c +@@ -1025,13 +1025,16 @@ set_info_from_stat (GFileInfo *info, + #elif defined (HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC) + _g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_TIME_MODIFIED_USEC, _g_stat_mtim_nsec (statbuf) / 1000); + #endif +- +- _g_file_info_set_attribute_uint64_by_id (info, G_FILE_ATTRIBUTE_ID_TIME_ACCESS, _g_stat_atime (statbuf)); ++ ++ if (_g_stat_has_field (statbuf, G_LOCAL_FILE_STAT_FIELD_ATIME)) ++ { ++ _g_file_info_set_attribute_uint64_by_id (info, G_FILE_ATTRIBUTE_ID_TIME_ACCESS, _g_stat_atime (statbuf)); + #if defined (HAVE_STRUCT_STAT_ST_ATIMENSEC) +- _g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_TIME_ACCESS_USEC, statbuf->st_atimensec / 1000); ++ _g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_TIME_ACCESS_USEC, statbuf->st_atimensec / 1000); + #elif defined (HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC) +- _g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_TIME_ACCESS_USEC, _g_stat_atim_nsec (statbuf) / 1000); ++ _g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_TIME_ACCESS_USEC, _g_stat_atim_nsec (statbuf) / 1000); + #endif ++ } + #endif + + #ifndef G_OS_WIN32 +@@ -1805,7 +1808,7 @@ _g_local_file_info_get (const char *basename, + + res = g_local_file_lstat (path, + G_LOCAL_FILE_STAT_FIELD_BASIC_STATS | G_LOCAL_FILE_STAT_FIELD_BTIME, +- G_LOCAL_FILE_STAT_FIELD_ALL & (~G_LOCAL_FILE_STAT_FIELD_BTIME), ++ G_LOCAL_FILE_STAT_FIELD_ALL & (~G_LOCAL_FILE_STAT_FIELD_BTIME) & (~G_LOCAL_FILE_STAT_FIELD_ATIME), + &statbuf); + + if (res == -1) +-- +2.28.0 + diff --git a/glib2.spec b/glib2.spec index d062aa3..96110ac 100644 --- a/glib2.spec +++ b/glib2.spec @@ -1,6 +1,6 @@ Name: glib2 Version: 2.65.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A library of handy utility functions License: LGPLv2+ @@ -9,6 +9,11 @@ Source0: http://download.gnome.org/sources/glib/2.65/glib-%{version}.tar.xz # Avoid requiring a too new gtk-doc version for building glib Patch0: gtk-doc-1-32.patch +# Fixes errors accessing read-only file systems (and possibly CIFS +# shares) +# https://gitlab.gnome.org/GNOME/glib/-/issues/2189 +# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1630 +Patch1: 0001-gio-Allow-no-atime-from-statx.patch BuildRequires: chrpath BuildRequires: gcc @@ -217,6 +222,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_datadir}/installed-tests %changelog +* Tue Aug 25 2020 Adam Williamson - 2.65.2-3 +- Backport fix for GGO #2189 (error accessing some filesystems) + * Thu Aug 20 2020 Jeff Law - 2.65.2-2 - Re-enable LTO