summaryrefslogtreecommitdiff
path: root/fs/ext4/sysfs.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2017-06-23 01:08:22 -0400
committerTheodore Ts'o <tytso@mit.edu>2017-06-23 01:08:22 -0400
commit1ea1516fbbab2b30bf98c534ecaacba579a35208 (patch)
tree4a17a8c944a67eb2e00ea0fadad1fdeda3e967b4 /fs/ext4/sysfs.c
parent4a4956249dac0b9b0027949907bff0cd1a9b57fa (diff)
downloadlwn-1ea1516fbbab2b30bf98c534ecaacba579a35208.tar.gz
lwn-1ea1516fbbab2b30bf98c534ecaacba579a35208.zip
ext4: check return value of kstrtoull correctly in reserved_clusters_store
kstrtoull returns 0 on success, however, in reserved_clusters_store we will return -EINVAL if kstrtoull returns 0, it makes us fail to update reserved_clusters value through sysfs. Fixes: 76d33bca5581b1dd5c3157fa168db849a784ada4 Cc: stable@vger.kernel.org # 4.4 Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Miao Xie <miaoxie@huawei.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/sysfs.c')
-rw-r--r--fs/ext4/sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/sysfs.c b/fs/ext4/sysfs.c
index d74dc5f81a04..48c7a7d55ed3 100644
--- a/fs/ext4/sysfs.c
+++ b/fs/ext4/sysfs.c
@@ -100,7 +100,7 @@ static ssize_t reserved_clusters_store(struct ext4_attr *a,
int ret;
ret = kstrtoull(skip_spaces(buf), 0, &val);
- if (!ret || val >= clusters)
+ if (ret || val >= clusters)
return -EINVAL;
atomic64_set(&sbi->s_resv_clusters, val);