summaryrefslogtreecommitdiff
path: root/sysutils/gvfs
diff options
context:
space:
mode:
authormartin <martin>2015-08-13 08:57:08 +0000
committermartin <martin>2015-08-13 08:57:08 +0000
commitacb282a762e0d3b449e5c82d333cac985786b46c (patch)
tree56ba0c444af498680a98e8958198176219571a33 /sysutils/gvfs
parentcb452341af8021e53e02e1b2e1924f0607a34063 (diff)
downloadpkgsrc-acb282a762e0d3b449e5c82d333cac985786b46c.tar.gz
Bring in a patch from upstream to fix unaligned access in the metadata
journal
Diffstat (limited to 'sysutils/gvfs')
-rw-r--r--sysutils/gvfs/Makefile4
-rw-r--r--sysutils/gvfs/distinfo3
-rw-r--r--sysutils/gvfs/patches/patch-metadata_metatree.c56
3 files changed, 60 insertions, 3 deletions
diff --git a/sysutils/gvfs/Makefile b/sysutils/gvfs/Makefile
index 1554a9da853..409fedfbc0c 100644
--- a/sysutils/gvfs/Makefile
+++ b/sysutils/gvfs/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.72 2015/06/07 14:05:59 youri Exp $
+# $NetBSD: Makefile,v 1.73 2015/08/13 08:57:08 martin Exp $
#
DISTNAME= gvfs-1.6.7
-PKGREVISION= 16
+PKGREVISION= 17
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_GNOME:=sources/gvfs/1.6/}
EXTRACT_SUFX= .tar.bz2
diff --git a/sysutils/gvfs/distinfo b/sysutils/gvfs/distinfo
index 68acc6511d9..75daca653ba 100644
--- a/sysutils/gvfs/distinfo
+++ b/sysutils/gvfs/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.23 2014/10/17 16:48:17 joerg Exp $
+$NetBSD: distinfo,v 1.24 2015/08/13 08:57:08 martin Exp $
SHA1 (gvfs-1.6.7.tar.bz2) = 285a810772dce8b37289cbe0aaab8354f2b6717a
RMD160 (gvfs-1.6.7.tar.bz2) = e833fdbc9dc503cdde8e0ab5a7a8fa5403ec1aa1
@@ -9,3 +9,4 @@ SHA1 (patch-ad) = 45e7d172fe4839018b64babdca2f8c60c7eeec70
SHA1 (patch-ae) = 07b631786e89f38f831a1cc926818c15520fcd3b
SHA1 (patch-ag) = 8474aed53e07f2c3899bafc278d886c41ccd04a5
SHA1 (patch-ai) = 2246232efe91c36be8c577c1db16e80ebb45a515
+SHA1 (patch-metadata_metatree.c) = 952352af28299c92403932ef38d281611427b654
diff --git a/sysutils/gvfs/patches/patch-metadata_metatree.c b/sysutils/gvfs/patches/patch-metadata_metatree.c
new file mode 100644
index 00000000000..a15d23014d3
--- /dev/null
+++ b/sysutils/gvfs/patches/patch-metadata_metatree.c
@@ -0,0 +1,56 @@
+$NetBSD: patch-metadata_metatree.c,v 1.1 2015/08/13 08:57:08 martin Exp $
+
+Upstream commit
+https://git.gnome.org/browse/gvfs/commit/?id=d17e4dbfef0b9859b7d8a149b931cf685f9b4e15
+to fix unaligned access in the meta data journal
+
+
+--- metadata/metatree.c.orig 2011-03-21 16:42:27.000000000 +0100
++++ metadata/metatree.c 2015-08-13 10:31:10.000000000 +0200
+@@ -170,6 +170,28 @@ struct _MetaTree {
+ MetaJournal *journal;
+ };
+
++/* Unfortunately the journal entries are only aligned to 32 bit boundaries
++ * but on some 64-bit RISC architectures (e.g. Alpha) this is insufficient
++ * to guarantee correct alignment of 64-bit accesses. This is not a show
++ * stopper but does cause inefficient traps to the kernel and pollution of
++ * kernel logs. Rather than fix the alignment we provide a helper function,
++ * dependent on features specific to gcc, to correctly access a 64-bit datum
++ * that may be misaligned.
++ *
++ * See https://bugzilla.gnome.org/show_bug.cgi?id=726456
++ */
++#if defined(__GNUC__) && (defined(__alpha__) || defined(__mips__) || defined(__sparc__))
++struct una_u64 { guint64 x __attribute__((packed)); };
++static inline guint64 ldq_u(guint64 *p)
++{
++ const struct una_u64 *ptr = (const struct una_u64 *) p;
++ return ptr->x;
++}
++#else
++#define ldq_u(x) (*(x))
++#endif
++
++
+ static void meta_tree_refresh_locked (MetaTree *tree);
+ static MetaJournal *meta_journal_open (MetaTree *tree,
+ const char *filename,
+@@ -1303,7 +1325,7 @@ meta_journal_iterate (MetaJournal *journ
+ sizep = (guint32 *)entry;
+ entry = (MetaJournalEntry *)((char *)entry - GUINT32_FROM_BE (*(sizep-1)));
+
+- mtime = GUINT64_FROM_BE (entry->mtime);
++ mtime = GUINT64_FROM_BE (ldq_u (&entry->mtime));
+ journal_path = &entry->path[0];
+
+ if (journal_entry_is_key_type (entry) &&
+@@ -2287,7 +2309,7 @@ apply_journal_to_builder (MetaTree *tree
+ entry = journal->first_entry;
+ while (entry < journal->last_entry)
+ {
+- mtime = GUINT64_FROM_BE (entry->mtime);
++ mtime = GUINT64_FROM_BE (ldq_u (&(entry->mtime)));
+ journal_path = &entry->path[0];
+
+ switch (entry->entry_type)