public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: fix reserved_clusters_store()
@ 2017-06-23  9:28 Dan Carpenter
  2017-06-23 12:14 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-06-23  9:28 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Andreas Dilger, linux-ext4, kernel-janitors

The test if kstrtoull() failed is reversed so we can't set cluster_store
any more.

Fixes: 76d33bca5581 ("ext4: refactor sysfs support code")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/ext4/sysfs.c b/fs/ext4/sysfs.c
index d74dc5f81a04..5d543523f479 100644
--- a/fs/ext4/sysfs.c
+++ b/fs/ext4/sysfs.c
@@ -100,7 +100,9 @@ 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)
+		return ret;
+	if (val >= clusters)
 		return -EINVAL;
 
 	atomic64_set(&sbi->s_resv_clusters, val);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-23 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-23  9:28 [PATCH] ext4: fix reserved_clusters_store() Dan Carpenter
2017-06-23 12:14 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox