aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSulfurNitride <lukew19@proton.me>2026-06-24 16:51:36 -0500
committerSulfurNitride <lukew19@proton.me>2026-06-24 16:51:36 -0500
commit1be46fbb193010d6a5d1ea79167eca08a99e8d4c (patch)
tree9f4b54fe1bc1d25c741239180b2bd09c839417db
parent0e993b45d3c4db36bf01ec0e56e11fd836cc59a2 (diff)
Fix fuse_req_session CI build error
fuse_req_session() is not available in all libfuse3 builds in the CI image. Instead, store the fuse_session* directly in Mo2FsContext (set once after fuse_session_new in fuseconnector.cpp) and use ctx->session in the fuse_lowlevel_notify_inval_inode calls that fix the INI key clobber. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rw-r--r--src/src/fuseconnector.cpp1
-rw-r--r--src/src/vfs/mo2filesystem.cpp8
-rw-r--r--src/src/vfs/mo2filesystem.h4
3 files changed, 9 insertions, 4 deletions
diff --git a/src/src/fuseconnector.cpp b/src/src/fuseconnector.cpp
index c5b5718..3b3c1ba 100644
--- a/src/src/fuseconnector.cpp
+++ b/src/src/fuseconnector.cpp
@@ -578,6 +578,7 @@ bool FuseConnector::mount(
m_backingFd = -1;
throw FuseConnectorException(QObject::tr("Failed to create FUSE session"));
}
+ m_context->session = m_session;
if (fuse_session_mount(m_session, m_mountPoint.c_str()) != 0) {
fuse_session_destroy(m_session);
diff --git a/src/src/vfs/mo2filesystem.cpp b/src/src/vfs/mo2filesystem.cpp
index 9d2eb14..5fa170e 100644
--- a/src/src/vfs/mo2filesystem.cpp
+++ b/src/src/vfs/mo2filesystem.cpp
@@ -1900,7 +1900,7 @@ void mo2_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info* fi)
openSize, openMtime);
// Flush stale kernel page cache so the next read sees the truncated
// content, not the pre-truncation data cached from a prior open.
- fuse_lowlevel_notify_inval_inode(fuse_req_session(req), ino, 0, 0);
+ fuse_lowlevel_notify_inval_inode(ctx->session, ino, 0, 0);
}
} else {
// Mod file disappeared — fall through to normal handling
@@ -1920,7 +1920,7 @@ void mo2_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info* fi)
openMtime = std::chrono::system_clock::now();
updateFileNodeKnown(ctx, path, realPath, originForPath(ctx, realPath),
openSize, openMtime);
- fuse_lowlevel_notify_inval_inode(fuse_req_session(req), ino, 0, 0);
+ fuse_lowlevel_notify_inval_inode(ctx->session, ino, 0, 0);
}
} else if (fd < 0 && truncateOnOpen) {
try {
@@ -1943,7 +1943,7 @@ void mo2_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info* fi)
// The file's backing path changed from mod/base-game to staging.
// Flush the kernel page cache so subsequent reads go through FUSE
// and see the staging content, not the pre-COW cached data.
- fuse_lowlevel_notify_inval_inode(fuse_req_session(req), ino, 0, 0);
+ fuse_lowlevel_notify_inval_inode(ctx->session, ino, 0, 0);
}
} catch (...) {
fuse_reply_err(req, EIO);
@@ -2152,7 +2152,7 @@ void mo2_write(fuse_req_t req, fuse_ino_t ino, const char* buf, size_t size,
// mo2_open — without it, repeated WritePrivateProfileString calls on the
// same INI file each read the old mod-file content and only the last
// write survives.
- fuse_lowlevel_notify_inval_inode(fuse_req_session(req), ino, 0, 0);
+ fuse_lowlevel_notify_inval_inode(ctx->session, ino, 0, 0);
} catch (...) {
fuse_reply_err(req, EIO);
return;
diff --git a/src/src/vfs/mo2filesystem.h b/src/src/vfs/mo2filesystem.h
index f8d5330..e717825 100644
--- a/src/src/vfs/mo2filesystem.h
+++ b/src/src/vfs/mo2filesystem.h
@@ -173,6 +173,10 @@ struct Mo2FsContext
uid_t uid = 0;
gid_t gid = 0;
+ // Set once after fuse_session_new(); used by notify_inval_inode calls to
+ // flush stale kernel page cache without needing fuse_req_session(req).
+ struct fuse_session* session = nullptr;
+
};
void mo2_init(void* userdata, struct fuse_conn_info* conn);