aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/configfs/inode.c9
-rw-r--r--fs/sysfs/inode.c6
-rw-r--r--lib/kobject_uevent.c3
3 files changed, 11 insertions, 7 deletions
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index 41645142b88b..cf78d44a8d6a 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -72,10 +72,6 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr)
72 if (!sd) 72 if (!sd)
73 return -EINVAL; 73 return -EINVAL;
74 74
75 error = simple_setattr(dentry, iattr);
76 if (error)
77 return error;
78
79 sd_iattr = sd->s_iattr; 75 sd_iattr = sd->s_iattr;
80 if (!sd_iattr) { 76 if (!sd_iattr) {
81 /* setting attributes for the first time, allocate now */ 77 /* setting attributes for the first time, allocate now */
@@ -89,9 +85,12 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr)
89 sd_iattr->ia_atime = sd_iattr->ia_mtime = sd_iattr->ia_ctime = CURRENT_TIME; 85 sd_iattr->ia_atime = sd_iattr->ia_mtime = sd_iattr->ia_ctime = CURRENT_TIME;
90 sd->s_iattr = sd_iattr; 86 sd->s_iattr = sd_iattr;
91 } 87 }
92
93 /* attributes were changed atleast once in past */ 88 /* attributes were changed atleast once in past */
94 89
90 error = simple_setattr(dentry, iattr);
91 if (error)
92 return error;
93
95 if (ia_valid & ATTR_UID) 94 if (ia_valid & ATTR_UID)
96 sd_iattr->ia_uid = iattr->ia_uid; 95 sd_iattr->ia_uid = iattr->ia_uid;
97 if (ia_valid & ATTR_GID) 96 if (ia_valid & ATTR_GID)
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index bde1a4c3679a..0835a3b70e03 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -117,11 +117,13 @@ int sysfs_setattr(struct dentry *dentry, struct iattr *iattr)
117 if (error) 117 if (error)
118 goto out; 118 goto out;
119 119
120 error = sysfs_sd_setattr(sd, iattr);
121 if (error)
122 goto out;
123
120 /* this ignores size changes */ 124 /* this ignores size changes */
121 generic_setattr(inode, iattr); 125 generic_setattr(inode, iattr);
122 126
123 error = sysfs_sd_setattr(sd, iattr);
124
125out: 127out:
126 mutex_unlock(&sysfs_mutex); 128 mutex_unlock(&sysfs_mutex);
127 return error; 129 return error;
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 59c15511d58a..b93579504dfa 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -83,6 +83,7 @@ out:
83 return ret; 83 return ret;
84} 84}
85 85
86#ifdef CONFIG_NET
86static int kobj_bcast_filter(struct sock *dsk, struct sk_buff *skb, void *data) 87static int kobj_bcast_filter(struct sock *dsk, struct sk_buff *skb, void *data)
87{ 88{
88 struct kobject *kobj = data; 89 struct kobject *kobj = data;
@@ -98,6 +99,7 @@ static int kobj_bcast_filter(struct sock *dsk, struct sk_buff *skb, void *data)
98 99
99 return 0; 100 return 0;
100} 101}
102#endif
101 103
102static int kobj_usermode_filter(struct kobject *kobj) 104static int kobj_usermode_filter(struct kobject *kobj)
103{ 105{
@@ -378,6 +380,7 @@ static int uevent_net_init(struct net *net)
378 if (!ue_sk->sk) { 380 if (!ue_sk->sk) {
379 printk(KERN_ERR 381 printk(KERN_ERR
380 "kobject_uevent: unable to create netlink socket!\n"); 382 "kobject_uevent: unable to create netlink socket!\n");
383 kfree(ue_sk);
381 return -ENODEV; 384 return -ENODEV;
382 } 385 }
383 mutex_lock(&uevent_sock_mutex); 386 mutex_lock(&uevent_sock_mutex);