summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMinfei Huang <mnghuan@gmail.com>2016-09-06 10:00:29 +0200
committerMike Snitzer <snitzer@redhat.com>2016-09-14 19:56:38 +0200
commit8dc23658b7aaa8b6b0609c81c8ad75e98b612801 (patch)
treefa802482524c9470f181cbc1d63e6a4c4bc28daf /drivers/md
parentblk-mq: introduce blk_mq_delay_kick_requeue_list() (diff)
downloadlinux-8dc23658b7aaa8b6b0609c81c8ad75e98b612801.tar.xz
linux-8dc23658b7aaa8b6b0609c81c8ad75e98b612801.zip
dm: return correct error code in dm_resume()'s retry loop
dm_resume() will return success (0) rather than -EINVAL if !dm_suspended_md() upon retry within dm_resume(). Reset the error code at the start of dm_resume()'s retry loop. Also, remove a useless assignment at the end of dm_resume(). Fixes: ffcc393641 ("dm: enhance internal suspend and resume interface") Cc: stable@vger.kernel.org # 3.19+ Signed-off-by: Minfei Huang <mnghuan@gmail.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index fa9b1cb4438a..c0742129a9cb 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2249,10 +2249,11 @@ static int __dm_resume(struct mapped_device *md, struct dm_table *map)
int dm_resume(struct mapped_device *md)
{
- int r = -EINVAL;
+ int r;
struct dm_table *map = NULL;
retry:
+ r = -EINVAL;
mutex_lock_nested(&md->suspend_lock, SINGLE_DEPTH_NESTING);
if (!dm_suspended_md(md))
@@ -2276,8 +2277,6 @@ retry:
goto out;
clear_bit(DMF_SUSPENDED, &md->flags);
-
- r = 0;
out:
mutex_unlock(&md->suspend_lock);