diff options
author | Maneesh Soni <maneesh@in.ibm.com> | 2005-07-29 15:14:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-29 16:12:49 -0400 |
commit | 9ca1eb3282b6050c295adb296761f8d26baf4ca5 (patch) | |
tree | 1750560628f01102186150f62791703ea3bde6e8 /fs/sysfs | |
parent | bc062b1b5c6bef4e3a29c7fda57967251d12beb0 (diff) |
[PATCH] sysfs: fix sysfs_setattr
o sysfs_dirent's s_mode field should also be updated in sysfs_setattr(), else
there could be inconsistency in the two fields. s_mode is used while
->readdir so as not to bring in the inode to cache.
Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/sysfs')
-rw-r--r-- | fs/sysfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 8de13bafaa7..d727dc96063 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -85,7 +85,7 @@ int sysfs_setattr(struct dentry * dentry, struct iattr * iattr) | |||
85 | 85 | ||
86 | if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID)) | 86 | if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID)) |
87 | mode &= ~S_ISGID; | 87 | mode &= ~S_ISGID; |
88 | sd_iattr->ia_mode = mode; | 88 | sd_iattr->ia_mode = sd->s_mode = mode; |
89 | } | 89 | } |
90 | 90 | ||
91 | return error; | 91 | return error; |