Skip to content
Commit cddce011 authored by Xie Yongji's avatar Xie Yongji Committed by Jens Axboe
Browse files

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: 96d97e17

 ("nbd: clear_sock on netlink disconnect")
Reported-by: default avatarJiang Yadong <jiangyadong@bytedance.com>
Signed-off-by: default avatarXie Yongji <xieyongji@bytedance.com>
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Link: https://lore.kernel.org/r/20210813151330.96-1-xieyongji@bytedance.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 454bb677
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment