Repository navigation
Commit e0ee8d9
nbd: Aovid double completion of a request
[ Upstream commit cddce01 ]
There is a race between iterating over requests in
nbd_clear_que() and completing requests in recv_work(),
which can lead to double completion of a request.
To fix it, flush the recv worker before iterating over
the requests and don't abort the completed request
while iterating.
Fixes: 96d97e1 ("nbd: clear_sock on netlink disconnect")
Reported-by: Jiang Yadong <jiangyadong@bytedance.com>
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Link: https://lore.kernel.org/r/20210813151330.96-1-xieyongji@bytedance.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent f5cefe9 commit e0ee8d9
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
812 | 812 | | |
813 | 813 | | |
814 | 814 | | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
815 | 819 | | |
816 | 820 | | |
817 | 821 | | |
| |||
2024 | 2028 | | |
2025 | 2029 | | |
2026 | 2030 | | |
2027 | | - | |
2028 | | - | |
| 2031 | + | |
2029 | 2032 | | |
2030 | 2033 | | |
2031 | 2034 | | |
2032 | | - | |
| 2035 | + | |
| 2036 | + | |
2033 | 2037 | | |
2034 | 2038 | | |
2035 | 2039 | | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
2036 | 2044 | | |
2037 | 2045 | | |
2038 | 2046 | | |
| |||
0 commit comments