mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-19 01:55:04 +01:00
fix(fuse): keep inode stable across rename
relocate() called forget(), dropping the node's by_uid mapping, so the re-enumeration assigned a fresh inode. The kernel had already carried the renamed dentry onto the old one and holds it for the entry TTL, so lookup/getattr/opendir resolved to an inode entries no longer held and returned ENOENT — while readdir walked children and reported the new inode. A renamed directory listed in its parent but could not be entered until the TTL expired. Rewrite the node in place and invalidate both parents' listings instead. Also stops the moved node's DB row being deleted and recreated on every move, which the B1 data-loss fix worked around
This commit is contained in:
1 parent
f9250211b8
commit
532628456e
14 files changed
+1302
-244
No files matched your search
@@ -615,13 +615,6 @@ pub(crate) fn wire_gallery(ui: &Rc<Ui>, list: >k4::ListView, scroll: >k4::Sc
|
||||
.and_then(|n| n.to_str())
|
||||
.unwrap_or("photo.jpg")
|
||||
.to_string();
|
||||
let bytes = match std::fs::read(&path) {
|
||||
Ok(b) => b,
|
||||
Err(e) => {
|
||||
tracing::error!("Failed to read photo: {e}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
let ext = path
|
||||
.extension()
|
||||
.and_then(|e| e.to_str())
|
||||
@@ -643,10 +636,13 @@ pub(crate) fn wire_gallery(ui: &Rc<Ui>, list: >k4::ListView, scroll: >k4::Sc
|
||||
ui.busy_begin();
|
||||
let rx = spawn_request(
|
||||
ui.dirs.control_socket(),
|
||||
// The daemon opens the file itself: it runs on this machine,
|
||||
// and a photo's bytes through line-delimited JSON is an OOM
|
||||
// of both processes (see `Request::UploadPhoto`).
|
||||
Request::UploadPhoto {
|
||||
name,
|
||||
media_type: media_type.to_string(),
|
||||
bytes,
|
||||
source_path: path.display().to_string(),
|
||||
capture_time,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -270,6 +270,12 @@ fn main() -> Result<()> {
|
||||
let _ = std::fs::remove_file(&tray_sock);
|
||||
let _lock_socket = std::os::unix::net::UnixListener::bind(&tray_sock)
|
||||
.context("failed to bind tray single-instance socket")?;
|
||||
// Owner-only like the control socket (B6). This one only guards single
|
||||
// instancing, so a failure is logged rather than fatal — but there is no
|
||||
// reason to leave it reachable by other local users either.
|
||||
if let Err(e) = pdfs_core::config::restrict_socket(&tray_sock) {
|
||||
tracing::warn!(error = %e, "could not restrict tray socket permissions");
|
||||
}
|
||||
|
||||
let socket = dirs.control_socket();
|
||||
let default_mountpoint = dirs.default_mountpoint();
|
||||
|
||||
Reference in new issue
Block a user