Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp834049pxb; Tue, 3 Nov 2020 13:54:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLsVEfeex7kTSmK3wnNR13wDQmT6xRlOGv4V1JQaS387QfWLjmRt4ygxRo62tT5Q31XJVP X-Received: by 2002:a05:6402:3136:: with SMTP id dd22mr12071907edb.256.1604440445165; Tue, 03 Nov 2020 13:54:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604440445; cv=none; d=google.com; s=arc-20160816; b=dfRCosa1DEqHXFE1jCFM29pbR/ZorIhKvGddlm7YwRDMefnvX23bHaQF7c+2lp3SsF /cVH5CClh8pMjI7SLvBUWQS2My6z2FhiJU0jxENCTITGXcakQ5sj1AnYVwunNbO+J82l BrGFAhpMmCpyklRfwlpPAK470Aui7fU3qYQIUGpfV341Pt+uS/ZCm9oIroCo+qRrFnR7 3cTAs/ggQXEJYVtNXnBbUtY+3abiAfGHQCOziBDQDfQ23fcllxy8qkyf0FAp/YjOGIHJ XwbLBtJZLnlTFdbuOzs0+1TDDAccp30GGinGL6mZzoGCcN2/FSA9wvYMDuzpidMlc7Y8 x0Mw== 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=vNvoaDxDVZhpcMSobsmhiDQLdIRAqoANAVnpn/ASbnM=; b=VA07g/nxHcKPYaimRP3nBaQqrxvc6nJBgwljgmeLqkAhXu0mMXtW80Sy8P3McIl/LW 8eTum0Oj35jXvrx2mU6oroqZfHaaUVQHX+M3YabBdbmKL9q2wPVkLatkLbV+jEqlqjdx Lz4H89JTyzAYER/L17zXhRowNZWVKu2KnEuyzOW/46l54n9Yuk7nK2JG8lOVYzemd9hE YJQu7cmConZJsI+m8dK8iVwDp3ysKOpiRey8WGmsfisXAej6aFVOCRooWOLQ7/tPONpz 9gYBJYFwO/YXMwEJlMFLzqGNXNEwthIm5ahMi+bWu70PYAzk8UfwKPYgcAlHq/Vs64Il gyvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=j4G5quIu; 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=fail (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 s23si3181297edy.458.2020.11.03.13.53.42; Tue, 03 Nov 2020 13:54:05 -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=@kernel.org header.s=default header.b=j4G5quIu; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731459AbgKCVuX (ORCPT + 99 others); Tue, 3 Nov 2020 16:50:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:41674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731435AbgKCUtH (ORCPT ); Tue, 3 Nov 2020 15:49:07 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D8D522404; Tue, 3 Nov 2020 20:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436546; bh=HxP24GZ8BhdPLAtEVsQZBRTDboxnusE+HL1PwTy/hrk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j4G5quIuXqEBZVaBHej586lnVa5eITOr5s/6CpndV/qsgQj3VdStjgX7dokmY6Ufv cxst9+BgiJ4HNPmISIKujuBpXidxhJGXVl8mwfnSCZJqqHcGAGV2gat4wFXco2+xxS 4amYA1N8GIyeh4CuIYBMfjkHJ3aEXE1IJeXMN/Hw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Begunkov , Jens Axboe Subject: [PATCH 5.9 296/391] io_uring: use type appropriate io_kiocb handler for double poll Date: Tue, 3 Nov 2020 21:35:47 +0100 Message-Id: <20201103203407.049715487@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203348.153465465@linuxfoundation.org> References: <20201103203348.153465465@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: Jens Axboe commit c8b5e2600a2cfa1cdfbecf151afd67aee227381d upstream. io_poll_double_wake() is called for both request types - both pure poll requests, and internal polls. This means that we should be using the right handler based on the request type. Use the one that the original caller already assigned for the waitqueue handling, that will always match the correct type. Cc: stable@vger.kernel.org # v5.8+ Reported-by: Pavel Begunkov Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- fs/io_uring.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4786,8 +4786,10 @@ static int io_poll_double_wake(struct wa /* make sure double remove sees this as being gone */ wait->private = NULL; spin_unlock(&poll->head->lock); - if (!done) - __io_async_wake(req, poll, mask, io_poll_task_func); + if (!done) { + /* use wait func handler, so it matches the rq type */ + poll->wait.func(&poll->wait, mode, sync, key); + } } refcount_dec(&req->refs); return 1;