summaryrefslogtreecommitdiff
path: root/target/linux/generic/patches-2.6.37/101-overlayfs_2.6.37_backport.patch
blob: b7638c05cd4e3e5c218f21eaf6d0c00057a6511f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
--- a/fs/overlayfs/overlayfs.c
+++ b/fs/overlayfs/overlayfs.c
@@ -28,13 +28,8 @@ struct ovl_fs {
 struct ovl_entry {
 	struct dentry *__upperdentry;
 	struct dentry *lowerdentry;
-	union {
-		struct {
-			u64 version;
-			bool opaque;
-		};
-		struct rcu_head rcu;
-	};
+	u64 version;
+	bool opaque;
 };
 
 static const char *ovl_whiteout_xattr = "trusted.overlay.whiteout";
@@ -632,12 +627,6 @@ static const struct file_operations ovl_
 
 static const struct inode_operations ovl_dir_inode_operations;
 
-static void ovl_entry_free(struct rcu_head *head)
-{
-	struct ovl_entry *oe = container_of(head, struct ovl_entry, rcu);
-	kfree(oe);
-}
-
 static void ovl_dentry_release(struct dentry *dentry)
 {
 	struct ovl_entry *oe = dentry->d_fsdata;
@@ -645,7 +634,7 @@ static void ovl_dentry_release(struct de
 	if (oe) {
 		dput(oe->__upperdentry);
 		dput(oe->lowerdentry);
-		call_rcu(&oe->rcu, ovl_entry_free);
+		kfree(oe);
 	}
 }
 
@@ -1338,7 +1327,7 @@ static int ovl_dir_getattr(struct vfsmou
 	return 0;
 }
 
-static int ovl_permission(struct inode *inode, int mask, unsigned int flags)
+static int ovl_permission(struct inode *inode, int mask)
 {
 	struct ovl_entry *oe;
 	struct dentry *alias = NULL;
@@ -1349,8 +1338,6 @@ static int ovl_permission(struct inode *
 
 	if (S_ISDIR(inode->i_mode)) {
 		oe = inode->i_private;
-	} else if (flags & IPERM_FLAG_RCU) {
-		return -ECHILD;
 	} else {
 		/*
 		 * For non-directories find an alias and get the info
@@ -1377,7 +1364,6 @@ static int ovl_permission(struct inode *
 	/* Careful in RCU walk mode */
 	realinode = ACCESS_ONCE(realdentry->d_inode);
 	if (!realinode) {
-		WARN_ON(!(flags & IPERM_FLAG_RCU));
 		return -ENOENT;
 	}
 
@@ -1402,9 +1388,9 @@ static int ovl_permission(struct inode *
 	}
 
 	if (realinode->i_op->permission)
-		err = realinode->i_op->permission(realinode, mask, flags);
+		err = realinode->i_op->permission(realinode, mask);
 	else
-		err = generic_permission(realinode, mask, flags,
+		err = generic_permission(realinode, mask,
 					 realinode->i_op->check_acl);
 out_dput:
 	dput(alias);