diff options
author | NeilBrown <neilb@suse.de> | 2015-06-12 11:46:44 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-06-12 12:16:16 +0200 |
commit | c008f1d356277a5b7561040596a073d87e56b0c8 (patch) | |
tree | 6d7eb913a79b11f8ed9beee30c81eca81e271ed2 /drivers | |
parent | Linux 4.1-rc6 (diff) | |
download | linux-c008f1d356277a5b7561040596a073d87e56b0c8.tar.xz linux-c008f1d356277a5b7561040596a073d87e56b0c8.zip |
md: don't return 0 from array_state_store
Returning zero from a 'store' function is bad.
The return value should be either len length of the string
or an error.
So use 'len' if 'err' is zero.
Fixes: 6791875e2e53 ("md: make reconfig_mutex optional for writes to md sysfs files.")
Signed-off-by: NeilBrown <neilb@suse.de>
Cc: stable@vger.kernel (v4.0+)
Diffstat (limited to '')
-rw-r--r-- | drivers/md/md.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 27506302eb7a..dd59d71ade2f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -3834,7 +3834,7 @@ array_state_store(struct mddev *mddev, const char *buf, size_t len) err = -EBUSY; } spin_unlock(&mddev->lock); - return err; + return err ?: len; } err = mddev_lock(mddev); if (err) |