[PATCH 1/1] Always call helpers fsync/fdatasync, not the os versions

0 views
Skip to first unread message

Rob Browning

unread,
Aug 18, 2025, 4:30:15 PMAug 18
to bup-...@googlegroups.com
Fix an oversight in

helpers: provide fsync too and use it everywhere
933170a356b0c60291c19ac4ff91132ebd92ce3b

(had already been fixed in main):. Make sure we always call the
helpers sync functions rather than the os versions so that we'll
actually be durable on macos.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---

Pushed to 0.33.x.

lib/bup/git.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/bup/git.py b/lib/bup/git.py
index 8ada62c9..95cb8da3 100644
--- a/lib/bup/git.py
+++ b/lib/bup/git.py
@@ -21,6 +21,7 @@ from bup.io import path_msg
from bup.helpers import (Sha1, add_error, chunkyreader, debug1, debug2,
exo,
fdatasync,
+ fsync,
finalized,
log,
merge_dict,
@@ -962,7 +963,7 @@ class PackWriter(object):
b'objects/pack/pack-' + hexlify(packbin))
os.rename(tmpdir + b'/pack', nameprefix + b'.pack')
os.rename(tmpdir + b'/idx', nameprefix + b'.idx')
- os.fsync(pfd)
+ fsync(pfd)
if self.on_pack_finish:
self.on_pack_finish(nameprefix)
if run_midx:
--
2.47.2

Reply all
Reply to author
Forward
0 new messages