sloonz / rewritefs Goto Github PK
View Code? Open in Web Editor NEWA FUSE filesystem intended to be used like Apache mod_rewrite
License: GNU General Public License v2.0
A FUSE filesystem intended to be used like Apache mod_rewrite
License: GNU General Public License v2.0
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.
cheers.
I'm contemplating using rewritefs, but just can't make up my mind because the documentation doesn't tell what performance overhead to expect.
Could you please consider adding this ?
Thanks !
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.
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
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.
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.
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.
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?
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:
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.
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.
➜ ~ 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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.