Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--non-recursive #114

Open
sshilovsky opened this issue Jun 22, 2022 · 3 comments
Open

--non-recursive #114

sshilovsky opened this issue Jun 22, 2022 · 3 comments
Labels
feature New feature request/PR

Comments

@sshilovsky
Copy link
Contributor

As of now, bindfs behaves like --rbind. It would be useful to be able to opt-out from this behavior.

Ideally, it should've probably been the default, but it's not possible to change it without breaking compatibility, or is it? There are options like -o bind and -o rbind, which might be of use here, although I'm not sure how, if at all possible.

@mpartel mpartel added the feature New feature request/PR label Jun 23, 2022
@mpartel
Copy link
Owner

mpartel commented Jun 23, 2022

Bindfs could fairly easily be made to show directories that have a submount on them as empty, but if we want bindfs to show what's "underneath" a submount, then I don't know of a userspace API for that.

I guess bindfs could mount --bind to some internal place and view that instead of the original, but that would require root, and I think I'd rather avoid the complexity and error-proneness that would bring. I think this requirement is rare, and the user can do this manually too.

I'm curious, could you tell me more about your use-case?

@sshilovsky
Copy link
Contributor Author

I want it just to avoid occasional rm -rf to dive into another filesystem (been there)

With the possible behavior you're describing, --non-recursive makes less sense, maybe it's better to call the option --one-file-system, like with rm.

@ruihe774
Copy link

then I don't know of a userspace API for that.

There is RESOLVE_NO_XDEV in openat2. I think it can be used to implement such feature, though it seems to be Linux-specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request/PR
Projects
None yet
Development

No branches or pull requests

3 participants