diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2012-06-19 19:55:58 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-14 08:35:42 -0400 |
commit | c4107b3097465e25f7d6a9b0ac0518b07b24e774 (patch) | |
tree | 55586999886b01a548608936ca58ccd038604235 | |
parent | b5fb63c18315c5510c1d0636179c057e0c761c77 (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>
-rw-r--r-- | fs/attr.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 | |||
254 | EXPORT_SYMBOL(notify_change); | 255 | EXPORT_SYMBOL(notify_change); |