提交 6545b60b 编写于 作者: A Ahmed Samy 提交者: Mike Snitzer

dm cache metadata: fix cmd_read_lock() acquiring write lock

Commit 9567366f ("dm cache metadata: fix READ_LOCK macros and
cleanup WRITE_LOCK macros") uses down_write() instead of down_read() in
cmd_read_lock(), yet up_read() is used to release the lock in
READ_UNLOCK().  Fix it.

Fixes: 9567366f ("dm cache metadata: fix READ_LOCK macros and cleanup WRITE_LOCK macros")
Cc: stable@vger.kernel.org
Signed-off-by: NAhmed Samy <f.fallen45@gmail.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
上级 9567366f
......@@ -894,9 +894,9 @@ static bool cmd_write_lock(struct dm_cache_metadata *cmd)
static bool cmd_read_lock(struct dm_cache_metadata *cmd)
{
down_write(&cmd->root_lock);
down_read(&cmd->root_lock);
if (cmd->fail_io) {
up_write(&cmd->root_lock);
up_read(&cmd->root_lock);
return false;
}
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册