From maneesh@in.ibm.com Tue Jul 12 08:53:09 2005
Date: Tue, 12 Jul 2005 17:59:09 +0530
From: Maneesh Soni <maneesh@in.ibm.com>
To: gregkh@suse.de
Subject: sysfs: fix sysfs_setattr
Message-ID: <20050712122908.GC5971@in.ibm.com>

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>

---
 fs/sysfs/inode.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- gregkh-2.6.orig/fs/sysfs/inode.c	2005-07-13 09:45:07.000000000 -0700
+++ gregkh-2.6/fs/sysfs/inode.c	2005-07-27 17:09:31.000000000 -0700
@@ -85,7 +85,7 @@
 
 		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;
