diff options
author | Ahmed Samy <f.fallen45@gmail.com> | 2016-04-17 05:37:09 (GMT) |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2016-04-17 15:24:46 (GMT) |
commit | 6545b60baaf880b0cd29a5e89dbe745a06027e89 (patch) | |
tree | e62ed5c8c4263e76c339804d74b47caff975076f /drivers/md | |
parent | 9567366fefddeaea4ed1d713270535d93a3b3c76 (diff) | |
download | linux-6545b60baaf880b0cd29a5e89dbe745a06027e89.tar.xz |
dm cache metadata: fix cmd_read_lock() acquiring write lock
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")
Cc: stable@vger.kernel.org
Signed-off-by: Ahmed Samy <f.fallen45@gmail.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-cache-metadata.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c index 65ce698..3970cda 100644 --- 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_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; |