Comments (13)
This also affects yarn which reads /proc/self/stat
from bindfs.
It seems that bindfs does not understand that stat
is not an empty folder, but rather just exposes a 0-byte file instead.
from bindfs.
SSHFS supports this with -o direct_io
, but bindfs doesn't seem to support this: fuse: unknown option(s):
-o direct_io`
from bindfs.
ptfs works, but it is linked against fuse2. However, --forward-odirect
doesn't seem to do anything.
from bindfs.
You have to set int direct_io;
then fi->direct_io=1;
from bindfs.
Thanks! I'll try to find time to take a proper look and add -o direct_io
soon.
from bindfs.
Here's something I have that works:
diff --git a/src/bindfs.c b/src/bindfs.c
index bc24154..1329ada 100644
--- a/src/bindfs.c
+++ b/src/bindfs.c
@@ -203,6 +203,8 @@ static struct Settings {
#ifdef __linux__
int forward_odirect;
size_t odirect_alignment;
+
+ int direct_io;
#endif
uid_t uid_offset;
@@ -689,6 +691,10 @@ static void *bindfs_init()
cfg->entry_timeout = 0;
cfg->attr_timeout = 0;
cfg->negative_timeout = 0;
+
+ if (settings.direct_io)
+ cfg->direct_io=1;
+
#endif
assert(settings.permchain != NULL);
@@ -706,7 +712,7 @@ static void *bindfs_init()
bindfs_init_failed = true;
fuse_exit(fuse_get_context()->fuse);
}
-
+
return NULL;
}
@@ -1252,6 +1258,7 @@ static int bindfs_create(const char *path, mode_t mode, struct fuse_file_info *f
if (!settings.forward_odirect) {
flags &= ~O_DIRECT;
}
+
#endif
fd = open(real_path, flags, mode & 0777);
@@ -1282,6 +1289,7 @@ static int bindfs_open(const char *path, struct fuse_file_info *fi)
if (!settings.forward_odirect) {
flags &= ~O_DIRECT;
}
+
#endif
fd = open(real_path, flags);
@@ -1790,7 +1798,8 @@ enum OptionKey {
OPTKEY_ENABLE_IOCTL,
OPTKEY_HIDE_HARD_LINKS,
OPTKEY_RESOLVE_SYMLINKS,
- OPTKEY_BLOCK_DEVICES_AS_FILES
+ OPTKEY_BLOCK_DEVICES_AS_FILES,
+ OPTKEY_DIRECT_IO
};
static int process_option(void *data, const char *arg, int key,
@@ -1898,7 +1907,9 @@ static int process_option(void *data, const char *arg, int key,
case OPTKEY_BLOCK_DEVICES_AS_FILES:
settings.block_devices_as_files = 1;
return 0;
-
+ case OPTKEY_DIRECT_IO:
+ settings.direct_io=1;
+ return 0;
case OPTKEY_NONOPTION:
if (!settings.mntsrc) {
if (strncmp(arg, "/proc/", strlen("/proc/")) == 0) {
@@ -2388,6 +2399,7 @@ int main(int argc, char *argv[])
OPT2("--delete-deny", "delete-deny", OPTKEY_DELETE_DENY),
OPT2("--rename-deny", "rename-deny", OPTKEY_RENAME_DENY),
+ OPT2("--direct_io","direct_io",OPTKEY_DIRECT_IO),
OPT2("--hide-hard-links", "hide-hard-links", OPTKEY_HIDE_HARD_LINKS),
OPT2("--resolve-symlinks", "resolve-symlinks", OPTKEY_RESOLVE_SYMLINKS),
@@ -2455,6 +2467,8 @@ int main(int argc, char *argv[])
#ifdef __linux__
settings.forward_odirect = 0;
settings.odirect_alignment = 0;
+
+ settings.direct_io = 0;
#endif
atexit(&atexit_func);
from bindfs.
Another, more serious issue: bindfs modifies /proc/self/exe
such that it points to /usr/bin/bindfs
, instead of whatever binary is accessing it.
from bindfs.
Thanks, for the patch! Applied with minor modifications and --direct_io
-> --direct-io
for consistency.
/proc/self
works that way because it's the bindfs process that's reading the underlying proc
. It'd need to be special-cased.
from bindfs.
^ actually, opted to make direct_io the default.
from bindfs.
Actually, you should not make this the default --- it will break mmap calls.
from bindfs.
As a note, a maintainer on FUSE does plan on working on making direct_io work with mmap -- rpodgorny/unionfs-fuse#117 (comment).
from bindfs.
Good to know, thanks!
from bindfs.
Related Issues (20)
- Failed to resolve mount point on MacOS / Ventura HOT 3
- [Question/Bug maybe?] preserve/mirror file's selinux context HOT 2
- bindfs file descriptor leak with --block-devices-as-files HOT 2
- Behavior Question: Why does BindFS exhibit permission issues when bind mounted into a container? HOT 2
- Mount directory as a non-root user from /etc/fstab HOT 3
- no package Bindfs available HOT 3
- Support for 64bit statfs on macOS HOT 1
- Race condition between `bindfs` exit and filesystem actually being mounted HOT 5
- Unable to listen to unix domain socket inside bindfs mount on macOS HOT 8
- Test suite fails with fuse-t HOT 1
- ACLs on MacOS HOT 3
- configure: error: FUSE not found on Mac 13.5.1 HOT 5
- homebrew: Unsatisfied requirements failed this build. HOT 2
- macos: Provide Launch Agent to mount bindfs on system startup HOT 4
- Support for negative offset (?) HOT 3
- [1.17.5] Commit 38cd6e7e13ce966dc8e196eb3037935682e613a6 introduced undefined behavior? HOT 3
- Contributing simple Linux CI based on GitHub Actions via pull request welcome? HOT 17
- 1.17.6 no longer compiles on CentOS 7 HOT 1
- Memory allocation failures not checked
- Don't know how to build a static `bindfs` executable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bindfs.