[Devel] [PATCH hci-8.2] dm/push_backup: stop the backup when the process that started it exits

Konstantin Khorenko khorenko at virtuozzo.com
Wed Nov 18 15:47:27 MSK 2026


I won't apply this version, please send v2 with the changes below.

1. Return -EINVAL for a fourth argument other than
   fail_on_process_exit: now ret is still 0 from
   down_write_killable(), nothing starts and the caller sees success.
   VSTOR-155761 covers the same for the rest of push_backup_start; fix
   it there first or set ret = -EINVAL before the argument checks
   here.
2. push_backup_statistics: report expires_in as 0 for every expired
   session. After the process exits with writes postponed,
   cleanup_backup() leaves deadline_jiffies in the future, so the
   statistics show a positive expires_in next to "expired".
3. Message: say that the message has to come from the backup process
   itself; sent through "dmsetup message" the session expires as soon
   as dmsetup exits.
4. Message: the reason for watching the process, see below; and the 60
   seconds are ploop-backup's default, the kernel has none, the timeout
   is a required argument. Split the "With this argument" paragraph,
   it has seven sentences: the mechanism, then what the user sees.

A question, no change needed if it is intended: a session whose backup
has finished (nr_remaining_clus=0) also expires when the process exits
before push_backup_stop, and the fd then returns ESTALE instead of 0.

On Wed, 18 Nov 2026 12:21:11 +0000, Vasileios Almpanis wrote:
> We watch the process and not the event fd, because the fd can end up
> in another process, for example in a child of ploop-backup. That
> process would then keep the session alive after ploop-backup dies.

4. The fd is O_CLOEXEC, so it reaches a child only through a fork
without exec. The stronger reasons: the fd is bound to the target,
not to a backup session (d723a1617e619), and a session driven by
push_backup_read/push_backup_write has no fd at all.

Thanks.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team



More information about the Devel mailing list