Thread (9 messages) flat view 9 messages, 3 authors, 2013-02-18

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

From: Andy Lutomirski <luto@amacapital.net>
Date: 2013-02-14 23:57:59
Also in: linux-fsdevel, lkml

On Thu, Feb 14, 2013 at 2:54 PM, Andrew Morton
[off-list ref] wrote:
On Fri,  8 Feb 2013 09:11:17 +0100
Martin Sustrik [off-list ref] wrote:
quoted
When implementing network protocols in user space, one has to implement
fake user-space file descriptors to represent the sockets for the protocol.
quoted
      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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help