[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1101260704050.1889@localhost6.localdomain6>
Date: Wed, 26 Jan 2011 07:05:07 -0800 (PST)
From: Davide Libenzi <davidel@...ilserver.org>
To: Johannes Weiner <hannes@...xchg.org>
cc: Andrew Morton <akpm@...ux-foundation.org>, shawn.bohrer@...il.com,
linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
mm-commits@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [patch]
epoll-fix-compiler-warning-and-optimize-the-non-blocking-path-fix
On Wed, 26 Jan 2011, Johannes Weiner wrote:
> The non-blocking ep_poll path optimization introduced skipping over
> the return value setup.
>
> Initialize it properly, my userspace gets upset by epoll_wait()
> returning random things.
>
> In addition, remove the reinitialization at the fetch_events label,
> the return value is garuanteed to be zero when execution reaches
> there.
>
> Signed-off-by: Johannes Weiner <hannes@...xchg.org>
> Cc: Shawn Bohrer <shawn.bohrer@...il.com>
> Cc: Davide Libenzi <davidel@...ilserver.org>
Thank you for posting it. Obvious ACK.
> ---
> fs/eventpoll.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/fs/eventpoll.c b/fs/eventpoll.c
> index f7cb6cb..afe4238 100644
> --- a/fs/eventpoll.c
> +++ b/fs/eventpoll.c
> @@ -1147,7 +1147,7 @@ static int ep_send_events(struct eventpoll *ep,
> static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
> int maxevents, long timeout)
> {
> - int res, eavail, timed_out = 0;
> + int res = 0, eavail, timed_out = 0;
> unsigned long flags;
> long slack = 0;
> wait_queue_t wait;
> @@ -1173,7 +1173,6 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
> fetch_events:
> spin_lock_irqsave(&ep->lock, flags);
>
> - res = 0;
> if (!ep_events_available(ep)) {
> /*
> * We don't have any available event to return to the caller.
> --
> 1.7.3.5
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists