Patch for Ubuntu / OpenSuse11.1

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Patch for Ubuntu / OpenSuse11.1

Lino Sanfilippo


Geschäftsführender Gesellschafter: Tjark Auerbach
Sitz der Gesellschaft: Tettnang
Handelsregister: Amtsgericht Ulm, HRB 630992
ALLGEMEINE GESCHÄFTSBEDINGUNGEN
Es gelten unsere Allgemeinen Geschäftsbedingungen
(AGB). Sie finden sie in der jeweils gültigen Fassung
im Internet unter http://www.avira.de/agb
***************************************************
diff -x CVS -rup dazukofs-3.0.0/CHANGELOG dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/CHANGELOG
--- dazukofs-3.0.0/CHANGELOG 2009-02-22 17:51:22.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/CHANGELOG 2009-02-19 17:37:14.000000000 +0100
@@ -2,11 +2,6 @@
  DazukoFS CHANGELOG
 ====================
 
-3.0.0 (2009-02-22)
-- added define for version number output
-- added patches for various other kernels
-
-
 3.0.0-rc4 (2008-11-30)
 - fix incorrect dentry/vfsmnt referencing when access denied
 - fix improper cleanup in several error handling conditions
diff -x CVS -rup dazukofs-3.0.0/dazukofs_fs.h dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/dazukofs_fs.h
--- dazukofs-3.0.0/dazukofs_fs.h 2009-02-22 17:43:11.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/dazukofs_fs.h 2009-07-03 17:59:55.000000000 +0200
@@ -3,7 +3,7 @@
    Copyright (C) 1997-2004 Erez Zadok
    Copyright (C) 2001-2004 Stony Brook University
    Copyright (C) 2004-2007 International Business Machines Corp.
-   Copyright (C) 2008-2009 John Ogness
+   Copyright (C) 2008 John Ogness
      Author: John Ogness <[hidden email]>
 
    This program is free software; you can redistribute it and/or
@@ -24,8 +24,6 @@
 #ifndef __DAZUKOFS_FS_H
 #define __DAZUKOFS_FS_H
 
-#define DAZUKOFS_VERSION "3.0.0"
-
 extern struct kmem_cache *dazukofs_dentry_info_cachep;
 extern struct kmem_cache *dazukofs_file_info_cachep;
 extern struct file_operations dazukofs_main_fops;
diff -x CVS -rup dazukofs-3.0.0/event.c dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/event.c
--- dazukofs-3.0.0/event.c 2009-02-22 17:44:03.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/event.c 2009-07-03 18:54:22.000000000 +0200
@@ -23,7 +23,6 @@
 #include <linux/file.h>
 #include <linux/fs.h>
 #include <linux/mount.h>
-#include <linux/freezer.h>
 
 #include "dev.h"
 #include "dazukofs_fs.h"
@@ -162,16 +161,24 @@ static int capture_group_count(int *cach
  return err;
 }
 
-static int get_group_count(void)
+static int get_group_count_interruptible(void)
 {
  int cache = 0;
- int ret = wait_event_freezable(__group_count_queue,
-       capture_group_count(&cache) == 0);
+ int ret = wait_event_interruptible(__group_count_queue,
+           capture_group_count(&cache) == 0);
  if (ret == 0)
  ret = __group_count;
  return ret;
 }
 
+static int get_group_count(void)
+{
+ int cache = 0;
+ wait_event(__group_count_queue, capture_group_count(&cache) == 0);
+ return __group_count;
+}
+
+
 static void put_group_count(void)
 {
  mutex_lock(&group_count_mutex);
@@ -399,7 +406,7 @@ int dazukofs_add_group(const char *name,
  int already_exists;
  int available_id = 0;
  struct dazukofs_group *grp;
- int grp_count = get_group_count();
+ int grp_count = get_group_count_interruptible();
 
  if (grp_count < 0) {
  ret = grp_count;
@@ -447,7 +454,7 @@ int dazukofs_remove_group(const char *na
  int ret = 0;
  struct dazukofs_group *grp;
  struct list_head *pos;
- int grp_count = get_group_count();
+ int grp_count = get_group_count_interruptible();
 
  if (grp_count < 0) {
  ret = grp_count;
@@ -701,11 +708,10 @@ int dazukofs_check_access(struct dentry
 {
  struct dazukofs_event_container *ec_array[GROUP_COUNT];
  struct dazukofs_event *evt;
- int grp_count = get_group_count();
- int err;
+ int grp_count;
+ int err = 0;
 
- if (grp_count < 0)
- return grp_count;
+ grp_count = get_group_count();
 
  if (check_access_precheck(grp_count)) {
  put_group_count();
@@ -713,32 +719,29 @@ int dazukofs_check_access(struct dentry
  }
 
  /* at this point, the access should be handled */
-
  if (allocate_event_and_containers(&evt, ec_array, grp_count)) {
  put_group_count();
- err = -ENOMEM;
- goto out;
+ return -ENOMEM;
  }
-
  evt->dentry = dget(dentry);
  evt->mnt = mntget(mnt);
  evt->pid = current->pid;
-
  assign_event_to_groups(evt, ec_array);
 
  put_group_count();
 
- /* wait until event completely processed or signal */
- err = wait_event_freezable(evt->queue, event_assigned(evt) == 0);
+ /* wait until event completely processed */
+ wait_event(evt->queue, event_assigned(evt) == 0);
 
  if (evt->deny)
  err = -EPERM;
 
  release_event(evt, 0, 0);
-out:
+
  return err;
 }
 
+
 int dazukofs_group_open_tracking(unsigned long group_id)
 {
  struct dazukofs_group *grp;
@@ -928,7 +931,8 @@ static int open_file(struct dazukofs_eve
  /* add myself to be ignored on file open (to avoid recursion) */
  mask_proc(&proc);
 
- ec->file = dentry_open(dget(evt->dentry), mntget(evt->mnt), O_RDONLY);
+ ec->file = dentry_open(dget(evt->dentry), mntget(evt->mnt),
+       O_RDONLY | O_LARGEFILE);
  if (IS_ERR(ec->file)) {
  check_recursion();  /* remove myself from proc_list */
  ret = PTR_ERR(ec->file);
@@ -1004,9 +1008,9 @@ int dazukofs_get_event(unsigned long gro
  }
 
  while (1) {
- ret = wait_event_freezable(grp->queue,
-   is_event_available(grp) ||
-   grp->deprecated);
+ ret = wait_event_interruptible(grp->queue,
+       is_event_available(grp) ||
+       grp->deprecated);
  if (ret != 0)
  break;
 
diff -x CVS -rup dazukofs-3.0.0/file.c dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/file.c
--- dazukofs-3.0.0/file.c 2009-02-22 17:43:11.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/file.c 2009-07-03 18:48:08.000000000 +0200
@@ -177,10 +177,11 @@ static int dazukofs_open(struct inode *i
  struct file *lower_file;
  int err;
 
- err = dazukofs_check_access(file->f_dentry, file->f_vfsmnt);
- if (err)
- goto error_out1;
-
+ if (S_ISREG(inode->i_mode)) {
+ err = dazukofs_check_access(file->f_dentry, file->f_vfsmnt);
+ if (err)
+ goto error_out1;
+ }
  SET_FILE_INFO(file, kmem_cache_zalloc(dazukofs_file_info_cachep,
       GFP_KERNEL));
  if (!GET_FILE_INFO(file)) {
@@ -272,10 +273,24 @@ out:
  return err;
 }
 
+static int dazukofs_mmap (struct file *file, struct vm_area_struct *vm)
+{
+
+ struct file *lower_file = GET_LOWER_FILE(file);
+
+ /* if lower fs does not support mmap(), we dont call generic_file_readonly_mmap(),
+ * since this would result in calling lower readpage(), which might not be
+ * defined by lower fs if mmap() is not supported*/
+ if (!lower_file->f_op || !lower_file->f_op->mmap)
+ return -ENODEV;
+
+
+ return generic_file_readonly_mmap(file, vm);
+}
+
 /**
  * Unused operations:
  *   - owner
- *   - aio_read (generic)
  *   - aio_write (generic)
  *   - poll
  *   - unlocked_ioctl
@@ -295,18 +310,15 @@ out:
 struct file_operations dazukofs_main_fops = {
  .llseek = dazukofs_llseek,
  .read = dazukofs_read,
- .aio_read = generic_file_aio_read,
  .write = dazukofs_write,
- .aio_write = generic_file_aio_write,
  .readdir = dazukofs_readdir,
  .ioctl = dazukofs_ioctl,
- .mmap = generic_file_mmap,
+ .mmap = dazukofs_mmap,
  .open = dazukofs_open,
  .flush = dazukofs_flush,
  .release = dazukofs_release,
  .fsync = dazukofs_fsync,
  .fasync = dazukofs_fasync,
- .splice_read = generic_file_splice_read,
 };
 
 /**
@@ -335,11 +347,10 @@ struct file_operations dazukofs_main_fop
 const struct file_operations dazukofs_dir_fops = {
  .readdir = dazukofs_readdir,
  .ioctl = dazukofs_ioctl,
- .mmap = generic_file_mmap,
+ .mmap = dazukofs_mmap,
  .open = dazukofs_open,
  .flush = dazukofs_flush,
  .release = dazukofs_release,
  .fsync = dazukofs_fsync,
  .fasync = dazukofs_fasync,
- .splice_read = generic_file_splice_read,
 };
diff -x CVS -rup dazukofs-3.0.0/inode.c dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/inode.c
--- dazukofs-3.0.0/inode.c 2009-02-22 17:46:02.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/inode.c 2009-07-03 18:44:10.000000000 +0200
@@ -47,87 +47,148 @@ static int dazukofs_inode_test(struct in
 
 static void dazukofs_init_inode(struct inode *inode, struct inode *lower_inode)
 {
- SET_LOWER_INODE(inode, lower_inode);
- inode->i_ino = lower_inode->i_ino;
- inode->i_version++;
- inode->i_op = &dazukofs_main_iops;
- inode->i_fop = &dazukofs_main_fops;
- inode->i_mapping->a_ops = &dazukofs_aops;
+        SET_LOWER_INODE(inode, lower_inode);
+        inode->i_ino = lower_inode->i_ino;
+        inode->i_version++;
+
+        if (S_ISDIR(lower_inode->i_mode)) {
+                inode->i_op = &dazukofs_dir_iops;
+                inode->i_fop = &dazukofs_dir_fops;
+        } else {
+                inode->i_op = &dazukofs_main_iops;
+                inode->i_fop = &dazukofs_main_fops;
+
+                if (S_ISLNK(lower_inode->i_mode))
+                        inode->i_op = &dazukofs_symlink_iops;
+                else  if (special_file(lower_inode->i_mode)) {
+                        init_special_inode(inode, lower_inode->i_mode,
+                                           lower_inode->i_rdev);
+                }
+        }
+        inode->i_mapping->a_ops = &dazukofs_aops;
 }
 
+
 static int dazukofs_inode_set(struct inode *inode, void *lower_inode)
 {
  dazukofs_init_inode(inode, (struct inode *)lower_inode);
  return 0;
 }
 
+
 int dazukofs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
-     struct super_block *sb, int flag)
+     struct super_block *sb, int hash)
 {
  struct inode *inode;
- struct inode *lower_inode = igrab(lower_dentry->d_inode);
- int err = 0;
+ struct inode *lower_inode;
+ int err;
 
- if (!lower_inode) {
- err = -ESTALE;
- goto out;
- }
+ lower_inode = igrab(lower_dentry->d_inode);
 
- if (lower_inode->i_sb != GET_LOWER_SB(sb)) {
- iput(lower_inode);
- err = -EXDEV;
- goto out;
- }
+ if (!lower_inode)
+ return -ESTALE;
 
  inode = iget5_locked(sb, (unsigned long)lower_inode,
      dazukofs_inode_test, dazukofs_inode_set,
      lower_inode);
-
  if (!inode) {
- iput(lower_inode);
  err = -EACCES;
- goto out;
+ goto err;
  }
 
- if (inode->i_state & I_NEW) {
+ if (inode->i_state & I_NEW)
  unlock_new_inode(inode);
  /*
  * This is a new node so we leave the lower_node "in use"
  * and do not call iput().
  */
- } else {
+ else
  /*
  * This is not a new node so we decrement the usage count.
  */
  iput(lower_inode);
- }
-
- if (S_ISLNK(lower_inode->i_mode))
- inode->i_op = &dazukofs_symlink_iops;
- else if (S_ISDIR(lower_inode->i_mode))
- inode->i_op = &dazukofs_dir_iops;
-
- if (S_ISDIR(lower_inode->i_mode))
- inode->i_fop = &dazukofs_dir_fops;
-
- if (special_file(lower_inode->i_mode)) {
- init_special_inode(inode, lower_inode->i_mode,
-   lower_inode->i_rdev);
- }
 
- dentry->d_op = &dazukofs_dops;
 
- if (flag)
+ if (hash)
  d_add(dentry, inode);
  else
  d_instantiate(dentry, inode);
 
  fsstack_copy_attr_all(inode, lower_inode, NULL);
  fsstack_copy_inode_size(inode, lower_inode);
-out:
+
+ return 0;
+err:
+ iput(lower_inode);
  return err;
 }
 
+
+/* creates a new lower dentry */
+static struct dentry *dazukofs_new_lower_dentry(struct qstr *name,
+ struct dentry *lower_base,
+ struct nameidata *nd)
+{
+ struct dentry *new_dentry;
+ struct dentry *tmp;
+ struct inode *lower_inode;
+
+ lower_inode = lower_base->d_inode;
+ /* XXX: is this check still necessary? (see __lookup_hash())
+   This is (hopely) protected by locked upper inode */
+ if (IS_DEADDIR(lower_inode)) {
+ new_dentry = ERR_PTR(-ENOENT);
+ goto out;
+ }
+ tmp = d_alloc(lower_base, name);
+ if (!tmp) {
+ new_dentry = ERR_PTR(-ENOMEM);
+ goto out;
+ }
+ new_dentry = lower_inode->i_op->lookup(lower_inode, tmp, nd);
+ /* lookup() seemingly is allowed to return its own dentry (which
+ * may indeed be a dentry or only an error). If so
+ * we use it and discard ours. Otherwise we use ours */
+ if (!new_dentry)
+ new_dentry = tmp;
+ else
+ dput(tmp);
+
+out:
+ return new_dentry;
+}
+
+
+/* get lower dentry for given name */
+static struct dentry *dazukofs_lookup_one_lower(struct qstr *name,
+ struct dentry *lower_base,
+ struct vfsmount *lower_mnt)
+{
+ struct dentry *result;
+ struct nameidata nd;
+ int err;
+
+ err = vfs_path_lookup(lower_base, lower_mnt, name->name, 0, &nd);
+
+ if (!err) {
+ /* inode already exists on disk */
+ result = nd.path.dentry;
+ /* we dont need the mount */
+ mntput(nd.path.mnt);
+ goto out;
+ }
+ if (err != -ENOENT) { /* this is a REAL error */
+ result = ERR_PTR(err);
+ goto out;
+ }
+ /* create a new (lower) dentry */
+ result = dazukofs_new_lower_dentry(name, lower_base, &nd);
+out:
+ return result;
+
+}
+
+
 /**
  * Description: Called when the VFS needs to look up an inode in a parent
  * directory. The name to look for is found in the dentry. This method
@@ -148,64 +209,51 @@ static struct dentry *dazukofs_lookup(st
  struct dentry *lower_dentry;
  struct dentry *lower_dentry_parent;
  struct vfsmount *lower_mnt;
- int err = 0;
-
- if ((dentry->d_name.len == 1 && !strcmp(dentry->d_name.name, "."))
-    || (dentry->d_name.len == 2 &&
- !strcmp(dentry->d_name.name, ".."))) {
- d_drop(dentry);
- goto out;
- }
-
- dentry->d_op = &dazukofs_dops;
+ int err;
 
  lower_dentry_parent = GET_LOWER_DENTRY(dentry->d_parent);
- lower_dentry = lookup_one_len(dentry->d_name.name, lower_dentry_parent,
-      dentry->d_name.len);
+ /* should be released in d_release() */
+ lower_mnt = mntget(GET_LOWER_MNT(dentry->d_parent));
 
+ lower_dentry = dazukofs_lookup_one_lower(&dentry->d_name,
+ lower_dentry_parent,
+ lower_mnt);
  if (IS_ERR(lower_dentry)) {
- err = PTR_ERR(lower_dentry);
- d_drop(dentry);
- goto out;
+ mntput(lower_mnt);
+ return lower_dentry;
  }
-
  BUG_ON(!atomic_read(&lower_dentry->d_count));
 
+ dentry->d_op = &dazukofs_dops;
  SET_DENTRY_INFO(dentry, kmem_cache_zalloc(dazukofs_dentry_info_cachep,
  GFP_KERNEL));
 
  if (!GET_DENTRY_INFO(dentry)) {
- err = -ENOMEM;
- goto out_dput;
+ mntput(lower_mnt);
+ dput(lower_dentry);
+ return ERR_PTR(-ENOMEM);
  }
-
- lower_mnt = mntget(GET_LOWER_MNT(dentry->d_parent));
-
- fsstack_copy_attr_atime(dir, lower_dentry_parent->d_inode);
-
  SET_LOWER_DENTRY(dentry, lower_dentry, lower_mnt);
-
+ /* from now lower dentry and lower mount are released in
+  d_release of upper dentry */
+ fsstack_copy_attr_atime(dir, lower_dentry_parent->d_inode);
  if (!lower_dentry->d_inode) {
  /*
  * We want to add because we could not find in lower.
  */
  d_add(dentry, NULL);
- goto out;
+ goto ok;
  }
 
  err = dazukofs_interpose(lower_dentry, dentry, dir->i_sb, 1);
- if (err)
- goto out_dput;
- goto out;
+ if (err)
+ return ERR_PTR(err);
 
-out_dput:
- dput(lower_dentry);
- d_drop(dentry);
-
-out:
- return ERR_PTR(err);
+ok:
+ return NULL; /* tell caller to use its own, passed dentry, not ours */
 }
 
+
 /**
  * Description: Called by the mknod(2) system call to create a device
  * (char, block) inode or a named pipe (FIFO) or socket. Only required if
@@ -216,6 +264,7 @@ static int dazukofs_mknod(struct inode *
   dev_t dev)
 {
  struct dentry *lower_dentry = GET_LOWER_DENTRY(dentry);
+ struct vfsmount *lower_mnt = GET_LOWER_MNT(dentry);
  struct dentry *lower_dentry_parent = dget(lower_dentry->d_parent);
  struct inode *lower_dentry_parent_inode = lower_dentry_parent->d_inode;
  int err = -ENOENT;
@@ -223,7 +272,8 @@ static int dazukofs_mknod(struct inode *
  mutex_lock_nested(&(lower_dentry_parent_inode->i_mutex),
   I_MUTEX_PARENT);
 
- err = vfs_mknod(lower_dentry_parent_inode, lower_dentry, mode, dev);
+ err = vfs_mknod(lower_dentry_parent_inode, lower_dentry, lower_mnt,
+ mode, dev);
  if (err)
  goto out;
 
@@ -248,6 +298,7 @@ out:
 static int dazukofs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 {
  struct dentry *lower_dentry = GET_LOWER_DENTRY(dentry);
+ struct vfsmount *lower_mnt = GET_LOWER_MNT(dentry);
  struct dentry *lower_dentry_parent = dget(lower_dentry->d_parent);
  struct inode *lower_dentry_parent_inode = lower_dentry_parent->d_inode;
  int err = -ENOENT;
@@ -255,7 +306,8 @@ static int dazukofs_mkdir(struct inode *
  mutex_lock_nested(&(lower_dentry_parent_inode->i_mutex),
   I_MUTEX_PARENT);
 
- err = vfs_mkdir(lower_dentry_parent_inode, lower_dentry, mode);
+ err = vfs_mkdir(lower_dentry_parent_inode, lower_dentry, lower_mnt,
+ mode);
  if (err)
  goto out;
 
@@ -333,6 +385,7 @@ static int dazukofs_symlink(struct inode
     const char *symname)
 {
  struct dentry *lower_dentry = GET_LOWER_DENTRY(dentry);
+ struct vfsmount *lower_mnt = GET_LOWER_MNT(dentry);
  struct dentry *lower_dentry_parent = dget(lower_dentry->d_parent);
  struct inode *lower_dentry_parent_inode = lower_dentry_parent->d_inode;
  int err = -ENOENT;
@@ -340,7 +393,8 @@ static int dazukofs_symlink(struct inode
  mutex_lock_nested(&(lower_dentry_parent_inode->i_mutex),
   I_MUTEX_PARENT);
 
- err = vfs_symlink(lower_dentry_parent_inode, lower_dentry, symname);
+ err = vfs_symlink(lower_dentry_parent_inode, lower_dentry, lower_mnt,
+  symname);
  if (err)
  goto out;
 
@@ -464,14 +518,29 @@ static int dazukofs_permission(struct in
 static int dazukofs_setattr(struct dentry *dentry, struct iattr *ia)
 {
  struct dentry *lower_dentry = GET_LOWER_DENTRY(dentry);
+ struct vfsmount *lower_mnt = GET_LOWER_MNT(dentry);
  struct inode *inode = dentry->d_inode;
  struct inode *lower_inode = GET_LOWER_INODE(inode);
  int err;
 
- err = notify_change(lower_dentry, ia);
 
- fsstack_copy_attr_all(inode, lower_inode, NULL);
- fsstack_copy_inode_size(inode, lower_inode);
+ if (!lower_inode->i_op || !lower_inode->i_op->setattr)
+ /* XXX: at this point it is too late to handle inodes properly that do NOT
+ specify setattr(). VFS would normally call inode_setattr() in
+ this case. So to force this we jump back to notify_change which will
+ handle this for us. But this is dangerous:
+ The attributes might be modified by notify_change() in a way
+ that results in invalid attributes. This seems to be the case
+ if the inode for which this function is called has the setuid
+ or setgid bit set */
+ err = notify_change(lower_dentry, lower_mnt, ia);
+ else
+ err = lower_inode->i_op->setattr(lower_dentry, ia);
+
+ if (!err) {
+ fsstack_copy_attr_all(inode, lower_inode, NULL);
+ fsstack_copy_inode_size(inode, lower_inode);
+ }
 
  return err;
 }
@@ -496,7 +565,7 @@ static int dazukofs_setxattr(struct dent
 
  if (!lower_dentry_inode->i_op ||
     !lower_dentry_inode->i_op->setxattr) {
- err = -ENOSYS;
+ err = -EOPNOTSUPP;
  goto out;
  }
 
@@ -509,6 +578,7 @@ out:
  return err;
 }
 
+
 /**
  * Description: Called by the VFS to retrieve the value of an extended
  * attribute name. This method is called by getxattr(2) function call.
@@ -528,7 +598,7 @@ static ssize_t dazukofs_getxattr(struct
 
  if (!lower_dentry_inode->i_op ||
     !lower_dentry_inode->i_op->getxattr) {
- err = -ENOSYS;
+ err = -EOPNOTSUPP;
  goto out;
  }
 
@@ -557,7 +627,7 @@ static ssize_t dazukofs_listxattr(struct
 
  if (!lower_dentry_inode->i_op ||
     !lower_dentry_inode->i_op->listxattr) {
- err = -ENOSYS;
+ err = -EOPNOTSUPP;
  goto out;
  }
 
@@ -584,7 +654,7 @@ static int dazukofs_removexattr(struct d
 
  if (!lower_dentry_inode->i_op ||
     !lower_dentry_inode->i_op->removexattr) {
- err = -ENOSYS;
+ err = -EOPNOTSUPP;
  goto out;
  }
 
@@ -603,6 +673,8 @@ static int dazukofs_link(struct dentry *
 {
  struct dentry *lower_old_dentry = GET_LOWER_DENTRY(old_dentry);
  struct dentry *lower_new_dentry = GET_LOWER_DENTRY(new_dentry);
+ struct vfsmount *lower_old_mnt = GET_LOWER_MNT(old_dentry);
+ struct vfsmount *lower_new_mnt = GET_LOWER_MNT(new_dentry);
  struct dentry *lower_dentry_parent = dget(lower_new_dentry->d_parent);
  struct inode *lower_dentry_parent_inode = lower_dentry_parent->d_inode;
  int err = -ENOENT;
@@ -610,8 +682,9 @@ static int dazukofs_link(struct dentry *
  mutex_lock_nested(&(lower_dentry_parent_inode->i_mutex),
   I_MUTEX_PARENT);
 
- err = vfs_link(lower_old_dentry, lower_dentry_parent_inode,
-       lower_new_dentry);
+ err = vfs_link(lower_old_dentry, lower_old_mnt,
+       lower_dentry_parent_inode, lower_new_dentry,
+       lower_new_mnt);
  if (err)
  goto out;
 
@@ -635,6 +708,7 @@ out:
 static int dazukofs_unlink(struct inode *dir, struct dentry *dentry)
 {
  struct dentry *lower_dentry = GET_LOWER_DENTRY(dentry);
+ struct vfsmount *lower_mnt = GET_LOWER_MNT(dentry);
  struct dentry *lower_dentry_parent = dget(lower_dentry->d_parent);
  struct inode *lower_dentry_parent_inode = lower_dentry_parent->d_inode;
  int err;
@@ -642,7 +716,7 @@ static int dazukofs_unlink(struct inode
  mutex_lock_nested(&(lower_dentry_parent_inode->i_mutex),
   I_MUTEX_PARENT);
 
- err = vfs_unlink(lower_dentry_parent_inode, lower_dentry);
+ err = vfs_unlink(lower_dentry_parent_inode, lower_dentry, lower_mnt);
  if (err)
  goto out;
 
@@ -664,6 +738,7 @@ out:
 static int dazukofs_rmdir(struct inode *dir, struct dentry *dentry)
 {
  struct dentry *lower_dentry = GET_LOWER_DENTRY(dentry);
+ struct vfsmount *lower_mnt = GET_LOWER_MNT(dentry);
  struct dentry *lower_dentry_parent = dget(lower_dentry->d_parent);
  struct inode *lower_dentry_parent_inode = lower_dentry_parent->d_inode;
  int err;
@@ -671,7 +746,7 @@ static int dazukofs_rmdir(struct inode *
  mutex_lock_nested(&(lower_dentry_parent_inode->i_mutex),
   I_MUTEX_PARENT);
 
- err = vfs_rmdir(lower_dentry_parent_inode, lower_dentry);
+ err = vfs_rmdir(lower_dentry_parent_inode, lower_dentry, lower_mnt);
  if (err)
  goto out;
 
@@ -696,6 +771,8 @@ static int dazukofs_rename(struct inode
 {
  struct dentry *lower_old_dentry = GET_LOWER_DENTRY(old_dentry);
  struct dentry *lower_new_dentry = GET_LOWER_DENTRY(new_dentry);
+ struct vfsmount *lower_old_mnt = GET_LOWER_MNT(old_dentry);
+ struct vfsmount *lower_new_mnt = GET_LOWER_MNT(new_dentry);
  struct dentry *lower_old_dentry_parent =
  dget(lower_old_dentry->d_parent);
  struct dentry *lower_new_dentry_parent =
@@ -718,7 +795,8 @@ static int dazukofs_rename(struct inode
 
  lock_rename(lower_old_dentry_parent, lower_new_dentry_parent);
  err = vfs_rename(lower_old_dentry_parent_inode, lower_old_dentry,
- lower_new_dentry_parent_inode, lower_new_dentry);
+ lower_old_mnt, lower_new_dentry_parent_inode,
+ lower_new_dentry, lower_new_mnt);
  unlock_rename(lower_old_dentry_parent, lower_new_dentry_parent);
 
  if (err)
diff -x CVS -rup dazukofs-3.0.0/Makefile dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/Makefile
--- dazukofs-3.0.0/Makefile 2009-02-22 17:46:02.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/Makefile 2009-05-11 19:49:52.000000000 +0200
@@ -19,6 +19,7 @@ dazukofs_install: dazukofs_modules
 
 clean:
  rm -f Module.symvers
+ rm -f modules.order
  make -C $(DAZUKOFS_KERNEL_SRC) SUBDIRS="`pwd`" clean
 
 .PHONY: dazukofs_modules dazukofs_install clean
diff -x CVS -rup dazukofs-3.0.0/README dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/README
--- dazukofs-3.0.0/README 2009-02-22 17:38:21.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/README 2009-02-19 17:37:14.000000000 +0100
@@ -21,10 +21,10 @@ NOTE: DazukoFS is completely separate fr
 =================
 
 Below are brief instructions to get DazukoFS compiled and running on a
-system with a Linux 2.6.28 kernel. You may need to manually adjust the
+system with a Linux 2.6.27 kernel. You may need to manually adjust the
 Makefile if you kernel sources are not in the default location.
-(Patches are provided for various other kernels. See the section below
-titled "PATCHING" for more information.)
+(A patch is provided to convert the DazukoFS code to support Linux
+2.6.26.)
 
 compile the kernel module
   # make
@@ -52,25 +52,6 @@ unmount DazukoFS
 
 
 
-==========
- PATCHING
-==========
-
-In the "patches" directory there are patches available to modify the
-DazukoFS code to fit various other kernels. For example, if you are
-running openSUSE 11.1 you can patch the code with the following
-command:
-
-$ patch -p1 < patches/patch-opensuse-11.1
-
-There should not be any errors. If there are errors, then the patch
-is broken and should be reported on the dazuko-devel mailing list.
-
-Once the code has been patched you can build the kernel module as
-described in the section "BUILD / INSTALL" above.
-
-
-
 =========
  TESTING
 =========
@@ -154,9 +135,6 @@ any problems.
  KNOWN ISSUES
 ==============
 
-- The kernel will crash if you attempt to mount DazukoFS to a file instead
-  of a directory. (The various kernel patches handle this error.)
-
 - DazukoFS does not support writing to memory mapped files. This should not
   cause the kernel to crash, but will instead result in the application
   failing to perform the writes (although mmap() will appear to be
diff -x CVS -rup dazukofs-3.0.0/super.c dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/super.c
--- dazukofs-3.0.0/super.c 2009-02-22 17:46:02.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.27_ub_os11.1/super.c 2009-07-03 18:13:22.000000000 +0200
@@ -35,6 +35,10 @@ static struct kmem_cache *dazukofs_sb_in
 struct kmem_cache *dazukofs_dentry_info_cachep;
 struct kmem_cache *dazukofs_file_info_cachep;
 
+
+#define DAZUKOFS_VERSION "3.0.0-rc4-avira-b2.6"
+
+
 static struct inode *dazukofs_alloc_inode(struct super_block *sb)
 {
  struct dazukofs_inode_info *inodei;
@@ -170,7 +174,10 @@ static int dazukofs_read_super(struct su
  err = -ENOENT;
  goto out_put;
  }
-
+ if (!S_ISDIR(lower_root->d_inode->i_mode)) {
+ err = -ENOENT;
+ goto out_put;
+ }
  SET_LOWER_SB(sb, lower_root->d_sb);
  sb->s_maxbytes = lower_root->d_sb->s_maxbytes;
  SET_LOWER_DENTRY(sb->s_root, lower_root, lower_mnt);
@@ -213,6 +220,7 @@ static int dazukofs_get_sb(struct file_s
 
 out_abort:
  up_write(&sb->s_umount);
+ dput(sb->s_root);
  deactivate_super(sb);
 out:
  return err;
@@ -305,7 +313,7 @@ static struct file_system_type dazukofs_
 
 static int __init init_dazukofs_fs(void)
 {
- int err = 0;
+ int err;
 
  err = dazukofs_dev_init();
  if (err)
@@ -319,7 +327,7 @@ static int __init init_dazukofs_fs(void)
  if (err)
  goto error_out3;
 
- printk(KERN_INFO "dazukofs: loaded, version=%s\n", DAZUKOFS_VERSION);
+ printk(KERN_INFO "dazukofs: loaded, version=" DAZUKOFS_VERSION "\n");
  return 0;
 
 error_out3:
@@ -335,9 +343,10 @@ static void __exit exit_dazukofs_fs(void
  unregister_filesystem(&dazukofs_fs_type);
  destroy_caches();
  dazukofs_dev_destroy();
- printk(KERN_INFO "dazukofs: unloaded, version=%s\n", DAZUKOFS_VERSION);
+ printk(KERN_INFO "dazukofs: unloaded, version=" DAZUKOFS_VERSION "\n");
 }
 
+
 MODULE_AUTHOR("John Ogness");
 MODULE_DESCRIPTION("access control stackable filesystem");
 MODULE_LICENSE("GPL");

_______________________________________________
Dazuko-devel mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/dazuko-devel