Re: [PATCH v2 1/1] eventfd: implementation of EFD_MASK flag

From: Andy Lutomirski
Date: Thu Feb 14 2013 - 18:58:26 EST


On Thu, Feb 14, 2013 at 2:54 PM, Andrew Morton
<akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, 8 Feb 2013 09:11:17 +0100
> Martin Sustrik <sustrik@xxxxxxxxxx> wrote:
>
>> When implementing network protocols in user space, one has to implement
>> fake user-space file descriptors to represent the sockets for the protocol.

>
>> if (count < sizeof(ucnt))
>> return -EINVAL;
>> @@ -293,8 +351,13 @@ static int eventfd_show_fdinfo(struct seq_file *m, struct file *f)
>> int ret;
>>
>> spin_lock_irq(&ctx->wqh.lock);
>> - ret = seq_printf(m, "eventfd-count: %16llx\n",
>> - (unsigned long long)ctx->count);
>> + if (ctx->flags & EFD_MASK) {
>> + ret = seq_printf(m, "eventfd-mask: %x\n",
>> + (unsigned)ctx->mask.events);
>> + } else {
>> + ret = seq_printf(m, "eventfd-count: %16llx\n",
>> + (unsigned long long)ctx->count);
>> + }
>> spin_unlock_irq(&ctx->wqh.lock);
>
> This is a non-back-compatible userspace interface change. A procfs
> file which previously displayed
>
> eventfd-count: nnnn
>
> can now also display
>
> eventfd-mask: nnnn
>
> So existing userspace could misbehave.
>
> Please fully describe the proposed interface change in the changelog.
> That description should include the full pathname of the procfs file
> and example before-and-after output and a discussion of whether and why
> the risk to existing userspace is acceptable.

I suspect that the fdinfo stuff is only used by criu, which will need
to be updated regardless. (If the kernel adopts the policy "don't
break criu", then that may be the end of new kernel features.)

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/