diff options
author | Minfei Huang <mnghuan@gmail.com> | 2016-09-06 16:00:29 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-28 03:45:21 -0400 |
commit | 35f46e73b6a00b5be185eed691613ba0ba54c6ed (patch) | |
tree | 9bbaafc2ad6f9ff8dbb511239a2b875a48304441 | |
parent | f8ce90291d3b3e50c7044c98c07e102e70d51181 (diff) |
dm: return correct error code in dm_resume()'s retry loop
commit 8dc23658b7aaa8b6b0609c81c8ad75e98b612801 upstream.
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")
Signed-off-by: Minfei Huang <mnghuan@gmail.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/md/dm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index da790e05152b..0f2928b3136b 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2254,10 +2254,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)) @@ -2281,8 +2282,6 @@ retry: goto out; clear_bit(DMF_SUSPENDED, &md->flags); - - r = 0; out: mutex_unlock(&md->suspend_lock); |