aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2012-06-19 19:55:58 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 08:35:42 -0400
commitc4107b3097465e25f7d6a9b0ac0518b07b24e774 (patch)
tree55586999886b01a548608936ca58ccd038604235 /fs
parentb5fb63c18315c5510c1d0636179c057e0c761c77 (diff)
notify_change(): check that i_mutex is held
Cc: Djalal Harouni <tixxdz@opendz.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/attr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/attr.c b/fs/attr.c
index 0da90951d277..29e38a1f7f77 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -171,6 +171,8 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
171 struct timespec now; 171 struct timespec now;
172 unsigned int ia_valid = attr->ia_valid; 172 unsigned int ia_valid = attr->ia_valid;
173 173
174 WARN_ON_ONCE(!mutex_is_locked(&inode->i_mutex));
175
174 if (ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_TIMES_SET)) { 176 if (ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_TIMES_SET)) {
175 if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) 177 if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
176 return -EPERM; 178 return -EPERM;
@@ -250,5 +252,4 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
250 252
251 return error; 253 return error;
252} 254}
253
254EXPORT_SYMBOL(notify_change); 255EXPORT_SYMBOL(notify_change);