Giter Site home page Giter Site logo

rewritefs's People

Contributors

eigengrau avatar sloonz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rewritefs's Issues

memory management

Hi, I noticed some unhandled malloc.
please see my patch, in which all malloc() are replaced to abmalloc() which simply aborts on memory errors, just like how it is now in most of the places.

bAndie91@354a62d

cheers.

[FEATURE REQUEST] Multiple rewritten paths per rule

It would be useful to have an option to specify multiple rewritten paths and e.g. try to stat() them before returning "no such file", just like nginx does with try_files rule.

The use case is to lookup for file at location1/somefile if exists/mounted/accessible and otherwise lookup the same file at location2/somefile, and so on, whatever amount of locations the user specified.

This behavior may be simply skipped if there is only one rewritten path specified, to not affect existing performance for people who doesn't need it.

SIGSEGV

Hi,
I am getting SIGSEGV, with running:
rewritefs -o config=/home/knezi/config/rewritefs /mnt/home /home/
My config:

m#^(?!\.)# .
m#^\.(cache|config|local)# .
m#^\.# .config/

I am not sure how to provide more debugging, I am running Arch,

$ uname -a
Linux holly 4.1.6-1-ARCH #1 SMP PREEMPT Mon Aug 17 08:52:28 CEST 2015 x86_64 GNU/Linux

rewritefs does not work [with default configs].

Latest git code.

% ./rewritefs -c config.example ~/ ~/tmp/rewritefs

% ls -la ~/tmp/rewritefs |grep '.ssh'

(...)

ls: cannot access /home/slashbeast/tmp/rewritefs/.viminfo: No such file or directory
ls: cannot access /home/slashbeast/tmp/rewritefs/.rtorrent.rc: No such file or directory
d????????? ? ? ? ? ? .ssh/

Any idea what is wrong? I googled around and I saw bugreport on arch's board without solution.

ulockmgr not available in fuse3

Rewritefs can't be built with fuse3 only because it needs ulockmgr.h, which has been removed from fuse.
This library is supposedly distributed separately, but I can't find in any package besides fuse2: so the README should probably mention that fuse2 is still needed.

Issue regarding OFD locking

When opening a qemu image under rewritefs, the file lock set by qemu apparently gets stuck.
Launching qemu a second time results in this error:

qemu-system-x86_64: -drive file=disk.qcow2: Failed to get "write" lock
Is another process using the image [disk.qcow2]?

Qemu seems to be using OFD locks via the fcntl system call. These are traces of the command
qemu-kvm -drive file=disk.qcow2 running under the plain ext4 fs and rewritefs, obtained via strace:

ext4:

fcntl(10<disk.qcow2>, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
fcntl(10<disk.qcow2>, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=101, l_len=1}) = 0
fcntl(10<disk.qcow2>, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=103, l_len=1}) = 0
fcntl(10<disk.qcow2>, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=201, l_len=1}) = 0
fcntl(10<disk.qcow2>, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=203, l_len=1}) = 0
fcntl(10<disk.qcow2>, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1, l_pid=0}) = 0
fcntl(10<disk.qcow2>, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=201, l_len=1, l_pid=0}) = 0
...

rewritefs:

fcntl(10<disk.qcow2>, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=100, l_len=1}) = 0
fcntl(10<disk.qcow2>, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=101, l_len=1}) = 0
fcntl(10<disk.qcow2>, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=103, l_len=1}) = 0
fcntl(10<disk.qcow2>, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=201, l_len=1}) = 0
fcntl(10<disk.qcow2>, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=203, l_len=1}) = 0
fcntl(10<disk.qcow2>, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=200, l_len=1, l_pid=0}) = 0
fcntl(10<disk.qcow2>, F_OFD_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=201, l_len=1, l_pid=-1}) = 0
...

The first difference appears in the last line, where the result indicates there is an OFD read lock at
byte 201 with rewritefs, while with ext4 there are no matching locks.

/g flag

I would like to use rewritefs to write to a FAT file system.

I'm making a pattern to replace all FAT invalid characters with _.

Issue:

$ echo '/:/ _' > /mnt/home/me/.config/rewritefs
$ mount.fuse rewritefs#/mnt/home/me /home/me -o config=/mnt/home/me/.config/rewritefs,allow_other
$ touch /home/me/foo:
$ ls -l /home/me
total 0
-rw-r--r-- 1 me me 0 Jan 10 12:25 foo_
$ touch /home/me/foo::
$ ls -l /home/me
ls: cannot access '/home/me/foo_:': No such file or directory
total 0
-rw-r--r-- 1 me me 0 Jan 10 12:25 foo_
-????????? ? ?       ?       ?            ? foo_:

What do you think about the idea to introduce a /g flag?

support overmount

i'd like use rewritefs by mounting over a directory to itself, eg:

rewritefs -o config=... ~/dir1 ~/dir1

because software writing to ~/dir1 can not be configured to write temporary files elsewhere and the temp files cause heavy IO, but normal files are fine there. and i'd rather don't move underlaying directory's contents, to prevent any software working on normal files from break even if the dir does not get mounted somewhy.

it requires:

  • keep file descriptor of the underlying directory open
  • and perform underlying fs operations using openat/linkat/fstatat(2) function family taking the saved fd
  • allow rewritten path to be out of the source directory

Stuck on .ICEauthority

When rewritefs is mounted, I cannot log into GNOME because .ICEauthority cannot be accessed. As soon as I umount rewritefs, I can log in because .ICEauthority is then created automatically (as it can be accessed now).

How did you avoid this on your system? Please, I urgently need help with this issue. Thank you.

Documentation: a small problem

Hello

You have

This simple example show how to achieve the same effect than libetc:

That does not make much sense. Do you mean the following?

This simple example shows you how to achieve the same effect as libetc achieves

i.e. (to use what seems to me a formulation that is better yet):

The following example demonstrates how one can get the program to do what libetc does.

Also, the reader might wonder what that same effect actually is.

New files are created owned by root

➜  ~  l -d .*                            
drwx------  3 zcarterc zcarterc 4096 Oct  6 07:58 .cache
drwx------ 45 zcarterc zcarterc 4096 Oct  6 08:00 .config
drwxr-xr-x  3 zcarterc zcarterc 4096 Oct  6 07:59 .local
➜  ~  touch .local/foo .config/foo .cache/foo 
touch: cannot touch ‘.local/foo’: Permission denied
touch: cannot touch ‘.config/foo’: Permission denied
touch: cannot touch ‘.cache/foo’: Permission denied
➜  ~  l .local/foo .config/foo .cache/foo     
-rw-r--r-- 1 root root 0 Oct  6 07:58 .cache/foo
-rw-r--r-- 1 root root 0 Oct  6 07:59 .config/foo
-rw-r--r-- 1 root root 0 Oct  6 07:59 .local/foo

Mounted with: mount rewritefs#/home/zcarter -o config=/home/zcarter/.config/rewritefs,allow_other,default_permissions /home/zcarterc

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.