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 DE4B1C2BA1A for ; Fri, 24 Apr 2020 10:24:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B33BF20728 for ; Fri, 24 Apr 2020 10:24:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="K5XPhUeF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726668AbgDXKYY (ORCPT ); Fri, 24 Apr 2020 06:24:24 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:57987 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726289AbgDXKYY (ORCPT ); Fri, 24 Apr 2020 06:24:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587723863; 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=8V6dpd3Jl5tJ9/ZXlsCtYTl+mL1GPzgwwnLoa+3CXWg=; b=K5XPhUeF21aMhlRiOjVQLXb1NqCNJWZqH2o2I/QhOgR6z87XfDkMkJ2HFqtFEnOe8ei5iM LqnSLQQ+u/+v07zJFy3RTlo7gmwIuggyxtg9vCRLq5eDEiwt5gstvtLRAlV4Kvz8lYTH3b M7umSzSBgiTDhMixtjTgPBiCgipb5EQ= 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-362-3sy0wdZ_MMuieKS008Qi5g-1; Fri, 24 Apr 2020 06:24:16 -0400 X-MC-Unique: 3sy0wdZ_MMuieKS008Qi5g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B79048015CE; Fri, 24 Apr 2020 10:24:14 +0000 (UTC) Received: from localhost (ovpn-8-38.pek2.redhat.com [10.72.8.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C3FA196AE; Fri, 24 Apr 2020 10:24:05 +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 Subject: [PATCH V8 01/11] block: clone nr_integrity_segments and write_hint in blk_rq_prep_clone Date: Fri, 24 Apr 2020 18:23:41 +0800 Message-Id: <20200424102351.475641-2-ming.lei@redhat.com> In-Reply-To: <20200424102351.475641-1-ming.lei@redhat.com> References: <20200424102351.475641-1-ming.lei@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 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 7e4a1da0715e..91537e526b45 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1636,9 +1636,13 @@ 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->extra_len =3D rq_src->extra_len; + rq->write_hint =3D rq_src->write_hint; =20 return 0; =20 --=20 2.25.2