Re: The next ramfs bug ...

From: wollny (wollny@cns.mpg.de)
Date: Fri Jun 16 2000 - 13:15:14 EST


Hi Alexander,

your patch worked after changing ->flags to ->fs_flags.
Here comes the changed patch.

Best wishes

Gert

diff -ruN linux-ac19/fs/ramfs/inode.c linux-test/fs/ramfs/inode.c
--- linux-ac19/fs/ramfs/inode.c Tue Jun 13 22:31:21 2000
+++ linux-test/fs/ramfs/inode.c Fri Jun 16 16:22:29 2000
@@ -298,14 +300,7 @@
         rename: ramfs_rename,
 };
 
-static void ramfs_put_super(struct super_block *sb)
-{
- d_genocide(sb->s_root);
- shrink_dcache_parent(sb->s_root);
-}
-
 static struct super_operations ramfs_ops = {
- put_super: ramfs_put_super,
         statfs: ramfs_statfs,
 };
 
@@ -331,7 +326,7 @@
         return sb;
 }
 
-static DECLARE_FSTYPE(ramfs_fs_type, "ramfs", ramfs_read_super, 0);
+static DECLARE_FSTYPE(ramfs_fs_type, "ramfs", ramfs_read_super,FS_LITTER);
 
 static int __init init_ramfs_fs(void)
 {
diff -ruN linux-ac19/fs/super.c linux-test/fs/super.c
--- linux-ac19/fs/super.c Fri Jun 16 16:27:05 2000
+++ linux-test/fs/super.c Fri Jun 16 16:42:29 2000
@@ -824,8 +824,14 @@
 {
         struct block_device *bdev;
         kdev_t dev;
- dput(sb->s_root);
+ struct dentry *root = sb->s_root;
         sb->s_root = NULL;
+ /* Need to clean after the sucker */
+ if (sb->s_type->fs_flags & FS_LITTER)
+ d_genocide(root);
+ if (sb->s_type->fs_flags & (FS_SINGLE|FS_LITTER))
+ shrink_dcache_parent(root);
+ dput(root);
         lock_super(sb);
         if (sb->s_op) {
                 if (sb->s_op->write_super && sb->s_dirt)
diff -urN linux-2.4.0-test1-ac19/include/linux/fs.h
linux-2.4.0-test1-ac19-fix/include/linux/fs.h
--- linux-2.4.0-test1-ac19/include/linux/fs.h Thu Jun 15 23:49:22 2000
+++ linux-2.4.0-test1-ac19-fix/include/linux/fs.h Thu Jun 15 23:37:20
2000
@@ -89,6 +89,7 @@
                            * kernel-wide vfsmnt is kept in ->kern_mnt.
                            */
 #define FS_NOMOUNT 16 /* Never mount from userland */
+#define FS_LITTER 32 /* Keeps the tree in dcache */
 /*
  * These are the fs-independent mount-flags: up to 16 flags are supported
  */

diff -urN linux-2.4.0-test1-ac19/kernel/ksyms.c
linux-2.4.0-test1-ac19-fix/kernel/ksyms.c
--- linux-2.4.0-test1-ac19/kernel/ksyms.c Thu Jun 15 23:49:23 2000
+++ linux-2.4.0-test1-ac19-fix/kernel/ksyms.c Thu Jun 15 23:44:29 2000
@@ -217,7 +217,6 @@
 EXPORT_SYMBOL(locks_mandatory_area);
 EXPORT_SYMBOL(dput);
 EXPORT_SYMBOL(have_submounts);
-EXPORT_SYMBOL(d_genocide);
 EXPORT_SYMBOL(d_find_alias);
 EXPORT_SYMBOL(d_prune_aliases);
 EXPORT_SYMBOL(prune_dcache);

--
Please CC me when posting to linux-kerrnl

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



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:12 EST