Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67987
b: refs/heads/master
c: f88123e
h: refs/heads/master
i:
  67985: 9a678df
  67983: fcc7aad
v: v3
  • Loading branch information
Tejun Heo authored and Greg Kroah-Hartman committed Oct 12, 2007
1 parent 13f7957 commit 9da9318
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 181b2e4be1603ce3ccace8322047a548f29f4b20
refs/heads/master: f88123eaf953f13a0c597dde54745d28f81236de
9 changes: 9 additions & 0 deletions trunk/fs/sysfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9da9318

Please sign in to comment.