[EMAIL PROTECTED] wrote:
>> Julian Andres Klode:
>>> compiling aufs with the patch for ubuntu worked for kernel 2.6.22-14.46, =
>>> but does not work for Ubuntu's
>>> 2.6.24-1.2. I attached the build log.
>> Thank you for your reports.
>> I will develop another patch for new ubuntu kernel after both of
>> linux-2.6.24 (no -rc version) and the ubuntu kernel supporting it are
>> released.
> 
> Recently linux-2.6.24 was released, and I found
> linux-source-2.6.24_2.6.24-5.8 ubuntu package. Is this the one which
> ubuntu users want me to work on?
> If ubuntu developers have a plan to update their 2.6.24 kernel, I think
> I should wait for it.
> If somebody knows such plan, tell me please.
Thank you for wanting to help us. I attached the patches which will be used
in the next upload of aufs (version 20080128), which is compatible with
Ubuntu's new 2.6.24 kernel and Debian kernels.

01_vserver_apparmor.dpatch contains a combined patch for vServer and
AppArmor (Ubuntu) kernels. Your ubuntu patch may be better, but this patch
works and is much smaller than yours.

02_patches is needed for internal packaging stuff

03_missing_headers hardcodes the magic numbers for XFS and TMPFS in
fs/aufs/Makefile (they are still the same as in 2.6.12-rc2).

04_sec_perm simply disables security_inode_permission for kernel 2.6.24 or
newer (has also been done in Ubuntu's unionfs patches).
> 
> 
> Junjiro Okajima


-- 
Julian Andres Klode, Fellow of the Free Software Foundation Europe
                     Ubuntu Member | Debian Packager | Developer

try Ubuntu: http://www.ubuntu.com/ | my site: http://jak-linux.org/
         mail: [EMAIL PROTECTED]  | IRC: juliank
            languages:     German  | English

#! /bin/sh /usr/share/dpatch/dpatch-run
## 01_vserver_apparmor.dpatch by Julian Andres Klode <[EMAIL PROTECTED]>
##
## DP: Patch aufs to work with vserver and apparmor (Ubuntu) kernels

@DPATCH@
diff -urNad aufs-0+20080129~/fs/aufs/misc.c aufs-0+20080129/fs/aufs/misc.c
--- aufs-0+20080129~/fs/aufs/misc.c     2007-11-12 02:40:06.000000000 +0100
+++ aufs-0+20080129/fs/aufs/misc.c      2008-01-29 16:08:09.000000000 +0100
@@ -266,7 +266,9 @@
                if (err == 1) {
                        ia->ia_size = dst->f_pos;
                        ia->ia_valid = ATTR_SIZE | ATTR_FILE;
+                       #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) || 
!defined(CONFIG_SECURITY_APPARMOR)
                        ia->ia_file = dst;
+                       #endif
                        vfsub_i_lock_nested(h_i, AuLsc_I_CHILD2);
                        err = vfsub_notify_change(h_d, ia, &vargs);
                        vfsub_i_unlock(h_i);
diff -urNad aufs-0+20080129~/fs/aufs/vfsub.c aufs-0+20080129/fs/aufs/vfsub.c
--- aufs-0+20080129~/fs/aufs/vfsub.c    2008-01-28 06:01:42.000000000 +0100
+++ aufs-0+20080129/fs/aufs/vfsub.c     2008-01-29 16:07:01.000000000 +0100
@@ -1075,7 +1075,11 @@
        if (!IS_IMMUTABLE(h_inode) && !IS_APPEND(h_inode)) {
                vfsub_ignore(a->vargs);
                lockdep_off();
+               #ifdef CONFIG_SECURITY_APPARMOR
+               *a->errp = notify_change(a->h_dentry, NULL, a->ia);
+               #else
                *a->errp = notify_change(a->h_dentry, a->ia);
+               #endif
                lockdep_on();
                if (!*a->errp)
                        au_update_fuse_h_inode(NULL, a->h_dentry); /*ignore*/
diff -urNad aufs-0+20080129~/fs/aufs/vfsub.h aufs-0+20080129/fs/aufs/vfsub.h
--- aufs-0+20080129~/fs/aufs/vfsub.h    2008-01-29 15:44:17.000000000 +0100
+++ aufs-0+20080129/fs/aufs/vfsub.h     2008-01-29 16:07:01.000000000 +0100
@@ -376,7 +376,13 @@
                  dir->i_ino, AuDLNPair(dentry), symname, mode);
        IMustLock(dir);
 
+#ifdef CONFIG_VSERVER
+       err = vfs_symlink(dir, dentry, symname, mode, NULL);
+#elif defined(CONFIG_SECURITY_APPARMOR)
+       err = vfs_symlink(dir, dentry, NULL, symname, mode);
+#else
        err = vfs_symlink(dir, dentry, symname, mode);
+#endif
        if (!err) {
                /* dir inode is locked */
                au_update_fuse_h_inode(NULL, dentry->d_parent); /*ignore*/
@@ -394,7 +400,13 @@
        LKTRTrace("i%lu, %.*s, 0x%x\n", dir->i_ino, AuDLNPair(dentry), mode);
        IMustLock(dir);
 
+#ifdef CONFIG_VSERVER
+       err = vfs_mknod(dir, dentry, mode, dev, NULL);
+#elif defined(CONFIG_SECURITY_APPARMOR)
+       err = vfs_mknod(dir, dentry, NULL, mode, dev);
+#else
        err = vfs_mknod(dir, dentry, mode, dev);
+#endif
        if (!err) {
                /* dir inode is locked */
                au_update_fuse_h_inode(NULL, dentry->d_parent); /*ignore*/
@@ -414,7 +426,13 @@
        IMustLock(dir);
 
        lockdep_off();
+#ifdef CONFIG_VSERVER
+       err = vfs_link(src_dentry, dir, dentry, NULL);
+#elif defined(CONFIG_SECURITY_APPARMOR)
+       err = vfs_link(src_dentry, NULL, dir, dentry, NULL);
+#else
        err = vfs_link(src_dentry, dir, dentry);
+#endif
        lockdep_on();
        if (!err) {
                LKTRTrace("src_i %p, dst_i %p\n",
@@ -441,7 +459,11 @@
        IMustLock(src_dir);
 
        lockdep_off();
+       #ifdef CONFIG_SECURITY_APPARMOR
+       err = vfs_rename(src_dir, src_dentry, NULL, dir, dentry, NULL);
+       #else
        err = vfs_rename(src_dir, src_dentry, dir, dentry);
+       #endif
        lockdep_on();
        if (!err) {
                /* dir inode is locked */
@@ -460,7 +482,13 @@
        LKTRTrace("i%lu, %.*s, 0x%x\n", dir->i_ino, AuDLNPair(dentry), mode);
        IMustLock(dir);
 
+#ifdef CONFIG_VSERVER
+       err = vfs_mkdir(dir, dentry, mode, NULL);
+#elif defined(CONFIG_SECURITY_APPARMOR)
+       err = vfs_mkdir(dir, dentry, NULL, mode);
+#else
        err = vfs_mkdir(dir, dentry, mode);
+#endif
        if (!err) {
                /* dir inode is locked */
                au_update_fuse_h_inode(NULL, dentry->d_parent); /*ignore*/
@@ -477,7 +505,11 @@
        IMustLock(dir);
 
        lockdep_off();
+#if defined(CONFIG_VSERVER) || defined(CONFIG_SECURITY_APPARMOR)
+       err = vfs_rmdir(dir, dentry, NULL);
+#else
        err = vfs_rmdir(dir, dentry);
+#endif
        lockdep_on();
        /* dir inode is locked */
        if (!err)
@@ -494,7 +526,11 @@
 
        /* vfs_unlink() locks inode */
        lockdep_off();
+#if defined(CONFIG_VSERVER) || defined(CONFIG_SECURITY_APPARMOR)
+       err = vfs_unlink(dir, dentry, NULL);
+#else
        err = vfs_unlink(dir, dentry);
+#endif
        lockdep_on();
        /* dir inode is locked */
        if (!err)

#! /bin/sh /usr/share/dpatch/dpatch-run
## 02_patches.dpatch by Julian Andres Klode <[EMAIL PROTECTED]>
##
## DP: lhash-2.6.22.patch - remove first component of path

@DPATCH@
diff -urNad --exclude=.bzr --exclude='*~' aufs-0+20070806~/lhash-2.6.22.patch 
aufs-0+20070806/lhash-2.6.22.patch
--- aufs-0+20070806~/patch/lhash-2.6.22.patch   2007-07-15 22:08:18.000000000 
+0200
+++ aufs-0+20070806/patch/lhash-2.6.22.patch    2007-08-06 15:48:18.074227638 
+0200
@@ -1,11 +1,11 @@
-Index: linux-2.6.22/fs/namei.c
+Index: fs/namei.c
 ===================================================================
 RCS file: /ext1/sysadm/transparent/repository/linux-2.6.22/fs/namei.c,v
 retrieving revision 1.1
 retrieving revision 1.3
 diff -u -p -r1.1 -r1.3
---- linux-2.6.22/fs/namei.c    12 Jul 2007 02:55:19 -0000      1.1
-+++ linux-2.6.22/fs/namei.c    12 Jul 2007 03:00:50 -0000      1.3
+--- fs/namei.c 12 Jul 2007 02:55:19 -0000      1.1
++++ fs/namei.c 12 Jul 2007 03:00:50 -0000      1.3
 @@ -1280,7 +1280,7 @@ out:
   * needs parent already locked. Doesn't follow mounts.
   * SMP-safe.
@@ -23,14 +23,14 @@
  EXPORT_SYMBOL(lookup_one_len);
  EXPORT_SYMBOL(page_follow_link_light);
  EXPORT_SYMBOL(page_put_link);
-Index: linux-2.6.22/include/linux/namei.h
+Index: include/linux/namei.h
 ===================================================================
 RCS file: 
/ext1/sysadm/transparent/repository/linux-2.6.22/include/linux/namei.h,v
 retrieving revision 1.1
 retrieving revision 1.2
 diff -u -p -r1.1 -r1.2
---- linux-2.6.22/include/linux/namei.h 12 Jul 2007 02:55:19 -0000      1.1
-+++ linux-2.6.22/include/linux/namei.h 12 Jul 2007 02:55:20 -0000      1.2
+--- include/linux/namei.h      12 Jul 2007 02:55:19 -0000      1.1
++++ include/linux/namei.h      12 Jul 2007 02:55:20 -0000      1.2
 @@ -81,6 +81,7 @@ extern struct file *lookup_instantiate_f
  extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
  extern void release_open_intent(struct nameidata *);

#! /bin/sh /usr/share/dpatch/dpatch-run
## 03_missing_headers.dpatch by Julian Andres Klode <[EMAIL PROTECTED]>
##
## DP: Statically set variables instead of grepping from non-existant files

@DPATCH@
diff -urNad aufs-0+20080129~/fs/aufs/Makefile aufs-0+20080129/fs/aufs/Makefile
--- aufs-0+20080129~/fs/aufs/Makefile   2007-12-17 04:30:17.000000000 +0100
+++ aufs-0+20080129/fs/aufs/Makefile    2008-01-29 16:36:36.000000000 +0100
@@ -26,20 +26,12 @@
 
 ifeq ($(strip $(shell test ${SUBLEVEL} -ge 24 && echo t)),t)
 ifdef CONFIG_XFS_FS
-# it isn't defined in a header file
-xfs = $(shell grep '\#.*define.*XFS_SB_MAGIC' ${srctree}/fs/xfs/xfs_sb.h | \
-       head -n 1 | \
-       awk '{print $$3}')
-EXTRA_CFLAGS += -DXFS_SB_MAGIC=${xfs}
+EXTRA_CFLAGS += -DXFS_SB_MAGIC=0x58465342
 endif
 endif
 
 ifdef CONFIG_TMPFS
-# it isn't defined in a header file
-tmpfs = $(shell grep '\#.*define.*TMPFS_MAGIC' ${srctree}/mm/shmem.c | \
-       head -n 1 | \
-       awk '{print $$3}')
-EXTRA_CFLAGS += -DTMPFS_MAGIC=${tmpfs}
+EXTRA_CFLAGS += -DTMPFS_MAGIC=0x01021994
 endif
 
 ########################################

#! /bin/sh /usr/share/dpatch/dpatch-run
## 04_security.dpatch by Julian Andres Klode <[EMAIL PROTECTED]>
##
## DP: Disable security_inode_* calls to work with Kernel 2.6.24

@DPATCH@
diff -urNad aufs-0+20071211~/fs/aufs/i_op.c aufs-0+20071211/fs/aufs/i_op.c
--- aufs-0+20071211~/fs/aufs/i_op.c     2008-01-27 18:07:36.000000000 +0100
+++ aufs-0+20071211/fs/aufs/i_op.c      2008-01-27 18:08:28.000000000 +0100
@@ -69,7 +69,7 @@
                AuTraceErr(err);
        }
 
-#if 1
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
        if (!err) {
 #ifndef CONFIG_AUFS_DLGT
                err = security_inode_permission(h_inode, mask, fake_nd);

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Reply via email to