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

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Wed Nov 18 15:27:29 MSK 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dm-push-backup: bad fail_on_process_exit argument returns
  success
--

commit 3578882a0ee4244aebcea5a102bc0fcc5dc0eae8
Author: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>

dm/push_backup: stop the backup when the process that started it exits

This adds an optional fail_on_process_exit argument to push_backup_start. With it, the target adds a wait queue entry to the sender's pid->wait_pidfd. When the whole process exits, the session expires the same way as when the deadline timer fires.

> diff --git a/drivers/md/dm-push-backup.c b/drivers/md/dm-push-backup.c
> --- a/drivers/md/dm-push-backup.c
> +++ b/drivers/md/dm-push-backup.c

[ ... ]

> @@ -724,14 +775,18 @@ static int pb_message(struct dm_target *ti, unsigned int argc, char **argv,
>  		goto out;
>  
>  	if (!strcmp(argv[0], "push_backup_start")) {
> -		if (argc < 2 || argc > 3)
> +		if (argc < 2 || argc > 4)
>  			goto unlock;
>  		if (kstrtou64(argv[1], 10, &val) < 0)
>  			goto unlock;
>  		val2 = 0;
> -		if (argc == 3 && kstrtou64(argv[2], 10, &val2) < 0)
> +		if (argc >= 3 && kstrtou64(argv[2], 10, &val2) < 0)
> +			goto unlock;
> +		if (argc == 4 && strcmp(argv[3], "fail_on_process_exit"))
>  			goto unlock;

[Severity: Low]
Does this new check return success for a misspelled fourth argument? By this point ret holds 0 from the successful down_write_killable(), so the goto unlock returns 0 to userspace. No session is started and no process watch is installed, yet the caller sees success. It would then assume fail-on-exit protection is active, and writes could still stall until the deadline timer fires. Should ret be set to -EINVAL before this goto?

The older argument checks in this block have the same problem, which the cover text says is tracked separately. This check is a new instance of it.

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261118-vstor-153891-v1-1-f31daea66355@virtuozzo.com?part=1



More information about the Devel mailing list