[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160503000555.418852883@linuxfoundation.org>
Date: Mon, 2 May 2016 17:10:23 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Ahmed Samy <f.fallen45@...il.com>,
Mike Snitzer <snitzer@...hat.com>
Subject: [PATCH 4.5 024/200] dm cache metadata: fix cmd_read_lock() acquiring write lock
4.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahmed Samy <f.fallen45@...il.com>
commit 6545b60baaf880b0cd29a5e89dbe745a06027e89 upstream.
Commit 9567366fefdd ("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: 9567366fefdd ("dm cache metadata: fix READ_LOCK macros and cleanup WRITE_LOCK macros")
Signed-off-by: Ahmed Samy <f.fallen45@...il.com>
Signed-off-by: Mike Snitzer <snitzer@...hat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/md/dm-cache-metadata.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -894,9 +894,9 @@ static bool cmd_write_lock(struct dm_cac
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;
Powered by blists - more mailing lists