Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4074159imu; Mon, 28 Jan 2019 16:48:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN6wYjoK+kph90JWR+FpBhlLItv4Uj85i7wijFg45ZQTaLbMgB43D5JGyLhZE9H8h4mpdasZ X-Received: by 2002:a17:902:9a9:: with SMTP id 38mr23551816pln.204.1548722899073; Mon, 28 Jan 2019 16:48:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548722899; cv=none; d=google.com; s=arc-20160816; b=xd0sV//L9HDcAMX0HI0wkEBxC01LNyW0EZF8c8/oQSqTJPQO7Nw0vtSEZt3oe9/0mR tihtegpJYTZGUhCo2BVeoDozkSOHcW+yA0LE6sVZWNX0ZMIxqRdOk0AP5qEucwPcSnos aJHh4IG3ETGcGFrAho0LUBhnLSDgnwNamscaqGpIR0uvMAhzfRrPEK+ony/z/jfyiLlp d6U+Jah1Y3BCQuWAE3MRAUs9ytgOYNMm2IFAWUU8i8qKkGahqhEZQHjDdD/Z+boM8PAg LODTAvX9OOLKRNK6hbNmztpLgyR5xB19Bql+c32aWvrLzpKcgDhdmmndtYe93uUmtq+Y 9kAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=MDL2Nd1DyC1k4phrLZhGudq/LnZWHAfVtzrcI9Jv1xM=; b=GbUCaw/hsm17vP2R/XiQ5KPisdv8KeUPivd0bGPG+L4XiaVW/DFfx0QOCvnsM2yIuC yi7cu/Lfr2FvE61W1vrDW1xqLNzwsDnsGJ9K0R2zuvU3pTYc7RYN7tpHr/kPCZbdS53i mYN1DMi+eTaXPylQUgNxZwkT47zRqyKD8irU9OHZkY3zEj3VAi98xuEZB6e7gI9iwsqF U/2FJl9LKyREM5JUDNu8hH8Q+Fw4qTz5vuy7w2Yv3UbYULxhPWeADBTbruHEMMC4CLpH 4uLifl53qIMUDxiwrDKOZMKUBcORYN1yNaJ5PfG0oerX4FmZv6CcauAvaA/tWKLkt/UQ DoLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h188si34144967pfg.44.2019.01.28.16.48.02; Mon, 28 Jan 2019 16:48:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727476AbfA2Arl (ORCPT + 99 others); Mon, 28 Jan 2019 19:47:41 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:51712 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726803AbfA2Ark (ORCPT ); Mon, 28 Jan 2019 19:47:40 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B15F296E0F73B55B9020; Tue, 29 Jan 2019 08:47:36 +0800 (CST) Received: from [127.0.0.1] (10.74.219.194) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.408.0; Tue, 29 Jan 2019 08:47:25 +0800 Subject: Re: [PATCH] block: set rq->cmd_flags with bio->opf instead of data->cmd_flags when bio is not Null To: Christoph Hellwig , John Garry References: <1548337430-66690-1-git-send-email-chenxiang66@hisilicon.com> <1c34d6f9-8c3c-a7ff-a956-46e9dc3c2298@hisilicon.com> <20190128140716.GA18162@infradead.org> <55972c1a-051a-1396-6796-84f349830a35@huawei.com> <20190128155752.GA29076@infradead.org> CC: , , , , , , "linux-block@vger.kernel.org" From: "chenxiang (M)" Message-ID: <17ca562e-1681-c501-1cd3-ac229d893dd9@hisilicon.com> Date: Tue, 29 Jan 2019 08:47:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20190128155752.GA29076@infradead.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.219.194] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2019/1/28 23:57, Christoph Hellwig 写道: > On Mon, Jan 28, 2019 at 03:36:58PM +0000, John Garry wrote: >> As I understood, the problem is the scenario of calling >> blk_mq_make_request()->bio_integrity_prep() where we then allocate a bio >> integrity payload in calling bio_integrity_alloc(). >> >> In this case, bio_integrity_alloc() sets bio->bi_opf |= REQ_INTEGRITY, which >> is no longer consistent with data.cmd_flags. > I don't see how that could happen: > > static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) > { > ... > > if (!bio_integrity_prep(bio)) > return BLK_QC_T_NONE; > > ... > > data.cmd_flags = bio->bi_opf; > rq = blk_mq_get_request(q, bio, &data); Sorry to disturb, i used kernel 5.0-rc1 which has the issue, and it is fixed on linux-next branch. > > > . >