Re: Syscall table AKA hijacking syscalls

From: Libor Vanek
Date: Fri Jan 02 2004 - 12:02:04 EST



I'm working on my diploma thesis which is adding snapshot capability into Linux VFS (so you can do directory based snapshots - not complete device, like in LVM). It'll consist of two separete modules:
Snapshot module:
- will hijack (one or another way) calls to open/move/unlink/mkdir/etc. syscall
- when will detect change to selected directory (which I want to snapshot), it'll copy/move old file/directory to some temporary (selected when creating snapshot) - in fact - copy on write behaviour

This should be implemented as a stackable filesystem..
Does this filesystem stack work with multiple mount points?

I think that stackable filesystem is useless for this. See this:
- I have some BIG (>> 1 TB) filesystem (XFS/ext3/JFS whatever!!!) mounted in /BIG
- I call something like snapshot --what=/BIG/data --where=/OTHER_FS/snap1
- from now whenever I delete/create/modify file/dir in /BIG/data then BEFORE the action the original file/dir should be copyied/moved to
/OTHER_FS/snap1

There is no place where can I use stackable filesystem because I'd need to use it on the very beginning of mounting /BIG so instead:
mount /dev/md0 /BIG -t xfs
I'd need to do something like:
mount /dev/md0 /BIG -t snapfs -o fstype=xfs
Which is something I'm trying to avoid as much as possible for many reasons.


My guess is that the filesystem change notification would be a better
solution, either in userspace or in kernelspace, doesn't matter. But
that is far from finished or even generally accepted.

This is also something (but just a bit) different - I don't need "change notification" but "pre-change notification" ;)

For the diploma thesis, feel free to use any hack you like, including
hijacking syscalls. But remember that it is a hack and nothing else,
only helping you to remain on schedule and focus more on the real
subject. And don't plan on kernel acceptance either, as you will fail
either that or the thesis and I'd choose the thesis.

You're absolutely right but when I'm going to spent several weeks on something like this I'd like to do something usefull - not something which will be trashed after exam. So I'm trying to find out some "politically correct" way.

Right now I'll code it with the very nasty "find sys_call_table" hack just I can test it without rebooting my machine (attempts to get 2.6.0 running under UML or VMWare failed :-((() and when I'll release some 0.0.1 version and get some good respondce I'll code it as the VFS patch & module.


--

Libor Vanek

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/