]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/sysfs/inode.c
fix setattr error handling in sysfs, configfs
[net-next-2.6.git] / fs / sysfs / inode.c
index bde1a4c3679a3c38bb5005a473fce4c8e3037e54..0835a3b70e03b01738a8ef18493e1c6180432acd 100644 (file)
@@ -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;