]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
lxcfs: explicitly enable direct_IO for libfuse3
authorAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Fri, 16 Dec 2022 15:22:35 +0000 (16:22 +0100)
committerAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Fri, 16 Dec 2022 15:22:35 +0000 (16:22 +0100)
It was discovered that with libfuse3 we lost FOPEN_DIRECT_IO flag
on (struct fuse_file)->open_flags. I'm sure that this is the reason
for all the strange bugs that our users met recently.

Fixes:
https://github.com/lxc/lxcfs/issues/565
https://discuss.linuxcontainers.org/t/number-of-cpus-reported-by-proc-stat-fluctuates-causing-issues/15780/14

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
src/lxcfs.c

index fed896c965835ae14c4dc1219aff6b3297035cf0..5c0f70d17d992d5c99c7d3b628a79dad0462f5ea 100644 (file)
@@ -1030,6 +1030,10 @@ static void *lxcfs_init(struct fuse_conn_info *conn)
        if (lxcfs_init_library() < 0)
                return NULL;
 
+#if HAVE_FUSE3
+       cfg->direct_io = 1;
+#endif
+
        return fuse_get_context()->private_data;
 }