Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1641203pxb; Thu, 16 Sep 2021 11:49:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvz17yxIV0Kz2pcx6DrqB1fN969VNKMs01nQO0delWsypsQZ525OB4miBkTjy4tqi+sjYp X-Received: by 2002:a17:906:3f95:: with SMTP id b21mr7591276ejj.368.1631818187928; Thu, 16 Sep 2021 11:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631818187; cv=none; d=google.com; s=arc-20160816; b=rrqtwi7po6jgrbKB65W9y8E7iU0+GeGWQm3u+yz/uifw8EIwXCn6+g5sgRbjFLUjRy 0/TdnQk7IdAbGUXWmub226RcKGpxh4M0q4KODNiSf8UTgNzKq4pzrbJT7rvz4aDIyR/4 sWrbR8nWb23/0qdCdgsL1pxswGkf981CZxPgiEsIsuncJHFHfBkIu0zV58KgWzRJAWcB /Mzei9+wiennrEhADe4PR8GIvDbwRE4MevDhsPovesN5kHTASzgH3hetFPFviLmvAzZP 3aQNTqw9176oD32vfKYxE9F1gly3YDCHjSEvv7gsziN9vmdPqyM9FX6PkMT/RQRll6cz olGQ== 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=kJ2KJgUh9umGFhGmPuoohsRi9UmpCTRapyV//AKHPH0=; b=HYLEbpYUAhSbvmGhq6wmO3xkgbL2t8J2UYTWX+APKU3YYqnYcgBo30DmdklAO0M6ic dtBfnOUbhQjGC77YPUrcYoubnCAIPPrMBOc7N1b+MpnxA/F1ogKdJfx85C+vTGr+lbjS QTBDI5Qi4srL6wnOuhAQfBhoF3xjHMMEdD+j7hMi5I7Qcq2yQyw5XkjMZc4t6elEZlG6 ZJ3ir8fk4Kcmf7I/KhLzfyWTd1FzqumzXSsTV6jWiGPXFI2tpUL2dr6kHMNhzGj6epzL FHQJIRdUGFaFU1QHFIxvYHVo22P11xEdJq9Q669/CDpPWXQnzdP1X3Y/OePXSv95ttuQ 5hXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GYIdxwDi; 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 p14si4218819ejn.419.2021.09.16.11.49.15; Thu, 16 Sep 2021 11:49:47 -0700 (PDT) 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=GYIdxwDi; 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 S233463AbhIPQIE (ORCPT + 99 others); Thu, 16 Sep 2021 12:08:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:45422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231592AbhIPQGP (ORCPT ); Thu, 16 Sep 2021 12:06:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 28EA261250; Thu, 16 Sep 2021 16:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808294; bh=DgWroEr6KFQMOroZrFzd2Avp00/IN+gsVRRBhWqiHH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GYIdxwDiF0neuCLtXAirx9liXxGw64mgLX6p3nrShzihHAkhZvwrNMTw8SeY7A40A Msq8A3VUD5n4XhtbgIn9FKb0RCL1Sh3MW82wym7hctXyevIZNPWOrscN/GFu7ITI7w Uh9eIeFSSDxm/ytW+A6O5nw/nTylh9lQmDTSiZ4M= 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.10 005/306] io_uring: fail links of cancelled timeouts Date: Thu, 16 Sep 2021 17:55:50 +0200 Message-Id: <20210916155754.098251710@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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 commit 2ae2eb9dde18979b40629dd413b9adbd6c894cdf upstream. When we cancel a timeout we should mark it with REQ_F_FAIL, so linked requests are cancelled as well, but not queued for further execution. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/fff625b44eeced3a5cae79f60e6acf3fbdf8f990.1631192135.git.asml.silence@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1498,6 +1498,8 @@ static void io_kill_timeout(struct io_ki ret = hrtimer_try_to_cancel(&io->timer); if (ret != -1) { + if (status) + req_set_fail_links(req); atomic_set(&req->ctx->cq_timeouts, atomic_read(&req->ctx->cq_timeouts) + 1); list_del_init(&req->timeout.list);