Skip to content

Commit ad5a88c

Browse files
chaseyugregkh
authored andcommitted
ext4: check return value of kstrtoull correctly in reserved_clusters_store
commit 1ea1516fbbab2b30bf98c534ecaacba579a35208 upstream. 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 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent cb2bc13 commit ad5a88c

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)