All of lore.kernel.org
 help / color / mirror / Atom feed
* + eventfd-dont-take-the-spinlock-in-eventfd_poll-fix-2.patch added to -mm tree
@ 2015-01-29 21:16 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2015-01-29 21:16 UTC (permalink / raw)
  To: dan.carpenter, clm, mm-commits


The patch titled
     Subject: eventfd: type bug in eventfd_poll()
has been added to the -mm tree.  Its filename is
     eventfd-dont-take-the-spinlock-in-eventfd_poll-fix-2.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/eventfd-dont-take-the-spinlock-in-eventfd_poll-fix-2.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/eventfd-dont-take-the-spinlock-in-eventfd_poll-fix-2.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
Subject: eventfd: type bug in eventfd_poll()

Since "count" is an unsigned int, then these conditions are never true:

        if (count == ULLONG_MAX)
                events |= POLLERR;
        if (ULLONG_MAX - 1 > count)
                events |= POLLOUT;

It should be a u64, because that's what ctx->count is.  Also GCC
complains that "flags" is unused.

Fixes: a90de8a54127 ('eventfd: don't take the spinlock in eventfd_poll')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Chris Mason <clm@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/eventfd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/eventfd.c~eventfd-dont-take-the-spinlock-in-eventfd_poll-fix-2 fs/eventfd.c
--- a/fs/eventfd.c~eventfd-dont-take-the-spinlock-in-eventfd_poll-fix-2
+++ a/fs/eventfd.c
@@ -118,7 +118,7 @@ static unsigned int eventfd_poll(struct
 {
 	struct eventfd_ctx *ctx = file->private_data;
 	unsigned int events = 0;
-	unsigned int count;
+	u64 count;
 
 	poll_wait(file, &ctx->wqh, wait);
 	smp_rmb();
_

Patches currently in -mm which might be from dan.carpenter@oracle.com are

origin.patch
ocfs2-o2net-silence-uninitialized-variable-warning.patch
mm-remove-rest-usage-of-vm_nonlinear-and-pte_file-fix.patch
mm-compaction-enhance-tracepoint-output-for-compaction-begin-end-v4-fix.patch
slab-embed-memcg_cache_params-to-kmem_cache-fix.patch
eventfd-dont-take-the-spinlock-in-eventfd_poll-fix-2.patch
linux-next.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-29 21:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-29 21:16 + eventfd-dont-take-the-spinlock-in-eventfd_poll-fix-2.patch added to -mm tree akpm

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.