From: Maneesh Soni Date: Fri, 29 Jul 2005 19:14:19 +0000 (-0700) Subject: [PATCH] sysfs: fix sysfs_setattr X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9ca1eb3282b6050c295adb296761f8d26baf4ca5;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds --- diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 8de13bafaa76..d727dc960634 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c @@ -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;