Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3651947pxb; Mon, 24 Jan 2022 14:29:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVfvBzSKMAouF4hEG3XFWE3iQ3npAEZQFb1RfiC2ZvZyQNHny890of4iYAeLzb3MRitN+Y X-Received: by 2002:a62:cf43:0:b0:4c7:e70:c163 with SMTP id b64-20020a62cf43000000b004c70e70c163mr15816972pfg.48.1643063347747; Mon, 24 Jan 2022 14:29:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643063347; cv=none; d=google.com; s=arc-20160816; b=TUvps7mXLTLaYfL9IT9K5rl+Hr5MC3OEizR3uviFSrBOgLsbmGpVXpTGIe5ZltsIv3 1+vvu5gXgDHH057VXMuawirFvcXcjLPe7zaziOiChmmYdpOVf2JYMP+EjqZk/0h9t+jH uktNhCZmxbg9mdbX6/01K55KCdSlWDCLD1Q7bm3NhL8A2r3S9waxoav6FLmlFzLdT9vp M3xfIMM771TKPfeL8S4hvl8+eaPWCANTiumJg2TFleD2kVeZtUk4vhbiiHdW1gMl4js5 luXhGSzl6xD+hIZoga0c6MzgSRUnDLflEyZynxyXLS3uyCA5f92jaPlBvllPZAWraQSu mtZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9KfYV1lGl3zsigLNF/3Rm56BAYzRh5TqmjbQOt1rwFA=; b=u2tzmxYdYJ2xY/0utsf9E84aRkBQMziqOZ3bLopZCY75DlImhY1iURX0iq4rIRv2th g10T7R06WPOht8NjF9SNda1O4vdHAC0yyu4btJNrJz6tZdpuJ/HvaVKOreFouG1LRfia NP6j5+EtXTdpXo6bPYJiC7ZB3rnwGewG79uNAg4Ld4yDLqfUKLHTDVHBQCPgK4Y/osbW d5HnI+RuSB3w4w9sdeoE5TQxPpxi13mYJGOyl5Vqev5lZLjhGiDSJpoe75kNESBuuNdk WMB/edd4KWz8ok/fcvKBPzIpyZucmBO0udswC0ujg0SNaC49Q2Ig2+A3rylNfpRj0UXX h6fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZHBm5h7D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g11si12986874plo.305.2022.01.24.14.28.55; Mon, 24 Jan 2022 14:29:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZHBm5h7D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1583561AbiAXWTH (ORCPT + 99 others); Mon, 24 Jan 2022 17:19:07 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:33262 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1447576AbiAXVLB (ORCPT ); Mon, 24 Jan 2022 16:11:01 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7AB6DB80CCF; Mon, 24 Jan 2022 21:10:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96285C340E5; Mon, 24 Jan 2022 21:10:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058658; bh=wAh/haiJ/v7tO3dGBFHipa7wk5ZBATtCVmv/QRDmjlo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZHBm5h7DyYvZtj1ubjO+D64krLdqm1y28c4KqGf8L3FHfFcIdaST4FM8BawavJF6/ G5Bnmj28niCIGBbDmUik/v6hKB2UXjWnthYWtwSeBKWmFNRadMXTOXh35Tv1D+DBwr 5kUt/4mlQVn6tZTDZQl6AQZlBQ2evnrfUW2UoWng= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Begunkov , Jens Axboe , Sasha Levin Subject: [PATCH 5.16 0360/1039] io_uring: remove double poll on poll update Date: Mon, 24 Jan 2022 19:35:49 +0100 Message-Id: <20220124184137.379491661@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Begunkov [ Upstream commit e840b4baf3cfb37e2ead4f649a45bb78178677ff ] Before updating a poll request we should remove it from poll queues, including the double poll entry. Fixes: b69de288e913 ("io_uring: allow events and user_data update of running poll requests") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ac39e7f80152613603b8a6cc29a2b6063ac2434f.1639605189.git.asml.silence@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- fs/io_uring.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/io_uring.c b/fs/io_uring.c index fb2a0cb4aaf83..72496f424c155 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -5928,6 +5928,7 @@ static int io_poll_update(struct io_kiocb *req, unsigned int issue_flags) * update those. For multishot, if we're racing with completion, just * let completion re-add it. */ + io_poll_remove_double(preq); completing = !__io_poll_remove_one(preq, &preq->poll, false); if (completing && (preq->poll.events & EPOLLONESHOT)) { ret = -EALREADY; -- 2.34.1