From patchwork Fri Apr 24 10:23:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 11507457 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6CDE313B2 for ; Fri, 24 Apr 2020 10:24:30 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2886320728 for ; Fri, 24 Apr 2020 10:24:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AspeL+6Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2886320728 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587723868; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Ub7rwOOdZ4MKXrkOtPxBgzskTdz5PccvUCFwaZC2ew0=; b=AspeL+6Z8zD1vwFYWduaEV1jdPOea1EsqqIR6XEMfCWARTy6+cVUwMhhkWsrpD0NNSznnJ FAa4IUPdHNb9TOuujNbn8gNy5rmr/KtzD4l/BuxRNcJmghBOGteztSImYpDFncqhV34w6b eq6spGyAniI1cbgAAiXEOIk/3C5ASEw= 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-431-KvvCx_frMCyPMq1hzeCpAw-1; Fri, 24 Apr 2020 06:24:26 -0400 X-MC-Unique: KvvCx_frMCyPMq1hzeCpAw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0F046461; Fri, 24 Apr 2020 10:24:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 82C92100164D; Fri, 24 Apr 2020 10:24:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 15DA44CAA0; Fri, 24 Apr 2020 10:24:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03OAOE2i022277 for ; Fri, 24 Apr 2020 06:24:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id B5BC899CD; Fri, 24 Apr 2020 10:24:14 +0000 (UTC) Delivered-To: dm-devel@redhat.com 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 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 X-loop: dm-devel@redhat.com Cc: Hannes Reinecke , Bart Van Assche , Mike Snitzer , John Garry , Ming Lei , linux-block@vger.kernel.org, dm-devel@redhat.com, Thomas Gleixner , Christoph Hellwig Subject: [dm-devel] [PATCH V8 01/11] block: clone nr_integrity_segments and write_hint in blk_rq_prep_clone X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen --- 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 request *rq_src, rq->rq_flags |= RQF_SPECIAL_PAYLOAD; rq->special_vec = rq_src->special_vec; } +#ifdef CONFIG_BLK_DEV_INTEGRITY + rq->nr_integrity_segments = rq_src->nr_integrity_segments; +#endif rq->nr_phys_segments = rq_src->nr_phys_segments; rq->ioprio = rq_src->ioprio; rq->extra_len = rq_src->extra_len; + rq->write_hint = rq_src->write_hint; return 0;