diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-04-17 15:30:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-04-17 15:30:06 -0400 |
commit | 9d090d01e3efdcdb8f7f07e86fcac91e01ae30cd (patch) | |
tree | 682aa81166cf120ef72e4d402fdd5a2c3cc2e179 | |
parent | b9f5dba225aede4518ab0a7374c2dc38c7c049ce (diff) | |
parent | 6545b60baaf880b0cd29a5e89dbe745a06027e89 (diff) |
Merge tag 'dm-4.6-fix-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
Pull device mapper fix from Mike Snitzer:
"Fix for earlier 4.6-rc4 stable@ commit that introduced improper use of
write lock in cmd_read_lock() -- due to cut-n-paste gone awry (and
sparse didn't catch it)"
* tag 'dm-4.6-fix-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
dm cache metadata: fix cmd_read_lock() acquiring write lock
-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 65ce6985f87a..3970cda10080 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) | |||
894 | 894 | ||
895 | static bool cmd_read_lock(struct dm_cache_metadata *cmd) | 895 | static bool cmd_read_lock(struct dm_cache_metadata *cmd) |
896 | { | 896 | { |
897 | down_write(&cmd->root_lock); | 897 | down_read(&cmd->root_lock); |
898 | if (cmd->fail_io) { | 898 | if (cmd->fail_io) { |
899 | up_write(&cmd->root_lock); | 899 | up_read(&cmd->root_lock); |
900 | return false; | 900 | return false; |
901 | } | 901 | } |
902 | return true; | 902 | return true; |