ext4: check return value of kstrtoull correctly in reserved_clusters_store
authorChao Yu <yuchao0@huawei.com>
Fri, 23 Jun 2017 05:08:22 +0000 (01:08 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Jul 2017 11:04:41 +0000 (13:04 +0200)
commit2f7921d8de1ce28f3dd2250dc05e57c0fcbf6f21
tree62b4c9f5fcde1b4f455b318d826b029f615e3bc8
parentab28946bbc8ebc1781fe34e209a644a9282a17a2
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: 76d33bca5581b1dd5c3157fa168db849a784ada4
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>
fs/ext4/sysfs.c