提交 8dc23658 编写于 作者: M Minfei Huang 提交者: Mike Snitzer

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: ffcc3936 ("dm: enhance internal suspend and resume interface")
Cc: stable@vger.kernel.org # 3.19+
Signed-off-by: NMinfei Huang <mnghuan@gmail.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
上级 2849450a
......@@ -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 @@ int dm_resume(struct mapped_device *md)
goto out;
clear_bit(DMF_SUSPENDED, &md->flags);
r = 0;
out:
mutex_unlock(&md->suspend_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册