diff --git a/[refs] b/[refs] index b99bb3c6eac6..4669616e88b7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7a62cc10215838286c747f86766063d5f01fcbd6 +refs/heads/master: 05cc0cee6948fc11985d11557fb130645a7f69a6 diff --git a/trunk/fs/libfs.c b/trunk/fs/libfs.c index 662a28e4f667..219576c52d80 100644 --- a/trunk/fs/libfs.c +++ b/trunk/fs/libfs.c @@ -739,10 +739,11 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf, if (copy_from_user(attr->set_buf, buf, size)) goto out; - ret = len; /* claim we got the whole input */ attr->set_buf[size] = '\0'; val = simple_strtol(attr->set_buf, NULL, 0); - attr->set(attr->data, val); + ret = attr->set(attr->data, val); + if (ret == 0) + ret = len; /* on success, claim we got the whole input */ out: mutex_unlock(&attr->mutex); return ret;