From b06bf425083690166f867277f99939c6301efa98 Mon Sep 17 00:00:00 2001 From: Wu Fengguang Date: Fri, 18 Sep 2009 13:06:03 -0700 Subject: [PATCH] --- yaml --- r: 165866 b: refs/heads/master c: 05cc0cee6948fc11985d11557fb130645a7f69a6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/libfs.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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;