Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1686746

[PATCH 4.11 8/9] ext4: check return value of kstrtoull correctly in reserved_clusters_store

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.11 8/9] ext4: check return value of kstrtoull correctly in reserved_clusters_store
Date 2017-07-13 18:10 +0200
Message-ID <u2OQH-7O6-49@gated-at.bofh.it> (permalink)
References <u2Oxl-7s0-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.11-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chao Yu <yuchao0@huawei.com>

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 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/ext4/sysfs.c
+++ b/fs/ext4/sysfs.c
@@ -100,7 +100,7 @@ static ssize_t reserved_clusters_store(s
 	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);

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.11 0/9] 4.11.11-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-13 17:50 +0200
  [PATCH 4.11 3/9] locking/rwsem-spinlock: Fix EINTR branch in __down_write_common() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-13 17:50 +0200
  [PATCH 4.11 1/9] mqueue: fix a use-after-free in sys_mq_notify() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-13 17:50 +0200
  [PATCH 4.11 2/9] proc: Fix proc_sys_prune_dcache to hold a sb reference Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-13 18:10 +0200
  [PATCH 4.11 8/9] ext4: check return value of kstrtoull correctly in reserved_clusters_store Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-13 18:10 +0200
  [PATCH 4.11 9/9] x86/mm/pat: Dont report PAT on CPUs that dont support it Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-13 18:10 +0200
  Re: [PATCH 4.11 0/9] 4.11.11-stable review Guenter Roeck <linux@roeck-us.net> - 2017-07-14 03:50 +0200

csiph-web