From patchwork Mon Sep 13 15:12:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 509773 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp654783jao; Mon, 13 Sep 2021 08:17:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfXdRjXMPjvaCebqTR7XJPVQN+klMNhqFpeF65+4cGrDx4q4LWXJP7CFnexHV8uIi00nJA X-Received: by 2002:a17:906:3f95:: with SMTP id b21mr12779898ejj.368.1631546255119; Mon, 13 Sep 2021 08:17:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631546255; cv=none; d=google.com; s=arc-20160816; b=iOUNrzclIEAGc9pHTuws0woz+zYkvYmOXoww6jlw7LAb3/yvw0P8po0jjfyGYKX8Fh Q4NT+kgx6OzhGFTGDHO47JTDLGqfyaFeCwSSe0JL1DvJNOJsiYw386/f9m/xZ2v8z4gW 6cur6gOp/tR1RX6wSYZtYn+aLGhGTvCJIi1rrfHMHeW3km+TM6DNGBAHTl6194EEnhNh z6hDWxiinVlDgju4asUK/XxscQEd0MzUi0JfSfkeCsCebMrs7yf9MlVsZKZ45lzoc2cG 0rdiUYyiFNjQUGLI04pgIF3df3txlVETZyWNtosSDRo0aB0+nbkWBi4QBSOG4tRBafCZ qToQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=mo1NBPr+bQ9EazPo088sbrKUs/FIn3oYsLy4ISo+cOs=; b=RJLTI0/dLNBGD4et96pNGL7f87UUZny/v7xgfOQ/rErg5xnSjwYX74Y7MiQXQI9FqY 5kemI6LWXuQGyc8lKhzf5cOR7wZL9i8S/2pquEjLpO5wTuMuzEKSjKxIHPb6BQhDMepW E1I7hVkvKuG6ZAH/0yxFOEBtDrZkrTf/kDSYs3lW4nA93ZAhtKaj+B/316MgCu51A08R uTacsJPZc3ORF0m4JwlV8mhzzzSy9kcIh6hpXbqcKys40K1//Ux6EuNy6kh0W40f22+5 aCl5JmComKyiwK7MswX1gmQAC4xcYd9CQHKHGDbUNOnKCrSXkdfUki2Lh7MECv6fClWK RP1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bl4si9658754ejb.689.2021.09.13.08.17.34 for ; Mon, 13 Sep 2021 08:17:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345930AbhIMPSq (ORCPT ); Mon, 13 Sep 2021 11:18:46 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3773 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345587AbhIMPSm (ORCPT ); Mon, 13 Sep 2021 11:18:42 -0400 Received: from fraeml744-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4H7VQt4QMqz683h2; Mon, 13 Sep 2021 23:15:18 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml744-chm.china.huawei.com (10.206.15.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 13 Sep 2021 17:17:24 +0200 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 13 Sep 2021 16:17:22 +0100 From: John Garry To: CC: , , , , John Garry Subject: [PATCH RESEND v3 01/13] blk-mq: Change rqs check in blk_mq_free_rqs() Date: Mon, 13 Sep 2021 23:12:18 +0800 Message-ID: <1631545950-56586-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1631545950-56586-1-git-send-email-john.garry@huawei.com> References: <1631545950-56586-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The original code in commit 24d2f90309b23 ("blk-mq: split out tag initialization, support shared tags") would check tags->rqs is non-NULL and then dereference tags->rqs[]. Then in commit 2af8cbe30531 ("blk-mq: split tag ->rqs[] into two"), we started to dereference tags->static_rqs[], but continued to check non-NULL tags->rqs. Check tags->static_rqs as non-NULL instead, which is more logical. Signed-off-by: John Garry Reviewed-by: Ming Lei --- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.26.2 Reviewed-by: Hannes Reinecke diff --git a/block/blk-mq.c b/block/blk-mq.c index 108a352051be..2316ff27c1f5 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2340,7 +2340,7 @@ void blk_mq_free_rqs(struct blk_mq_tag_set *set, struct blk_mq_tags *tags, { struct page *page; - if (tags->rqs && set->ops->exit_request) { + if (tags->static_rqs && set->ops->exit_request) { int i; for (i = 0; i < tags->nr_tags; i++) {