From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA7BFC3A5A9 for ; Sat, 2 May 2020 23:55:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C5A9F20721 for ; Sat, 2 May 2020 23:55:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GXHueRMB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726483AbgEBXz0 (ORCPT ); Sat, 2 May 2020 19:55:26 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:53055 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725798AbgEBXz0 (ORCPT ); Sat, 2 May 2020 19:55:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588463725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=++1YgR4HmPwW+Gr2I22tX2N4dKnmaM4easkky93J5gc=; b=GXHueRMBO75oLsSDwqLuzSCcWrETYbLMNEyNYxwibr2L0UhecnnUt5d2rQ46nkIrxMYtoT eVC70LrJpeSa3Z1NPBpoB6pW9NFYH0+zj87tfkENfUrI+Es1MwoI62NAfZk5VxNDF5JUWL af1F7o5S/CN6F9sycF1XAfEPhFUYQ1I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-164-ZFECDHLrPV6HGDATGr5bQw-1; Sat, 02 May 2020 19:55:18 -0400 X-MC-Unique: ZFECDHLrPV6HGDATGr5bQw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B761D1005510; Sat, 2 May 2020 23:55:16 +0000 (UTC) Received: from localhost (ovpn-8-17.pek2.redhat.com [10.72.8.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B9D160BE1; Sat, 2 May 2020 23:55:07 +0000 (UTC) From: Ming Lei To: Jens Axboe Cc: linux-block@vger.kernel.org, Ming Lei , John Garry , Bart Van Assche , Hannes Reinecke , Christoph Hellwig , Thomas Gleixner , Mike Snitzer , dm-devel@redhat.com, Hannes Reinecke , "Martin K . Petersen" Subject: [PATCH V9 01/11] block: clone nr_integrity_segments and write_hint in blk_rq_prep_clone Date: Sun, 3 May 2020 07:54:44 +0800 Message-Id: <20200502235454.1118520-2-ming.lei@redhat.com> In-Reply-To: <20200502235454.1118520-1-ming.lei@redhat.com> References: <20200502235454.1118520-1-ming.lei@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Content-Transfer-Encoding: quoted-printable Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org So far blk_rq_prep_clone() is only used for setup one underlying cloned request from dm-rq request. block intetrity can be enabled for both dm-rq and the underlying queues, so it is reasonable to clone rq's nr_integrity_segments. Also write_hint is from bio, it should have been cloned too. So clone nr_integrity_segments and write_hint in blk_rq_prep_clone. Cc: John Garry Cc: Bart Van Assche Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Thomas Gleixner Cc: Mike Snitzer Cc: dm-devel@redhat.com Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Signed-off-by: Ming Lei --- block/blk-core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/blk-core.c b/block/blk-core.c index 7f11560bfddb..1fe73051fec3 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1630,8 +1630,12 @@ int blk_rq_prep_clone(struct request *rq, struct r= equest *rq_src, rq->rq_flags |=3D RQF_SPECIAL_PAYLOAD; rq->special_vec =3D rq_src->special_vec; } +#ifdef CONFIG_BLK_DEV_INTEGRITY + rq->nr_integrity_segments =3D rq_src->nr_integrity_segments; +#endif rq->nr_phys_segments =3D rq_src->nr_phys_segments; rq->ioprio =3D rq_src->ioprio; + rq->write_hint =3D rq_src->write_hint; =20 return 0; =20 --=20 2.25.2