Skip to content

Commit 6545b60

Browse files
asamysnitm
authored andcommitted
dm cache metadata: fix cmd_read_lock() acquiring write lock
Commit 9567366 ("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: 9567366 ("dm cache metadata: fix READ_LOCK macros and cleanup WRITE_LOCK macros") Cc: stable@vger.kernel.org Signed-off-by: Ahmed Samy <f.fallen45@gmail.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
1 parent 9567366 commit 6545b60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/md/dm-cache-metadata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,9 +894,9 @@ static bool cmd_write_lock(struct dm_cache_metadata *cmd)
894894

895895
static bool cmd_read_lock(struct dm_cache_metadata *cmd)
896896
{
897-
down_write(&cmd->root_lock);
897+
down_read(&cmd->root_lock);
898898
if (cmd->fail_io) {
899-
up_write(&cmd->root_lock);
899+
up_read(&cmd->root_lock);
900900
return false;
901901
}
902902
return true;

0 commit comments

Comments
 (0)