Re: Virtual files

2000-07-24 Thread Pavel Machek

Hi!

 I've been looking at the possibility of cleanly implementing virtual
 files (podfuk/avfs style) with the multiple mount thing in 2.4
 kernels. Here is how it would work:
 
 1) There needs to be a global lookup hook in VFS. If a real lookup
 fails, the global lookup is invoked. The cached lookup path is not
 effected.
 
 2) The global lookup checks whether the name refers to a virtual file
 (contains the magic char  exists in /overlay). If it does, then the
 file/dir from overlay is mounted on top of the negative dentry. The
 dentry is not filled in, so the virtual file remains invisible.
 
 For 1) the VFS needs to be modified, but with infinitesimal
 performance effect. For 2) a kernel module could be used.

Great!

 I've prepared a kernel patch against 2.4.0-test4 (just for comments on
 this, NOT for inclusion in the main kernel), and a kernel module. I've
 tested it with avfs, but it should also work for podfuk.

It looks much cleaner than my previous approaches. There seems to be
something strange with usage counts:

pavel@bug:/tmp/cz1_mbrola.tgz#utar$ ls -al
total 88
drwxr-xr-x   2 pavelusers3586 Mar 26 18:43 ./
drwxrwxrwt  38 root root81920 Jul 24 09:57 ../
drwxr-xr-x 42949 pavelusers   0 Mar 25 11:16 czech/
pavel@bug:/tmp/cz1_mbrola.tgz#utar$

 Problems:
 
  - The filesystem will be littered with these loopback mounts. This
should be cleared upon unmount, and possibly when the dcache is
shrunk. There was a similar requirement for new autofs IIRC.
 
  - Creation/removal of virtual files are not handled by this code.
 
 Comments?

Yes. You seem to have damaged locking:

 @@ -281,12 +285,18 @@
   lock_kernel();
   result = dir-i_op-lookup(dir, dentry);
   unlock_kernel();
 - if (result)
 + if (result) {
   dput(dentry);
 - else
 +up(dir-i_sem);
 +}
 + else {
 + up(dir-i_sem);
   result = dentry;
 + /* for avfs */
 + if (!dentry-d_inode  lookup_global)
 + lookup_global(nd, dentry);
 + }
   }
 - up(dir-i_sem);

In case of !dentry, up(dir-i_sem) is not executed at all.

I have some cleanups to nredir.c module, they are attached (please
apply). Ouch, and there's slight problem with caching:

You access vmlinux#gz, then load nredir module, then access vmlinux#gz
again. But failure is already cached and you are out of luck :-(.

Pavel
-- 
I'm [EMAIL PROTECTED] "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at [EMAIL PROTECTED]


--- /tmp/nredir.c   Mon Jul 24 10:03:48 2000
+++ nredir.cMon Jul 24 09:53:05 2000
@@ -1,4 +1,5 @@
 #include linux/module.h
+#include linux/init.h
 #include linux/kernel.h
 #include linux/fs.h
 #include linux/slab.h
@@ -7,7 +8,7 @@
 
 #define NREDIR_VERSION "0.1"
 
-#define AVFS_MAGIC_CHAR '@'
+#define AVFS_MAGIC_CHAR '#'
 #define OVERLAY_DIR "/overlay"
 #define OVERLAY_DIR_LEN 8
 
@@ -99,7 +100,7 @@
 return dentry;
 }
 
-int init_module(void)
+static int __init init_nredir(void)
 {
 printk(KERN_INFO "nredir init (version %s)\n", NREDIR_VERSION);
 
@@ -111,11 +112,14 @@
 }
 
 
-void cleanup_module(void)
+static void __exit cleanup_nredir(void)
 {
 printk(KERN_INFO "nredir cleanup\n");
 
-lookup_global = 0;
+lookup_global = NULL;
 
 printk("lookup_global: %x\n", (int) lookup_global);
 }
+
+module_init(init_nredir);
+module_exit(cleanup_nredir);



Re: (reiserfs) Re: any chance we could dump the 64k subdirectory limit before 2.4 ships?

2000-06-01 Thread Pavel Machek

Hi!

 +-
 | Well, find might get pretty confused, too.
 +---8
 
 So run with -noleaf, or compile it with -noleaf as the default.  Those of 
 us who use AFS are used to that anyway.

Notice: they want that to go into 2.4.X. Recompiling all distros all
there is *not* option. But returning nlink==1 is option, and I like
it. (You should not need -noleaf if AFS returns nlink==1 correctly...)
Pavel
-- 
The best software in life is free (not shareware)!  Pavel
GCM d? s-: !g p?:+ au- a--@ w+ v- C++@ UL+++ L++ N++ E++ W--- M- Y- R+



Re: Object Based Storage and File System Snapshots: alpha release

1999-12-25 Thread Pavel Machek

Hi!

 expect to release more modules in the future, but at this time an
 experimental driver is included that can make snapshots (read only
 clones) of Ext2 file systems.  There is a utility that can delete

Take a look at swsusp patches. With your
snapshotting-filesystem-possibility, it should be possible to have
"global undo".

I.e. at 21:30 I do system snapshot. At 21:50 I delete my dev which
makes me unhappy. At 21:51 I issue undo which brings 21:30 state EVEN
WITH RUNNING PROCESSES back.

(Imagine: running complicated game that does not allow you to save
game. And what? You just snapshot full system :-).

I did not look at your code, but it looks sexy.
Pavel
-- 
I'm [EMAIL PROTECTED] "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents me at [EMAIL PROTECTED]



Re: Oops with ext3 journaling

1999-12-07 Thread Pavel Machek

Hi!

 No, and I'm pretty much convinced now that I'll move to having a
 private, hidden inode for the journal in the future.

Please don't do that. Current way of switching ext2/ext3 is very
nice. If someone wants to shoot in their foot...
Pavel
-- 
I'm really [EMAIL PROTECTED] Look at http://195.113.31.123/~pavel.  Pavel
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!