Skip to content

Commit

Permalink
[PATCH] sysfs: fix sysfs_setattr
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Maneesh Soni authored and Linus Torvalds committed Jul 29, 2005
1 parent bc062b1 commit 9ca1eb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/sysfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int sysfs_setattr(struct dentry * dentry, struct iattr * iattr)

if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
mode &= ~S_ISGID;
sd_iattr->ia_mode = mode;
sd_iattr->ia_mode = sd->s_mode = mode;
}

return error;
Expand Down

0 comments on commit 9ca1eb3

Please sign in to comment.