From: no-reply@sashiko.virtuozzo.com
To: alexander.ivanov@virtuozzo.com,
Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>,
khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v6 7/7] dm/push_backup: add event file descriptor interface
Date: Wed, 4 Nov 2026 08:52:16 +0000 [thread overview]
Message-ID: <010701a1a5c24aaa-3acc341b-6935-483c-8816-f31d93dcbca6-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261104083818.856720-8-andrey.zhadchenko@virtuozzo.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] dm/push_backup: pb_fd_read() returns -ERESTARTSYS but UAPI header promises EINTR
--
commit 8c17414f2b8fe21a954bd9ba0c6114af23dc4c79
Author: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
dm/push_backup: add event file descriptor interface
This patch adds a push_backup_get_fd target message that returns an anon
inode fd. The fd supports read() for the next range to back up and write()
to acknowledge a range. It also adds a kref on struct push_backup so the
object lives until the last fd is released.
Link: https://virtuozzo.atlassian.net/browse/VSTOR-152912
> 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
[ ... ]
> +static int pb_wait_range(struct push_backup *pb, u64 *clu, u64 *nr)
> +{
> + int ret;
> +
> + while (1) {
> + ret = pb_next_range(pb, clu, nr);
> + if (ret != -EAGAIN)
> + return ret;
> + if (wait_event_interruptible(pb->waitq, pb_has_event(pb)))
> + return -ERESTARTSYS;
> + }
> +}
[ ... ]
> +static ssize_t pb_fd_read(struct file *file, char __user *buf,
> + size_t count, loff_t *ppos)
> +{
> + struct push_backup *pb = file->private_data;
> + struct dm_push_backup_range range;
> + int ret;
> +
> + if (count != sizeof(range))
> + return -EINVAL;
> +
> + ret = pb_wait_range(pb, &range.clu, &range.nr);
> + if (ret <= 0)
> + return ret;
[Severity: Low]
Is the EINTR documented for read() actually what userspace will see here?
pb_wait_range() returns -ERESTARTSYS when wait_event_interruptible() is
interrupted, and pb_fd_read() passes it through unchanged via the
"ret <= 0" return. The legacy push_backup_read() maps -ERESTARTSYS to
-EINTR, but the fd path does not.
If the signal handler has SA_RESTART, or no handler runs, the kernel
restarts read() transparently and userspace never sees EINTR. Without
SA_RESTART it is converted to EINTR.
> diff --git a/include/uapi/linux/dm-push-backup.h b/include/uapi/linux/dm-push-backup.h
> new file mode 100644
> --- /dev/null
> +++ b/include/uapi/linux/dm-push-backup.h
[ ... ]
> + * EINTR - interrupted by a signal while waiting.
The header documents EINTR unconditionally, so the documented behaviour
depends on signal disposition. Should the header describe the restart
behaviour, or should pb_fd_read() map -ERESTARTSYS to -EINTR as
push_backup_read() does?
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261104083818.856720-1-andrey.zhadchenko@virtuozzo.com?part=7
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-04 8:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 8:38 [Devel] [PATCH hci-8.1 v6 0/7] dm/push_backup: event fd interface and fixes Andrey Zhadchenko
2026-11-04 8:38 ` [Devel] [PATCH hci-8.1 v6 1/7] dm/push_backup: correct initialization Andrey Zhadchenko
2026-11-04 8:45 ` no-reply
2026-11-04 8:38 ` [Devel] [PATCH hci-8.1 v6 2/7] dm/push_backup: return error if workqueue allocation fails Andrey Zhadchenko
2026-11-04 8:46 ` no-reply
2026-11-04 8:38 ` [Devel] [PATCH hci-8.1 v6 3/7] dm/push_backup: clear pb->alive under pb->lock Andrey Zhadchenko
2026-11-04 8:46 ` no-reply
2026-11-04 8:38 ` [Devel] [PATCH hci-8.1 v6 4/7] dm/push_backup: fix mod_timer() usage Andrey Zhadchenko
2026-11-04 8:47 ` no-reply
2026-11-04 8:38 ` [Devel] [PATCH hci-8.1 v6 5/7] dm/push_backup: arm deadline timer under pb->lock Andrey Zhadchenko
2026-11-04 8:48 ` no-reply
2026-11-04 8:38 ` [Devel] [PATCH hci-8.1 v6 6/7] dm/push_backup: do not re-arm deadline timer in push_backup_write() Andrey Zhadchenko
2026-11-04 8:50 ` no-reply
2026-11-04 8:38 ` [Devel] [PATCH hci-8.1 v6 7/7] dm/push_backup: add event file descriptor interface Andrey Zhadchenko
2026-11-04 8:52 ` no-reply [this message]
2026-11-04 18:46 ` [Devel] [PATCH hci-8.1 v6 0/7] dm/push_backup: event fd interface and fixes Konstantin Khorenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=010701a1a5c24aaa-3acc341b-6935-483c-8816-f31d93dcbca6-000000@eu-central-1.amazonses.com \
--to=no-reply@sashiko.virtuozzo.com \
--cc=alexander.ivanov@virtuozzo.com \
--cc=andrey.zhadchenko@virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.