~ubuntu-branches/ubuntu/quantal/aufs/quantal

« back to all changes in this revision

Viewing changes to debian/patches/01_vserver_apparmor.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2008-04-01 18:26:37 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080401182637-ujuqq47eiggw4y5w
Tags: 0+20080401-1
* New upstream snapshot
  - Remove bashisms in script (Closes: #471288)
* debian/conf.mk, linux-patch-aufs.kpatches.sysfs_get_dentry:
  - Remove support for this patch, no longer used
* debian/conf.mk:
  - Add hacks for arm to armel (Closes: #473767)
* debian/control:
  - Add Dm-Upload-Allowed
* debian/copyright:
  - Use http://wiki.debian.org/Proposals/CopyrightFormat
* debian/linux-patch-aufs.kpatches.{splice,put_filp}:
  - Add support for Kernel 2.6.24 (and 2.6.25)
* debian/patches:
  - 01_vserver_apparmor: Update patch
  - 06_rt: Add patch for realtime kernel
  - 07_splice_hack: Add hack to support splice operations (Closes: #473430)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
## DP: Patch aufs to work with vserver and apparmor (Ubuntu) kernels
5
5
 
6
6
@DPATCH@
7
 
diff -urNad aufs-0+20080129~/fs/aufs/misc.c aufs-0+20080129/fs/aufs/misc.c
8
 
--- aufs-0+20080129~/fs/aufs/misc.c     2008-01-29 16:43:38.000000000 +0100
9
 
+++ aufs-0+20080129/fs/aufs/misc.c      2008-01-29 18:41:03.000000000 +0100
 
7
diff -urNad aufs-0+20080317~/fs/aufs/i_op.c aufs-0+20080317/fs/aufs/i_op.c
 
8
--- aufs-0+20080317~/fs/aufs/i_op.c     2008-03-17 14:35:02.000000000 +0100
 
9
+++ aufs-0+20080317/fs/aufs/i_op.c      2008-03-17 14:36:13.000000000 +0100
 
10
@@ -640,12 +640,14 @@
 
11
        si_read_lock(sb, AuLock_FLUSH);
 
12
 
 
13
        file = NULL;
 
14
+       #if !defined(CONFIG_SECURITY_APPARMOR) || LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
 
15
        if (ia->ia_valid & ATTR_FILE) {
 
16
                /* currently ftruncate(2) only */
 
17
                file = ia->ia_file;
 
18
                fi_write_lock(file);
 
19
                ia->ia_file = au_h_fptr(file);
 
20
        }
 
21
+       #endif
 
22
 
 
23
        sz = -1;
 
24
        if ((ia->ia_valid & ATTR_SIZE)
 
25
@@ -783,11 +785,13 @@
 
26
        }
 
27
        di_write_unlock(dentry);
 
28
  out:
 
29
+       #if !defined(CONFIG_SECURITY_APPARMOR) || LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
 
30
        if (file) {
 
31
                ia->ia_file = file;
 
32
                //ia->ia_valid |= ATTR_FILE;
 
33
                fi_write_unlock(file);
 
34
        }
 
35
+       #endif
 
36
        si_read_unlock(sb);
 
37
        AuTraceErr(err);
 
38
        return err;
 
39
diff -urNad aufs-0+20080317~/fs/aufs/misc.c aufs-0+20080317/fs/aufs/misc.c
 
40
--- aufs-0+20080317~/fs/aufs/misc.c     2008-03-17 14:35:02.000000000 +0100
 
41
+++ aufs-0+20080317/fs/aufs/misc.c      2008-03-17 14:35:07.000000000 +0100
10
42
@@ -265,8 +265,12 @@
11
43
                } while (err == -EAGAIN || err == -EINTR);
12
44
                if (err == 1) {
20
52
                        vfsub_i_lock_nested(h_i, AuLsc_I_CHILD2);
21
53
                        err = vfsub_notify_change(h_d, ia, &vargs);
22
54
                        vfsub_i_unlock(h_i);
23
 
diff -urNad aufs-0+20080129~/fs/aufs/vfsub.c aufs-0+20080129/fs/aufs/vfsub.c
24
 
--- aufs-0+20080129~/fs/aufs/vfsub.c    2008-01-29 16:43:38.000000000 +0100
25
 
+++ aufs-0+20080129/fs/aufs/vfsub.c     2008-01-29 18:41:03.000000000 +0100
26
 
@@ -1075,7 +1075,11 @@
27
 
        if (!IS_IMMUTABLE(h_inode) && !IS_APPEND(h_inode)) {
28
 
                vfsub_ignore(a->vargs);
29
 
                lockdep_off();
30
 
+               #ifdef CONFIG_SECURITY_APPARMOR
31
 
+               *a->errp = notify_change(a->h_dentry, NULL, a->ia);
32
 
+               #else
33
 
                *a->errp = notify_change(a->h_dentry, a->ia);
34
 
+               #endif
35
 
                lockdep_on();
36
 
                if (!*a->errp)
37
 
                        au_update_fuse_h_inode(NULL, a->h_dentry); /*ignore*/
38
 
diff -urNad aufs-0+20080129~/fs/aufs/vfsub.h aufs-0+20080129/fs/aufs/vfsub.h
39
 
--- aufs-0+20080129~/fs/aufs/vfsub.h    2008-01-29 16:43:38.000000000 +0100
40
 
+++ aufs-0+20080129/fs/aufs/vfsub.h     2008-01-29 18:41:03.000000000 +0100
41
 
@@ -376,7 +376,13 @@
 
55
diff -urNad aufs-0+20080317~/fs/aufs/vfsub.c aufs-0+20080317/fs/aufs/vfsub.c
 
56
--- aufs-0+20080317~/fs/aufs/vfsub.c    2008-03-17 14:35:02.000000000 +0100
 
57
+++ aufs-0+20080317/fs/aufs/vfsub.c     2008-03-17 14:35:07.000000000 +0100
 
58
@@ -111,7 +111,13 @@
42
59
                  dir->i_ino, AuDLNPair(dentry), symname, mode);
43
60
        IMustLock(dir);
44
61
 
45
 
+#ifdef CONFIG_VSERVER
 
62
+       #ifdef CONFIG_VSERVER
46
63
+       err = vfs_symlink(dir, dentry, symname, mode, NULL);
47
 
+#elif defined(CONFIG_SECURITY_APPARMOR)
 
64
+       #elif defined(CONFIG_SECURITY_APPARMOR)
48
65
+       err = vfs_symlink(dir, dentry, NULL, symname, mode);
49
 
+#else
 
66
+       #else
50
67
        err = vfs_symlink(dir, dentry, symname, mode);
51
 
+#endif
 
68
+       #endif
52
69
        if (!err) {
53
70
                /* dir inode is locked */
54
71
                au_update_fuse_h_inode(NULL, dentry->d_parent); /*ignore*/
55
 
@@ -394,7 +400,13 @@
 
72
@@ -128,7 +134,13 @@
56
73
        LKTRTrace("i%lu, %.*s, 0x%x\n", dir->i_ino, AuDLNPair(dentry), mode);
57
74
        IMustLock(dir);
58
75
 
59
 
+#ifdef CONFIG_VSERVER
 
76
+       #ifdef CONFIG_VSERVER
60
77
+       err = vfs_mknod(dir, dentry, mode, dev, NULL);
61
 
+#elif defined(CONFIG_SECURITY_APPARMOR)
 
78
+       #elif defined(CONFIG_SECURITY_APPARMOR)
62
79
+       err = vfs_mknod(dir, dentry, NULL, mode, dev);
63
 
+#else
 
80
+       #else
64
81
        err = vfs_mknod(dir, dentry, mode, dev);
65
 
+#endif
 
82
+       #endif
66
83
        if (!err) {
67
84
                /* dir inode is locked */
68
85
                au_update_fuse_h_inode(NULL, dentry->d_parent); /*ignore*/
69
 
@@ -414,7 +426,13 @@
 
86
@@ -147,7 +159,14 @@
70
87
        IMustLock(dir);
71
88
 
72
89
        lockdep_off();
73
 
+#ifdef CONFIG_VSERVER
 
90
+
 
91
+       #ifdef CONFIG_VSERVER
74
92
+       err = vfs_link(src_dentry, dir, dentry, NULL);
75
 
+#elif defined(CONFIG_SECURITY_APPARMOR)
 
93
+       #elif defined(CONFIG_SECURITY_APPARMOR)
76
94
+       err = vfs_link(src_dentry, NULL, dir, dentry, NULL);
77
 
+#else
 
95
+       #else
78
96
        err = vfs_link(src_dentry, dir, dentry);
79
 
+#endif
 
97
+       #endif
80
98
        lockdep_on();
81
99
        if (!err) {
82
100
                LKTRTrace("src_i %p, dst_i %p\n",
83
 
@@ -441,7 +459,11 @@
 
101
@@ -173,7 +192,11 @@
84
102
        IMustLock(src_dir);
85
103
 
86
104
        lockdep_off();
92
110
        lockdep_on();
93
111
        if (!err) {
94
112
                /* dir inode is locked */
95
 
@@ -460,7 +482,13 @@
 
113
@@ -191,7 +214,13 @@
96
114
        LKTRTrace("i%lu, %.*s, 0x%x\n", dir->i_ino, AuDLNPair(dentry), mode);
97
115
        IMustLock(dir);
98
116
 
99
 
+#ifdef CONFIG_VSERVER
 
117
+       #ifdef CONFIG_VSERVER
100
118
+       err = vfs_mkdir(dir, dentry, mode, NULL);
101
 
+#elif defined(CONFIG_SECURITY_APPARMOR)
 
119
+       #elif defined(CONFIG_SECURITY_APPARMOR)
102
120
+       err = vfs_mkdir(dir, dentry, NULL, mode);
103
 
+#else
 
121
+       #else
104
122
        err = vfs_mkdir(dir, dentry, mode);
105
 
+#endif
 
123
+       #endif
106
124
        if (!err) {
107
125
                /* dir inode is locked */
108
126
                au_update_fuse_h_inode(NULL, dentry->d_parent); /*ignore*/
109
 
@@ -477,7 +505,11 @@
 
127
@@ -208,7 +237,11 @@
110
128
        IMustLock(dir);
111
129
 
112
130
        lockdep_off();
113
 
+#if defined(CONFIG_VSERVER) || defined(CONFIG_SECURITY_APPARMOR)
 
131
+       #if defined(CONFIG_VSERVER) || defined(CONFIG_SECURITY_APPARMOR)
114
132
+       err = vfs_rmdir(dir, dentry, NULL);
115
 
+#else
 
133
+       #else
116
134
        err = vfs_rmdir(dir, dentry);
117
 
+#endif
 
135
+       #endif
118
136
        lockdep_on();
119
137
        /* dir inode is locked */
120
138
        if (!err)
121
 
@@ -494,7 +526,11 @@
 
139
@@ -225,7 +258,11 @@
122
140
 
123
141
        /* vfs_unlink() locks inode */
124
142
        lockdep_off();
125
 
+#if defined(CONFIG_VSERVER) || defined(CONFIG_SECURITY_APPARMOR)
 
143
+       #if defined(CONFIG_VSERVER) || defined(CONFIG_SECURITY_APPARMOR)
126
144
+       err = vfs_unlink(dir, dentry, NULL);
127
 
+#else
 
145
+       #else
128
146
        err = vfs_unlink(dir, dentry);
129
 
+#endif
 
147
+       #endif
130
148
        lockdep_on();
131
149
        /* dir inode is locked */
132
150
        if (!err)
 
151
@@ -1135,7 +1172,11 @@
 
152
        if (!IS_IMMUTABLE(h_inode) && !IS_APPEND(h_inode)) {
 
153
                vfsub_ignore(a->vargs);
 
154
                lockdep_off();
 
155
+               #ifdef CONFIG_SECURITY_APPARMOR
 
156
+               *a->errp = notify_change(a->h_dentry, NULL, a->ia);
 
157
+               #else
 
158
                *a->errp = notify_change(a->h_dentry, a->ia);
 
159
+               #endif
 
160
                lockdep_on();
 
161
                if (!*a->errp)
 
162
                        au_update_fuse_h_inode(NULL, a->h_dentry); /*ignore*/