> Both pb_timer_func() and postpone_if_required_for_backup() decide
> whether to arm the timer under pb->lock but call mod_timer() after
> dropping it, so the decisions can be applied out of order:
> 
>   CPU1 pb_timer_func()            CPU2 postpone_if_required_for_backup()
>   lock; deadline = S64_MAX
>   unlock
>                                   lock; nr_delayed = 1
>                                   deadline_jiffies = now + timeout
>                                   unlock
>                                   mod_timer(timeout)
>   mod_timer(from S64_MAX)
> 
> The late mod_timer() of the callback overwrites the fresh deadline, and
> the write is delayed with the timer parked in a very distant future.
> [ ... ]
> pb->ctl_rwsem; the next patch removes that call.
> 
> Fixes: 62e07487348e ("dm: Add push backup driver")
> https://virtuozzo.atlassian.net/browse/VSTOR-152912
> Signed-off-by: Andrey Zhadchenko <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review ยท 
https://sashiko.vzint.dev/#/patchset/[email protected]?part=5


_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to