aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/inode.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2010-05-31 17:58:02 +1000
committerAl Viro <viro@zeniv.linux.org.uk>2010-06-04 17:16:29 -0400
commit8718d36cf99f5acf0f37487557ec25aee54b930b (patch)
tree3417c944630f4719dcee113ceb646e5ad743cee6 /fs/sysfs/inode.c
parent5b54470daded19d83ea2bbf5f6bc12662942cd63 (diff)
downloadkernel_samsung_aries-8718d36cf99f5acf0f37487557ec25aee54b930b.zip
kernel_samsung_aries-8718d36cf99f5acf0f37487557ec25aee54b930b.tar.gz
kernel_samsung_aries-8718d36cf99f5acf0f37487557ec25aee54b930b.tar.bz2
fix setattr error handling in sysfs, configfs
sysfs and configfs setattr functions have error cases after the generic inode's attributes have been changed. Fix consistency by changing the generic inode attributes only when it is guaranteed to succeed. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r--fs/sysfs/inode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index bde1a4c..0835a3b 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -117,11 +117,13 @@ int sysfs_setattr(struct dentry *dentry, struct iattr *iattr)
if (error)
goto out;
+ error = sysfs_sd_setattr(sd, iattr);
+ if (error)
+ goto out;
+
/* this ignores size changes */
generic_setattr(inode, iattr);
- error = sysfs_sd_setattr(sd, iattr);
-
out:
mutex_unlock(&sysfs_mutex);
return error;