Giter Site home page Giter Site logo

support overmount about rewritefs HOT 6 CLOSED

bAndie91 avatar bAndie91 commented on September 18, 2024
support overmount

from rewritefs.

Comments (6)

sloonz avatar sloonz commented on September 18, 2024

I have a (mostly untested) implementation in the at branch, would you mind testing it a bit on your end ?

from rewritefs.

bAndie91 avatar bAndie91 commented on September 18, 2024

hi sloonz, I also developed this feature a while ago - sorry i have not uploaded it earlier. see my branch @development/overmount. I and my family is using this version for 3 months to accelerate web browser (Vivaldi), ~/.config/vivaldi is overmounted on itself and sqlite journal files are redirected to memory fs. I have not noticed any glitch: no mem-leak, no hanging syscalls.

There are more changes on my branch, but the one in this scope is commit 12c12c3.
My approach operates not with openat() family functions, but (1) chdir to orig_fs and (2) access files by relative path. Because the programm does not chdir elsewhere, the cwd serves like orig_fd in your code. I'm not sure which is the better. Yours is more explicite. Mine saves a few calls in rewrite_opendir, rewrite_truncate, rewrite_statfs (poorly we dont have opendirat() in std lib).

I also removed the constraint which prohibits config file to be under orig_fs (recursion loop is avoided by the relative-path feature).

from rewritefs.

bAndie91 avatar bAndie91 commented on September 18, 2024

rewrite_chown():

fchownat() with flags=0 dereferences synlinks, howerver the replaced lchown() does not.
I suggest AT_SYMLINK_NOFOLLOW.

the same for rewrite_setxattr() and rewrite_getxattr() and rewrite_listxattr() and rewrite_removexattr():

suggest openat(..., O_RDONLY | O_NOFOLLOW) to operate on symlinks like lsetxattr() (and lgetxattr() and llistxattr() and lremovexattr()) did.

from rewritefs.

sloonz avatar sloonz commented on September 18, 2024

Good catch on chown/chmod

For *xattr unfortunately there's no way to do that AFAIK. O_NOFOLLOW on openat does not do what you think, it just returns an error if the target is a symlink.

Your chdir approach can't work with FUSE 3 : libfuse chdir into / at the end of the initialization process.

Iā€™m going to merge autocreate/at*/abmalloc into develop, do some more polishing today, and let it run on my machine for a few days (maybe weeks) before merging into master again.

from rewritefs.

bAndie91 avatar bAndie91 commented on September 18, 2024

hi @sloonz

  1. afaik chmod is not affected as there is no lchmod

  2. regarding to *xattr, IMO it should be disallowed on symlinks in order to preserve semantics. (eg. let's do O_NOFOLLOW and return error if it fails)

  3. chdir-approach

    1. what do you think, does it worth to workaround fuse3 limitation, so do chdir on the first actual call to rewritefs instead to before libfuse initialization? rece condition may be avoided by saving cwd before libfuse and fchdir into it later.

    2. my chdir-approach indeed works only in foreground mode

  4. note, auto_mkdir feature (239d802) is not thought through well by me; i committed it to the overmount branch only by lazyness; I'm not fully sure is it a good idea or is it implemented well.

thanks for consideration

from rewritefs.

sloonz avatar sloonz commented on September 18, 2024

Merged in master

from rewritefs.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.