summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2015-06-12 19:46:44 +1000
committerNeilBrown <neilb@suse.de>2015-06-12 20:16:16 +1000
commitc008f1d356277a5b7561040596a073d87e56b0c8 (patch)
tree6d7eb913a79b11f8ed9beee30c81eca81e271ed2
parentc65b99f046843d2455aa231747b5a07a999a9f3d (diff)
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+)
-rw-r--r--drivers/md/md.c2
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)