Commit e3a7c29
dm bufio: fix some cases where the code sleeps with spinlock held
Commit b32d458 ("dm bufio: Add DM_BUFIO_CLIENT_NO_SLEEP flag")
added a "NO_SLEEP" mode, it replaces a mutex with a spinlock, and it
is only usable when the device is in read-only mode (because the write
path may be sleeping while holding the dm_bufio_client lock).
However, there are still two points where the code could sleep even in
read-only mode. One is in __get_unclaimed_buffer -> __make_buffer_clean.
The other is in __try_evict_buffer -> __make_buffer_clean. These functions
will call __make_buffer_clean which sleeps if the buffer is being read.
Fix these cases so that if c->no_sleep is set __make_buffer_clean
will not be called and the buffer will be skipped instead.
Fixes: b32d458 ("dm bufio: Add DM_BUFIO_CLIENT_NO_SLEEP flag")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>1 parent b7f362d commit e3a7c29
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
818 | 822 | | |
819 | 823 | | |
820 | 824 | | |
| |||
823 | 827 | | |
824 | 828 | | |
825 | 829 | | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
826 | 833 | | |
827 | 834 | | |
828 | 835 | | |
| |||
1632 | 1639 | | |
1633 | 1640 | | |
1634 | 1641 | | |
1635 | | - | |
| 1642 | + | |
| 1643 | + | |
1636 | 1644 | | |
1637 | 1645 | | |
1638 | 1646 | | |
| |||
0 commit comments