aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorRyan O'Hara <rohara@redhat.com>2007-11-21 12:54:54 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2008-01-25 03:08:08 -0500
commit002ef1dc63ded14507c110d3cf83d0c3f51374ab (patch)
treec81a66cdd0b8bf49a515141c669a2600e7b01140 /fs
parent1a2781cfa5ed8eb82bb311d684f268c1822dae69 (diff)
[GFS2] remove unnecessary permission checks
Remove read/write permission() checks from xattr operations. VFS layer is already handling permission for xattrs via the xattr_permission() call, so there is no need for gfs2 to check permissions. Futhermore, using permission() for SELinux xattrs ops is incorrect. Signed-off-by: Ryan O'Hara <rohara@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/eaops.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/fs/gfs2/eaops.c b/fs/gfs2/eaops.c
index aa8dbf303f6d..ef91b6e893a0 100644
--- a/fs/gfs2/eaops.c
+++ b/fs/gfs2/eaops.c
@@ -59,9 +59,6 @@ unsigned int gfs2_ea_name2type(const char *name, const char **truncated_name)
59static int user_eo_get(struct gfs2_inode *ip, struct gfs2_ea_request *er) 59static int user_eo_get(struct gfs2_inode *ip, struct gfs2_ea_request *er)
60{ 60{
61 struct inode *inode = &ip->i_inode; 61 struct inode *inode = &ip->i_inode;
62 int error = permission(inode, MAY_READ, NULL);
63 if (error)
64 return error;
65 62
66 return gfs2_ea_get_i(ip, er); 63 return gfs2_ea_get_i(ip, er);
67} 64}
@@ -70,14 +67,6 @@ static int user_eo_set(struct gfs2_inode *ip, struct gfs2_ea_request *er)
70{ 67{
71 struct inode *inode = &ip->i_inode; 68 struct inode *inode = &ip->i_inode;
72 69
73 if (S_ISREG(inode->i_mode) ||
74 (S_ISDIR(inode->i_mode) && !(inode->i_mode & S_ISVTX))) {
75 int error = permission(inode, MAY_WRITE, NULL);
76 if (error)
77 return error;
78 } else
79 return -EPERM;
80
81 return gfs2_ea_set_i(ip, er); 70 return gfs2_ea_set_i(ip, er);
82} 71}
83 72
@@ -85,14 +74,6 @@ static int user_eo_remove(struct gfs2_inode *ip, struct gfs2_ea_request *er)
85{ 74{
86 struct inode *inode = &ip->i_inode; 75 struct inode *inode = &ip->i_inode;
87 76
88 if (S_ISREG(inode->i_mode) ||
89 (S_ISDIR(inode->i_mode) && !(inode->i_mode & S_ISVTX))) {
90 int error = permission(inode, MAY_WRITE, NULL);
91 if (error)
92 return error;
93 } else
94 return -EPERM;
95
96 return gfs2_ea_remove_i(ip, er); 77 return gfs2_ea_remove_i(ip, er);
97} 78}
98 79
@@ -108,8 +89,6 @@ static int system_eo_get(struct gfs2_inode *ip, struct gfs2_ea_request *er)
108 GFS2_ACL_IS_DEFAULT(er->er_name, er->er_name_len))) 89 GFS2_ACL_IS_DEFAULT(er->er_name, er->er_name_len)))
109 return -EOPNOTSUPP; 90 return -EOPNOTSUPP;
110 91
111
112
113 return gfs2_ea_get_i(ip, er); 92 return gfs2_ea_get_i(ip, er);
114} 93}
115 94
@@ -173,9 +152,6 @@ static int system_eo_remove(struct gfs2_inode *ip, struct gfs2_ea_request *er)
173static int security_eo_get(struct gfs2_inode *ip, struct gfs2_ea_request *er) 152static int security_eo_get(struct gfs2_inode *ip, struct gfs2_ea_request *er)
174{ 153{
175 struct inode *inode = &ip->i_inode; 154 struct inode *inode = &ip->i_inode;
176 int error = permission(inode, MAY_READ, NULL);
177 if (error)
178 return error;
179 155
180 return gfs2_ea_get_i(ip, er); 156 return gfs2_ea_get_i(ip, er);
181} 157}
@@ -183,9 +159,6 @@ static int security_eo_get(struct gfs2_inode *ip, struct gfs2_ea_request *er)
183static int security_eo_set(struct gfs2_inode *ip, struct gfs2_ea_request *er) 159static int security_eo_set(struct gfs2_inode *ip, struct gfs2_ea_request *er)
184{ 160{
185 struct inode *inode = &ip->i_inode; 161 struct inode *inode = &ip->i_inode;
186 int error = permission(inode, MAY_WRITE, NULL);
187 if (error)
188 return error;
189 162
190 return gfs2_ea_set_i(ip, er); 163 return gfs2_ea_set_i(ip, er);
191} 164}
@@ -193,9 +166,6 @@ static int security_eo_set(struct gfs2_inode *ip, struct gfs2_ea_request *er)
193static int security_eo_remove(struct gfs2_inode *ip, struct gfs2_ea_request *er) 166static int security_eo_remove(struct gfs2_inode *ip, struct gfs2_ea_request *er)
194{ 167{
195 struct inode *inode = &ip->i_inode; 168 struct inode *inode = &ip->i_inode;
196 int error = permission(inode, MAY_WRITE, NULL);
197 if (error)
198 return error;
199 169
200 return gfs2_ea_remove_i(ip, er); 170 return gfs2_ea_remove_i(ip, er);
201} 171}