Skip to contentSkip to conversation

sysfs: call attr_kill_to_mode from sysfs_setattr

PATCH New Jeff Layton 1 participant 1 message Aug 6, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 21/25 sysfs: call attr_kill_to_mode from sysfs_setattr

..and only save off ia_valid after it returns

---
 fs/sysfs/inode.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
fs/sysfs/inode.c +4 -1
index 10d1b52..38f2ba9 100644
@@ -49,7 +49,7 @@ int sysfs_setattr(struct dentry * dentry, struct iattr * iattr)
 	struct inode * inode = dentry->d_inode;
 	struct sysfs_dirent * sd = dentry->d_fsdata;
 	struct iattr * sd_iattr;
-	unsigned int ia_valid = iattr->ia_valid;
+	unsigned int ia_valid;
 	int error;
 
 	if (!sd)
@@ -57,6 +57,9 @@ int sysfs_setattr(struct dentry * dentry, struct iattr * iattr)
 
 	sd_iattr = sd->s_iattr;
 
+	attr_kill_to_mode(inode, iattr);
+	ia_valid = iattr->ia_valid;
+
 	error = inode_change_ok(inode, iattr);
 	if (error)
 		return error;
Signature · 1 line
1.5.2.2