fix(fuse): keep the size of a file open for writing across re-listings

B109: an online create seals an empty file on Drive, and until the last
close the written bytes live only in the open handle. A re-listing of
the parent, a size upgrade or a create landing re-interned the node with
Drive's empty size, the kernel capped reads at that size, and SQLite
reported "database disk image is malformed". State::keep_open_write_size
now carries the handle's size and local mtime over in all three places.

The acceptance script waits for My files to mount after a daemon restart
instead of failing at once.
This commit is contained in:
nvrl committed 2026-09-29 16:49:13 +02:00
1 parent a2992b3b9d
commit f252b09757
6 files changed
+83 -9

No files matched your search

+10 -2
View File
@@ -3488,9 +3488,17 @@ def run_account(reference: Run, args) -> None:
"no running pdfs daemon: start proton-drive.service and sign in, "
"or pass --offline-only for the account-free contract"
)
status = daemon.status()
# A daemon that was just (re)started answers before it has mounted My
# files; give it the sync timeout to get there rather than failing at once.
deadline = time.monotonic() + timeout
while True:
status = daemon.status()
mountpoint = (status.get("mount") or {}).get("mountpoint")
ready = bool(mountpoint) and is_mountpoint(Path(mountpoint))
if ready or not status.get("logged_in") or time.monotonic() >= deadline:
break
time.sleep(1)
check(bool(status.get("logged_in")), "the daemon is not signed in; run `pdfs login` first")
mountpoint = (status.get("mount") or {}).get("mountpoint")
check(
bool(mountpoint) and is_mountpoint(Path(mountpoint)),
f"My files is not mounted (daemon reports {mountpoint!r})",