Commit cddce01
nbd: Aovid double completion of a request
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>1 parent 454bb67 commit cddce01
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
821 | 825 | | |
822 | 826 | | |
823 | 827 | | |
| |||
2004 | 2008 | | |
2005 | 2009 | | |
2006 | 2010 | | |
2007 | | - | |
2008 | | - | |
| 2011 | + | |
2009 | 2012 | | |
2010 | 2013 | | |
2011 | 2014 | | |
2012 | | - | |
| 2015 | + | |
| 2016 | + | |
2013 | 2017 | | |
2014 | 2018 | | |
2015 | 2019 | | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
2016 | 2024 | | |
2017 | 2025 | | |
2018 | 2026 | | |
| |||
0 commit comments