[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dazuko-devel] patch for vanilla kernel 2.6.24
From: |
Lino Sanfilippo |
Subject: |
[Dazuko-devel] patch for vanilla kernel 2.6.24 |
Date: |
Tue, 10 Feb 2009 12:02:21 +0100 |
User-agent: |
IceDove 1.5.0.14eol (X11/20090105) |
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 -rup dazukofs-3.0.0-rc4/ctrl_dev.c dazukofs-3.0.0-rc4_2.6.24/ctrl_dev.c
--- dazukofs-3.0.0-rc4/ctrl_dev.c 2008-11-30 14:11:50.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.24/ctrl_dev.c 2009-02-10 10:37:56.000000000
+0100
@@ -183,7 +183,7 @@ int dazukofs_ctrl_dev_init(int dev_major
/* create control device */
dev = device_create(dazukofs_class, NULL, MKDEV(dev_major, dev_minor),
- NULL, "%s.ctrl", DEVICE_NAME);
+ "%s.ctrl", DEVICE_NAME);
if (IS_ERR(dev)) {
err = PTR_ERR(dev);
goto error_out2;
diff -rup dazukofs-3.0.0-rc4/dentry.c dazukofs-3.0.0-rc4_2.6.24/dentry.c
--- dazukofs-3.0.0-rc4/dentry.c 2008-11-30 14:11:54.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.24/dentry.c 2009-02-10 10:37:56.000000000 +0100
@@ -65,19 +65,19 @@ static int dazukofs_d_revalidate(struct
lower_mnt = GET_LOWER_MNT(dentry);
- vfsmount_save = nd->path.mnt;
- dentry_save = nd->path.dentry;
+ vfsmount_save = nd->mnt;
+ dentry_save = nd->dentry;
- nd->path.mnt = mntget(lower_mnt);
- nd->path.dentry = dget(lower_dentry);
+ nd->mnt = mntget(lower_mnt);
+ nd->dentry = dget(lower_dentry);
valid = lower_dentry->d_op->d_revalidate(lower_dentry, nd);
mntput(lower_mnt);
dput(lower_dentry);
- nd->path.mnt = vfsmount_save;
- nd->path.dentry = dentry_save;
+ nd->mnt = vfsmount_save;
+ nd->dentry = dentry_save;
/* update the inode, even if d_revalidate() != 1 */
if (dentry->d_inode) {
diff -rup dazukofs-3.0.0-rc4/group_dev.c dazukofs-3.0.0-rc4_2.6.24/group_dev.c
--- dazukofs-3.0.0-rc4/group_dev.c 2008-11-30 14:11:13.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.24/group_dev.c 2009-02-10 10:37:56.000000000
+0100
@@ -210,7 +210,7 @@ int dazukofs_group_dev_init(int dev_majo
/* create group devices */
for (i = 0; i < GROUP_COUNT; i++) {
dev = device_create(dazukofs_class, NULL,
- MKDEV(dev_major, dev_minor_end), NULL,
+ MKDEV(dev_major, dev_minor_end),
"%s.%d", DEVICE_NAME, i);
if (IS_ERR(dev)) {
err = PTR_ERR(dev);
diff -rup dazukofs-3.0.0-rc4/ign_dev.c dazukofs-3.0.0-rc4_2.6.24/ign_dev.c
--- dazukofs-3.0.0-rc4/ign_dev.c 2008-11-30 14:11:57.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.24/ign_dev.c 2009-02-10 10:37:56.000000000 +0100
@@ -159,7 +159,7 @@ int dazukofs_ign_dev_init(int dev_major,
/* create ignore device */
dev = device_create(dazukofs_class, NULL, MKDEV(dev_major, dev_minor),
- NULL, "%s.ign", DEVICE_NAME);
+ "%s.ign", DEVICE_NAME);
if (IS_ERR(dev)) {
err = PTR_ERR(dev);
goto error_out3;
diff -rup dazukofs-3.0.0-rc4/inode.c dazukofs-3.0.0-rc4_2.6.24/inode.c
--- dazukofs-3.0.0-rc4/inode.c 2008-11-30 14:11:39.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.24/inode.c 2009-02-10 10:37:56.000000000 +0100
@@ -294,19 +294,19 @@ static int dazukofs_create(struct inode
mutex_lock_nested(&(lower_dentry_parent_inode->i_mutex),
I_MUTEX_PARENT);
- vfsmount_save = nd->path.mnt;
- dentry_save = nd->path.dentry;
+ vfsmount_save = nd->mnt;
+ dentry_save = nd->dentry;
- nd->path.mnt = mntget(lower_mnt);
- nd->path.dentry = dget(lower_dentry);
+ nd->mnt = mntget(lower_mnt);
+ nd->dentry = dget(lower_dentry);
err = vfs_create(lower_dentry_parent_inode, lower_dentry, mode, nd);
mntput(lower_mnt);
dput(lower_dentry);
- nd->path.mnt = vfsmount_save;
- nd->path.dentry = dentry_save;
+ nd->mnt = vfsmount_save;
+ nd->dentry = dentry_save;
if (err)
goto out;
@@ -340,7 +340,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, symname,
+ S_IALLUGO);
if (err)
goto out;
@@ -452,9 +453,37 @@ static void dazukofs_put_link(struct den
* Description: Called by the VFS to check for access rights on a
* POSIX-like filesystem.
*/
-static int dazukofs_permission(struct inode *inode, int mask)
+static int dazukofs_permission(struct inode *inode, int mask,
+ struct nameidata *nd)
{
- return inode_permission(GET_LOWER_INODE(inode), mask);
+ struct vfsmount *lower_mnt = NULL;
+ struct dentry *lower_dentry = NULL;
+ struct vfsmount *vfsmnt_save = NULL;
+ struct dentry *dentry_save = NULL;
+ int err;
+
+ if (nd) {
+ lower_mnt = GET_LOWER_MNT(nd->dentry);
+ lower_dentry = GET_LOWER_DENTRY(nd->dentry);
+
+ vfsmnt_save = nd->mnt;
+ dentry_save = nd->dentry;
+
+ nd->mnt = mntget(lower_mnt);
+ nd->dentry = dget(lower_dentry);
+ }
+
+ err = permission(GET_LOWER_INODE(inode), mask, nd);
+
+ if (nd) {
+ mntput(lower_mnt);
+ dput(lower_dentry);
+
+ nd->mnt = vfsmnt_save;
+ nd->dentry = dentry_save;
+ }
+
+ return err;
}
/**
diff -rup dazukofs-3.0.0-rc4/super.c dazukofs-3.0.0-rc4_2.6.24/super.c
--- dazukofs-3.0.0-rc4/super.c 2008-11-30 14:11:35.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.24/super.c 2009-02-10 10:37:56.000000000 +0100
@@ -158,8 +158,8 @@ static int dazukofs_read_super(struct su
if (err)
return err;
- lower_root = dget(nd.path.dentry);
- lower_mnt = mntget(nd.path.mnt);
+ lower_root = dget(nd.dentry);
+ lower_mnt = mntget(nd.mnt);
if (IS_ERR(lower_root)) {
err = PTR_ERR(lower_root);
@@ -170,6 +170,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;
@@ -184,7 +188,7 @@ out_put:
dput(lower_root);
mntput(lower_mnt);
out:
- path_put(&nd.path);
+ path_release(&nd);
return err;
}
@@ -213,15 +217,16 @@ 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;
}
-static void init_once(void *data)
+static void init_once(struct kmem_cache *cachep, void *vptr)
{
struct dazukofs_inode_info *inode_info =
- (struct dazukofs_inode_info *)data;
+ (struct dazukofs_inode_info *)vptr;
memset(inode_info, 0, sizeof(struct dazukofs_inode_info));
inode_init_once(&(inode_info->vfs_inode));
Nur in dazukofs-3.0.0-rc4_2.6.24/test: showfiles.
diff -rup dazukofs-3.0.0-rc4/test/showfiles.c
dazukofs-3.0.0-rc4_2.6.24/test/showfiles.c
--- dazukofs-3.0.0-rc4/test/showfiles.c 2008-10-25 00:08:30.000000000 +0200
+++ dazukofs-3.0.0-rc4_2.6.24/test/showfiles.c 2009-02-10 10:37:56.000000000
+0100
@@ -73,6 +73,8 @@ int main(void)
}
print_access(&acc);
+
+ acc.deny = 1;
if (dazukofs_return_access(hndl, &acc) != 0) {
if (running) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dazuko-devel] patch for vanilla kernel 2.6.24,
Lino Sanfilippo <=