Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3602448pxb; Mon, 24 Jan 2022 13:16:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwn14bdW6IZqwPCqH2jN8n9DqF0ypXEapF1JNW1PgYVggk4GxxEaBj/kcMSIKe0VTvEbMaC X-Received: by 2002:a63:2b01:: with SMTP id r1mr5812512pgr.182.1643058978339; Mon, 24 Jan 2022 13:16:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058978; cv=none; d=google.com; s=arc-20160816; b=jMpqqGC3hKnHBfeWEK0WFXyyyVNA+vixPtI/XaHdvNsMw7RYFIaEtlU5erUiCue0iq vlIDhLmOkl8QDhKTBajWL5tcr3gvSQYajDzGLZIXB7l0vsrf8XU+kWWXkO8SAv2Ac7Zb g/x+ARPLHxnxXugUFCBHvV/f/6oO7lTOJiwyhJ3F3KIJahBGafnjXKu84/Fqd0VI0zX9 /frL5yEM6st2T+rASUHcCZS6X1fVPZMCXdsGQd7N6QgugMaoBWlaI7w8Bhj5WkpaZ+QN G4kj5/uChULKUDmBtWRuPepe+jtmwsggDaJTSp8XxkNJgMuoquCCeD2j+Di42wH6PgSO 1YDQ== 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=B6clq9foaBZW7QnvVNg+NtzROSzJTnWcBp/S33Lae7M=; b=xxYasV05ugiX0UOavnGowLOy5sYEfNPk/9Kdvsv/QAs0yte7Ww0FIphVwmvnGjd+VI A7BUwDVhxMfZtECMK08XVonm0+ylDYzN545woULQ6LmhugGgErzEaa5onD8Og7qlH22l UYVpf+LmCVKLx+FeF3XVrS6wUptOtoI5WNNb/qLUcQ1p/u6/GqnPlfYCmiR9CdEK4+6W sRZV4C61CmOVCoGvBigHkHeTU6e0CGZVXkEJ4wJIAbm6T+K/bT/XdykEhDCBV0+JaMox aN4h7dhrTCZcF1brdLCD8x1MLYmVf2YbzyFEokmNWUwIf0TnGWB4wmHbR7hmWN19HrCt IbNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oBr0dAMk; 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 g63si3743856pfb.179.2022.01.24.13.16.05; Mon, 24 Jan 2022 13:16:18 -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=oBr0dAMk; 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 S1383017AbiAXUtE (ORCPT + 99 others); Mon, 24 Jan 2022 15:49:04 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:48710 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381837AbiAXUYr (ORCPT ); Mon, 24 Jan 2022 15:24:47 -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 dfw.source.kernel.org (Postfix) with ESMTPS id E177461232; Mon, 24 Jan 2022 20:24:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6C38C340E5; Mon, 24 Jan 2022 20:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055886; bh=2/YtUJlhdhKj2+PYmbTkGubem1KTGQtxJkKwLbVF/MI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oBr0dAMk4YT6ZAWcdBzuZ6Nwg+koq+bEU6ndspDlP1bdIWGfWAv4CGdd8NfbSzEHW 00KyR14TNLOssl6g+L/wMDdvmFCkGC7La1PE5hTBiogEr8L1XXTJ8cEqMUBQ7ObNbw X+8X0/Agzqf6nUKR4XbF+zIKfbwZWcSsxWgrdfbM= 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.15 299/846] io_uring: remove double poll on poll update Date: Mon, 24 Jan 2022 19:36:56 +0100 Message-Id: <20220124184111.228757894@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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 0006fc7479ca3..ecffeddf90c68 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -5925,6 +5925,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