[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170623092800.eize6ayzkvngpseq@mwanda>
Date: Fri, 23 Jun 2017 12:28:00 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: "Theodore Ts'o" <tytso@....edu>
Cc: Andreas Dilger <adilger.kernel@...ger.ca>,
linux-ext4@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH] ext4: fix reserved_clusters_store()
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@...cle.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);
Powered by blists - more mailing lists