Skip to content

Commit 1ea1516

Browse files
chaseyutytso
authored andcommitted
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: 76d33bc 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>
1 parent 4a49562 commit 1ea1516

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/ext4/sysfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static ssize_t reserved_clusters_store(struct ext4_attr *a,
100100
int ret;
101101

102102
ret = kstrtoull(skip_spaces(buf), 0, &val);
103-
if (!ret || val >= clusters)
103+
if (ret || val >= clusters)
104104
return -EINVAL;
105105

106106
atomic64_set(&sbi->s_resv_clusters, val);

0 commit comments

Comments
 (0)