Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4354392rwi; Sat, 22 Oct 2022 08:48:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5s0r0ZZEcBJTAYY5GSulh7wHsl4sUCUiOkSX4+Una+ymPkO5fRNghqK7WoaEMbz9exlGjB X-Received: by 2002:a17:907:60d5:b0:78d:f741:7f9b with SMTP id hv21-20020a17090760d500b0078df7417f9bmr20106445ejc.314.1666453687047; Sat, 22 Oct 2022 08:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666453687; cv=none; d=google.com; s=arc-20160816; b=U0iRMzEFonJrmRlxz87XYkqgy8wTROZSwSmJq65Z+6ldwHLdp3ILrBtPWmQGi4GsKI 0jJJtCZr+e0n+aSu1R4wUhYOXlUc0aeSvVGWcCYU4Eo+qOtQdgbAmu7Ymcm+XzIGJTeg y3KKCITPZPEPkBgp7NNMNlVG9XN3dYJbVC70iaB4TpEJb3c29WhpEsk0HbDdled35/zF hgHNnp+s+QbRuMoBLRoxdeSAGeD04i20RyLfU4wcyvWHZHeuOYhQihrDL66KsnDnSHg2 SgISwuqMm4H8aE8oSAfTu3WkY445/6rDmYyMSBBh+xTEPeTUrHN5Gc/9Ym9dmHwZceDg 4BPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=W2US2sanTHCvEvekg5xOsEe4hlPklqoA7akEgbfkwXk=; b=TkvvKJfJARPoPHNoLXWemlDn3f1BAofTSztIzvvlV0rt6VPzfXoXuKM8jYTgh1Mfuk Fr3qApmif8GYZ0gTv4bOV22iptYLc4/Zj7lmk03eVFDsDVEdWxxyK9SQYPRA9CZHGyJO +iyBXBfWjIr4Ob1BWHPUdfJ8d86L7tQbyYROuA6+z4tjtQRSBnVVYbF36EWgp8ImCGa7 yCfwX3PYI68U193YzCgbxo/f0P2++5lICwxyjBQ4GcpCO2cwz7v0vrkC+PP9g1LzrqOb CSlfMd74Xf1vqCttIGZfPFd2z4azH1Ooo1zCctGcpK07pLgB78q4hcsNFa9/0bdeimdI +QDQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xf13-20020a17090731cd00b00788361f96a2si25721138ejb.776.2022.10.22.08.47.41; Sat, 22 Oct 2022 08:48:07 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbiJVPgy (ORCPT + 99 others); Sat, 22 Oct 2022 11:36:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229571AbiJVPgx (ORCPT ); Sat, 22 Oct 2022 11:36:53 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D33927173; Sat, 22 Oct 2022 08:36:52 -0700 (PDT) Received: from fraeml736-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MvljN1C7qz67Q9H; Sat, 22 Oct 2022 23:33:28 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml736-chm.china.huawei.com (10.206.15.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 22 Oct 2022 17:36:49 +0200 Received: from localhost.localdomain (10.69.192.58) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 22 Oct 2022 16:36:47 +0100 From: John Garry To: CC: , , , John Garry Subject: [PATCH] blk-mq: Properly init bios from blk_mq_alloc_request_hctx() Date: Sun, 23 Oct 2022 00:07:26 +0800 Message-ID: <1666454846-11749-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 Function blk_mq_alloc_request_hctx() is missing zeroing/init of rq->bio, biotail, __sector, and __data_len members, which blk_mq_alloc_request() has. Move init'ing of those members to common blk_mq_rq_ctx_init(). Fixes: 1f5bd336b9150 ("blk-mq: add blk_mq_alloc_request_hctx") Suggested-by: Bart Van Assche Signed-off-by: John Garry diff --git a/block/blk-mq.c b/block/blk-mq.c index 8070b6c10e8d..260adeb2e455 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -402,6 +402,10 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data, } } + rq->__data_len = 0; + rq->__sector = (sector_t) -1; + rq->bio = rq->biotail = NULL; + return rq; } @@ -591,9 +595,6 @@ struct request *blk_mq_alloc_request(struct request_queue *q, blk_opf_t opf, if (!rq) goto out_queue_exit; } - rq->__data_len = 0; - rq->__sector = (sector_t) -1; - rq->bio = rq->biotail = NULL; return rq; out_queue_exit: blk_queue_exit(q); -- 2.35.3