]> git.baikalelectronics.ru Git - kernel.git/commit
dm integrity: fix deadlock with overlapping I/O
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 5 Apr 2019 19:26:39 +0000 (15:26 -0400)
committerMike Snitzer <snitzer@redhat.com>
Fri, 5 Apr 2019 22:49:08 +0000 (18:49 -0400)
commit9ae9113188bde1f3ab882ac9638af7c8cef11d62
treeb7b1c42338a40692cde5a854406b61adb2c4d3c9
parent64bea3bf6c804ed5946eeb89c7fa24109a7887ae
dm integrity: fix deadlock with overlapping I/O

dm-integrity will deadlock if overlapping I/O is issued to it, the bug
was introduced by commit f46fa52a89c5 ("dm integrity: implement fair
range locks").  Users rarely use overlapping I/O so this bug went
undetected until now.

Fix this bug by correcting, likely cut-n-paste, typos in
ranges_overlap() and also remove a flawed ranges_overlap() check in
remove_range_unlocked().  This condition could leave unprocessed bios
hanging on wait_list forever.

Cc: stable@vger.kernel.org # v4.19+
Fixes: f46fa52a89c5 ("dm integrity: implement fair range locks")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-integrity.c