[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 01/01: debian/patches/git-fix-sync: Cherry-pick fix sync at shutd
From: |
Samuel Thibault |
Subject: |
[hurd] 01/01: debian/patches/git-fix-sync: Cherry-pick fix sync at shutdown |
Date: |
Mon, 15 Jan 2018 22:05:02 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch master
in repository hurd.
commit 3973c489835d9a098dd2d111db8b1b1bc25c5087
Author: Samuel Thibault <address@hidden>
Date: Mon Jan 15 21:11:30 2018 +0000
debian/patches/git-fix-sync: Cherry-pick fix sync at shutdown
---
debian/changelog | 6 ++++
debian/patches/git-fix-sync | 68 +++++++++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 75 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index e388065..ce0aa4f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+hurd (1:0.9.git20180108-2) unstable; urgency=medium
+
+ * debian/patches/git-fix-sync: Cherry-pick fix sync at shutdown.
+
+ -- Samuel Thibault <address@hidden> Mon, 15 Jan 2018 21:10:10 +0000
+
hurd (1:0.9.git20180108-1) unstable; urgency=medium
* New upstream snapshot.
diff --git a/debian/patches/git-fix-sync b/debian/patches/git-fix-sync
new file mode 100644
index 0000000..8c106c7
--- /dev/null
+++ b/debian/patches/git-fix-sync
@@ -0,0 +1,68 @@
+commit f05b6bae5cbdf3c221eba05987dea7ab14e6524f
+Author: Samuel Thibault <address@hidden>
+Date: Mon Jan 15 22:00:11 2018 +0100
+
+ Revert "libdiskfs: Shutdown pagers on startup_dosync."
+
+ This reverts commit 89a49ec8b3a847f3b770cff6a4a80b98b94ad7bf.
+
+ There was a typo in diskfs_shutdown (FSYS_GOAWAY_FORCE ||
FSYS_GOAWAY_RECURSE)
+ which was making it FSYS_GOAWAY_NOWAIT, and thus not actually syncing if
+ there happens to be clients (it was then returning EBUSY). Fixing this into
+ FSYS_GOAWAY_FORCE | FSYS_GOAWAY_RECURSE then makes it wait for clients (and
+ NOWAIT is not supported), and there are very often some left, thus not
+ syncing either.
+
+diff --git a/libdiskfs/init-startup.c b/libdiskfs/init-startup.c
+index 4251e0b3..a2e3638d 100644
+--- a/libdiskfs/init-startup.c
++++ b/libdiskfs/init-startup.c
+@@ -126,15 +126,47 @@ diskfs_startup_diskfs (mach_port_t bootstrap, int flags)
+ error_t
+ diskfs_S_startup_dosync (mach_port_t handle)
+ {
++ error_t err = 0;
+ struct port_info *pi
+ = ports_lookup_port (diskfs_port_bucket, handle,
+ diskfs_shutdown_notification_class);
+
+ if (!pi)
+ return EOPNOTSUPP;
++
++ if (! diskfs_readonly)
++ {
++ /* First start a sync so that if something goes wrong
++ we at least get this much done. */
++ diskfs_sync_everything (0);
++ diskfs_set_hypermetadata (0, 0);
++
++ pthread_rwlock_wrlock (&diskfs_fsys_lock);
++
++ /* Permit all the current RPC's to finish, and then suspend new ones */
++ err = ports_inhibit_class_rpcs (diskfs_protid_class);
++ if (! err)
++ {
++ diskfs_sync_everything (1);
++ diskfs_set_hypermetadata (1, 1);
++ _diskfs_diskdirty = 0;
++
++ /* XXX: if some application writes something after that, we will
++ * crash. That is still better than creating pending writes before
++ * poweroff, and thus fsck on next reboot.
++ */
++ diskfs_readonly = 1;
++ diskfs_readonly_changed (1);
++
++ ports_resume_class_rpcs (diskfs_protid_class);
++ }
++
++ pthread_rwlock_unlock (&diskfs_fsys_lock);
++ }
++
+ ports_port_deref (pi);
+
+- return diskfs_shutdown (FSYS_GOAWAY_FORCE || FSYS_GOAWAY_RECURSE);
++ return err;
+ }
+
+ /* This is called when we have an ordinary environment, complete
diff --git a/debian/patches/series b/debian/patches/series
index 898753d..37a238a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -25,3 +25,4 @@ crash-logging.patch
using_std.patch
netdde_log.patch
libports-iterate-refcount.patch
+git-fix-sync
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git