[Devel] [PATCH hci-8.2 v2 2/2] dm/push_backup: free the bitmaps of an expired session on restart
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Tue Dec 1 03:15:04 MSK 2026
> When a backup session expires, cleanup_backup() clears pb->alive but
> keeps pb->map and pb->pending_map, so that the target status can still
> report the session as expired. push_backup_start() refuses to start
> only while pb->alive is set, so a start after an expiry goes on to
> setup_pb(), which overwrites both pointers with new bitmaps. The old
> bitmaps are never freed, because push_backup_stop() and pb_destroy()
> free only the current pointers.
>
> Each bitmap takes one bit per cluster. With fail_on_process_exit the
> session expires as soon as the sender exits, so this is easy to hit in
> a loop:
>
> for i in $(seq 1000); do
> dmsetup message <pb_dev> 0 push_backup_start 60 0 fail_on_process_exit
> done
>
> Swap the new bitmaps in under pb->lock and free the old ones in
> setup_pb(). Nothing dereferences the bitmaps of an expired session
> without holding pb->lock, so they can be freed once the lock is
> dropped. If setting up the new session fails, the expired session
> keeps its bitmaps.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-155790
>
> Feature: dm-backup: push backup target driver
> Fixes: 162123bc62c7 ("dm: Add push backup driver")
> Signed-off-by: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>
Sashiko has reviewed this patch and found no issues.
Carry the trailer below into the next revision and Sashiko will not review this patch again.
Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261125-push-backup-fixes-v2-0-195a2bcd82f7@virtuozzo.com?part=2
More information about the Devel
mailing list