提交 d287483d 编写于 作者: A Alasdair G Kergon 提交者: Linus Torvalds

[PATCH] dm: suspend: fix error path

If the device is already suspended, just return the error and skip the code
that would incorrectly wipe md->suspended_bdev.

(This isn't currently a problem because existing code avoids calling this
function if the device is already suspended.)
Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
Cc: <dm-devel@redhat.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 bfc5ecdf
......@@ -1285,7 +1285,7 @@ int dm_suspend(struct mapped_device *md, int do_lockfs)
down(&md->suspend_lock);
if (dm_suspended(md))
goto out;
goto out_unlock;
map = dm_get_table(md);
......@@ -1361,6 +1361,8 @@ int dm_suspend(struct mapped_device *md, int do_lockfs)
}
dm_table_put(map);
out_unlock:
up(&md->suspend_lock);
return r;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册