From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
To: no-reply@sashiko.virtuozzo.com, alexander.ivanov@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v3 6/6] drivers/md/push_backup: add event file descriptor interface
Date: Tue, 3 Nov 2026 07:41:21 +0100 [thread overview]
Message-ID: <f762b9e1-0c67-4d76-9aba-f6b99ff2a875@virtuozzo.com> (raw)
In-Reply-To: <010701a1a01b42a2-9130a6ec-9fa6-4df6-86ff-367560989509-000000@eu-central-1.amazonses.com>
On 11/3/26 07:31, no-reply@sashiko.virtuozzo.com wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] dm-push-backup: event fd pb_fops has no .poll, so epoll/poll always report ready
We are not planning to use it in non-blocking mode, so this is fine. If
we really need that we will add this later
> --
>
> commit b2845f9ea4dfb915a0897be5e674c310ca9217b3
> Author: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
>
> drivers/md/push_backup: add event file descriptor interface
>
> This adds a "push_backup_get_fd" target message that returns an anon inode
> fd. The backup tool can read() that fd to get the next cluster range and
> write() it to acknowledge the range. This avoids sleeping inside a dm
> message with md->io_barrier held. The patch also adds a kref on struct
> push_backup to tie its lifetime to the open fds.
>
> 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 bool pb_has_event(struct push_backup *pb)
>> +{
>> + return READ_ONCE(pb->destroyed) || !READ_ONCE(pb->map) ||
>> + !READ_ONCE(pb->alive) || !READ_ONCE(pb->map_bits) ||
>> + !list_empty_careful(&pb->pending);
>> +}
>
> [ ... ]
>
>> +static const struct file_operations pb_fops = {
>> + .owner = THIS_MODULE,
>> + .read = pb_fd_read,
>> + .write = pb_fd_write,
>> + .release = pb_fd_release,
>> +};
>
> [Severity: Medium]
> Is the lack of a .poll method in pb_fops intentional?
>
> Without a ->poll handler, poll/select/epoll always report this file as
> readable and writable. A tool that adds the fd to an epoll set would get an
> immediate EPOLLIN. Its O_NONBLOCK read() would then return -EAGAIN, which
> the UAPI header documents:
>
> * -EAGAIN - O_NONBLOCK is set and no writes are pending.
>
> Polling again would return immediately, so the tool would spin. The only
> usable way to wait is a blocking read() in a dedicated thread.
>
> pb_has_event() already defines the readiness condition, and pb->waitq is
> already woken on the relevant state changes. Would it make sense to add a
> .poll method built on pb_has_event() and pb->waitq? Adding it later would
> change how this fd behaves for userspace that already uses it.
>
> Also, pb_fops has no .llseek = no_llseek, and the file is not opened with
> stream_open() or nonseekable_open() semantics. Should this stream-like fd
> be marked non-seekable?
>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-03 6:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 6:17 [Devel] [PATCH hci-8.1 v3 0/6] dm/push_backup: event fd interface and fixes Andrey Zhadchenko
2026-11-03 6:17 ` [Devel] [PATCH hci-8.1 v3 1/6] drivers/md/push_backup: correct initialization Andrey Zhadchenko
2026-11-03 6:25 ` no-reply
2026-11-03 6:17 ` [Devel] [PATCH hci-8.1 v3 2/6] drivers/md/push_backup: clear pb->alive under pb->lock Andrey Zhadchenko
2026-11-03 6:25 ` no-reply
2026-11-03 6:17 ` [Devel] [PATCH hci-8.1 v3 3/6] drivers/md/push_backup: do not re-arm deadline timer in push_backup_write() Andrey Zhadchenko
2026-11-03 6:26 ` no-reply
2026-11-03 6:49 ` Alexander Ivanov
2026-11-03 6:17 ` [Devel] [PATCH hci-8.1 v3 4/6] drivers/md/push_backup: fix mod_timer() usage Andrey Zhadchenko
2026-11-03 6:26 ` no-reply
2026-11-03 6:53 ` Alexander Ivanov
2026-11-03 6:17 ` [Devel] [PATCH hci-8.1 v3 5/6] drivers/md/push_backup: arm deadline timer under pb->lock Andrey Zhadchenko
2026-11-03 6:28 ` no-reply
2026-11-03 6:17 ` [Devel] [PATCH hci-8.1 v3 6/6] drivers/md/push_backup: add event file descriptor interface Andrey Zhadchenko
2026-11-03 6:31 ` no-reply
2026-11-03 6:41 ` Andrey Zhadchenko [this message]
2026-11-03 7:06 ` Alexander Ivanov
2026-11-03 7:34 ` [Devel] [PATCH hci-8.1 v3 0/6] dm/push_backup: event fd interface and fixes Alexander Ivanov
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=f762b9e1-0c67-4d76-9aba-f6b99ff2a875@virtuozzo.com \
--to=andrey.zhadchenko@virtuozzo.com \
--cc=alexander.ivanov@virtuozzo.com \
--cc=devel@openvz.org \
--cc=no-reply@sashiko.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox