Xiubo Li <xiubli@xxxxxxxxxx> writes: > On 29/03/2023 22:41, Luís Henriques wrote: <...> > This also looks good to me. As I remembered when reading the kernel code I just > saw another place in VFS is also doing like this and I just followed it. >> But... even with my suggestion, can't we deadlock here if we get preempted >> just before the wait_for_completion() and ceph_dec_stopping_blocker() is >> executed? > > Good question. Actually it won't. Yeah, you're right. Doh! > The 'x->done' member in the completion will be initialized as 0, and the > complete_all() will set it to 'UINT_MAX'. And only when 'x->done == 0' will the > wait_for_completion() go to sleep and wait. Cheers, -- Luís