aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMimi Zohar <zohar@linux.vnet.ibm.com>2011-03-23 17:23:06 -0400
committerMimi Zohar <zohar@linux.vnet.ibm.com>2012-09-07 14:57:27 -0400
commit2ab51f3721f7abdf92d89cb79d3d6c0062ddc14b (patch)
tree75ffb5798218e106f20560ca9b13a17924cb77c9 /fs
parent2e4930eb7c8fb20a39dfb5f8a8f80402710dcea8 (diff)
vfs: extend vfs_removexattr locking
This patch takes the i_mutex lock before security_inode_removexattr(), instead of after, in preparation of calling ima_inode_removexattr(). Signed-off-by: Mimi Zohar <zohar@us.ibm.com> Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xattr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/xattr.c b/fs/xattr.c
index 4d45b7189e7e..107f457143c3 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -295,11 +295,13 @@ vfs_removexattr(struct dentry *dentry, const char *name)
295 if (error) 295 if (error)
296 return error; 296 return error;
297 297
298 mutex_lock(&inode->i_mutex);
298 error = security_inode_removexattr(dentry, name); 299 error = security_inode_removexattr(dentry, name);
299 if (error) 300 if (error) {
301 mutex_unlock(&inode->i_mutex);
300 return error; 302 return error;
303 }
301 304
302 mutex_lock(&inode->i_mutex);
303 error = inode->i_op->removexattr(dentry, name); 305 error = inode->i_op->removexattr(dentry, name);
304 mutex_unlock(&inode->i_mutex); 306 mutex_unlock(&inode->i_mutex);
305 307