Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3140248pxb; Mon, 18 Apr 2022 17:04:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwNptNRmW9o5x59jotousj6OvmGzWA7lKYyfBhYIbelSqgPfd+PwBkfcX9CtUPJ+L69oit X-Received: by 2002:a17:902:b10c:b0:154:a3b5:b33a with SMTP id q12-20020a170902b10c00b00154a3b5b33amr12816445plr.3.1650326672541; Mon, 18 Apr 2022 17:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650326672; cv=none; d=google.com; s=arc-20160816; b=iaO93JTMQzDXGo929N4mhas70JJwlqFY05IRHHaRZHoI0Zys0cpNU93w3hP+y0i327 I1OZYddW+B78CnHtiV6aFP5c2A4Vk4NEmN4fJd27kWi+ElZKtQSm558Nb6bnNd82wMgz oT/W5F8hIpXjDLJCcm6BNslgH17i8BmYVvJgw4V87/9Gld3CZV2llCdPA87DXW36vMXl E3Njq+7GNaRvlKRekFEvm9m7/eStogHLMw5OKI+ClPpAzybRrjGM2B5AuQyiba9h2FGp nXsNGyILngQ2D63UNh7q/2NYW/7CnLm7aD0Bw5XU+64GBr0SmDzaiAokwvupqNS6FUR6 h4zw== 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=X0LdgyEpMjG2dVFlR20y4bcVkZgM5IH5C646kpMy5Ag=; b=nTRhxdgdDkTixldN+kUAIVAePRQGCAj92x8wZOgQlMYypKI0CF6pLGf1EZrFrKRL3/ CVpGbFwwF8u1Ekv/0DTIeXIjr/P/Yxt+NxqcsYKmObDbN4oUJbbHXCfDgHhTdd+uokD5 oJgYWz/aBzawuK/FkwHn1qWOH3ahXxsKLSRoGZJxC67K+b+dlXCqqy4Z1k41hpoik0dl RkGe5Xo1nOAWdqW2dmg3KBs5fBiyvgJdZXOebPif+ULkb1TQYbR7rT4I9ZFePezqBMrF baTUzCzrIVobbsBp/Iv7dlIYG8vPyDlBPB33H0aqLySS/cytQWd9HGQfuKRfN08HoPnf KU7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DHHW67Gy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j23-20020aa78dd7000000b0050604ac89e3si8585786pfr.345.2022.04.18.17.04.17; Mon, 18 Apr 2022 17:04:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DHHW67Gy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S238702AbiDRMbD (ORCPT + 99 others); Mon, 18 Apr 2022 08:31:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239066AbiDRM1m (ORCPT ); Mon, 18 Apr 2022 08:27:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6E4C1EAF7; Mon, 18 Apr 2022 05:21:16 -0700 (PDT) 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 59E0060FBC; Mon, 18 Apr 2022 12:21:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A0B5C385A7; Mon, 18 Apr 2022 12:21:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650284475; bh=fqp40Y9UjZn+SQBAxw+bQ8zFxntrr6A8v5QsewFp2MY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DHHW67GyJc0n4hZ6a5SwZsNN8CAhFhIIlOrOf7DutWfNBVxAg2ycx4WbZZDbRM21k S5tTGCHMMG9EbpazOOhjQ26CKJ501Dg9UmpKPD1p6wiv1cyYyTFEu4kqYI81jJMfpp VQUpC5Jelt6Ub1UtyXYVI6w7F4XLp4C/42l4hUt8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ming Lei , Jens Axboe , Sasha Levin Subject: [PATCH 5.17 127/219] block: null_blk: end timed out poll request Date: Mon, 18 Apr 2022 14:11:36 +0200 Message-Id: <20220418121210.451529719@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121203.462784814@linuxfoundation.org> References: <20220418121203.462784814@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ming Lei [ Upstream commit 3e3876d322aef82416ecc496a4d4a587e0fdf7a3 ] When poll request is timed out, it is removed from the poll list, but not completed, so the request is leaked, and never get chance to complete. Fix the issue by ending it in timeout handler. Fixes: 0a593fbbc245 ("null_blk: poll queue support") Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220413084836.1571995-1-ming.lei@redhat.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/block/null_blk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 13004beb48ca..233577b14141 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -1606,7 +1606,7 @@ static enum blk_eh_timer_return null_timeout_rq(struct request *rq, bool res) * Only fake timeouts need to execute blk_mq_complete_request() here. */ cmd->error = BLK_STS_TIMEOUT; - if (cmd->fake_timeout) + if (cmd->fake_timeout || hctx->type == HCTX_TYPE_POLL) blk_mq_complete_request(rq); return BLK_EH_DONE; } -- 2.35.1