diff --git a/[refs] b/[refs] index 5f09e3bc470f..07b77caed13d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 181b2e4be1603ce3ccace8322047a548f29f4b20 +refs/heads/master: f88123eaf953f13a0c597dde54745d28f81236de diff --git a/trunk/fs/sysfs/file.c b/trunk/fs/sysfs/file.c index ff93c92164b3..9fdf8dae0dcd 100644 --- a/trunk/fs/sysfs/file.c +++ b/trunk/fs/sysfs/file.c @@ -521,10 +521,19 @@ int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode) } inode = victim->d_inode; + mutex_lock(&inode->i_mutex); + newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO); newattrs.ia_valid = ATTR_MODE | ATTR_CTIME; rc = notify_change(victim, &newattrs); + + if (rc == 0) { + mutex_lock(&sysfs_mutex); + victim_sd->s_mode = newattrs.ia_mode; + mutex_unlock(&sysfs_mutex); + } + mutex_unlock(&inode->i_mutex); out: dput(victim);