From: Andrew Morton Date: Tue, 19 Jun 2012 23:55:58 +0000 (+1000) Subject: notify_change(): check that i_mutex is held X-Git-Tag: accepted/tizen/common/20141203.182822~4037^2~108 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4107b3097465e25f7d6a9b0ac0518b07b24e774;p=platform%2Fkernel%2Flinux-arm64.git notify_change(): check that i_mutex is held Cc: Djalal Harouni Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Al Viro --- diff --git a/fs/attr.c b/fs/attr.c index 0da9095..29e38a1 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -171,6 +171,8 @@ int notify_change(struct dentry * dentry, struct iattr * attr) struct timespec now; unsigned int ia_valid = attr->ia_valid; + WARN_ON_ONCE(!mutex_is_locked(&inode->i_mutex)); + if (ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_TIMES_SET)) { if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) return -EPERM; @@ -250,5 +252,4 @@ int notify_change(struct dentry * dentry, struct iattr * attr) return error; } - EXPORT_SYMBOL(notify_change);