From patchwork Thu Feb 14 09:19:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yangerkun X-Patchwork-Id: 10812355 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4FFC313A4 for ; Thu, 14 Feb 2019 10:40:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C6492D693 for ; Thu, 14 Feb 2019 10:40:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3055A2D696; Thu, 14 Feb 2019 10:40:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CE3F92D693 for ; Thu, 14 Feb 2019 10:40:58 +0000 (UTC) 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 mx1.redhat.com (Postfix) with ESMTPS id 8832C81F1B; Thu, 14 Feb 2019 10:40:57 +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 56E8460C54; Thu, 14 Feb 2019 10:40:57 +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 1D6A03F600; Thu, 14 Feb 2019 10:40:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1E9FXLw011631 for ; Thu, 14 Feb 2019 04:15:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id D3EB660C6A; Thu, 14 Feb 2019 09:15:33 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C698460C62; Thu, 14 Feb 2019 09:15:29 +0000 (UTC) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 47893A7896; Thu, 14 Feb 2019 09:15:28 +0000 (UTC) Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id BBCC2E41FCA107098CAD; Thu, 14 Feb 2019 17:15:19 +0800 (CST) Received: from RH5885H-V3.huawei.com (10.90.53.225) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Thu, 14 Feb 2019 17:15:13 +0800 From: yangerkun To: , Date: Thu, 14 Feb 2019 17:19:30 +0800 Message-ID: <20190214091930.121952-1-yangerkun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 14 Feb 2019 09:15:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 14 Feb 2019 09:15:28 +0000 (UTC) for IP:'45.249.212.32' DOMAIN:'szxga06-in.huawei.com' HELO:'huawei.com' FROM:'yangerkun@huawei.com' RCPT:'' X-RedHat-Spam-Score: -2.302 (RCVD_IN_DNSWL_MED, SPF_HELO_PASS, SPF_PASS) 45.249.212.32 szxga06-in.huawei.com 45.249.212.32 szxga06-in.huawei.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Thu, 14 Feb 2019 05:39:42 -0500 Cc: yangerkun@huawei.com, miaoxie@huawei.com, dm-devel@redhat.com, houtao1@huawei.com Subject: [dm-devel] [PATCH] dm: clear BIO_SEG_VALID in clone_bio 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 14 Feb 2019 10:40:58 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Since 57c36519e4("dm: fix clone_bio() to trigger blk_recount_segments()") has been reverted by fa8db494("dm: don't use bio_trim() afterall"), the problem that clone bio won't trigger blk_recount_segments will exits again. So just clean the flag in clone_bio. Fixes: fa8db4948f522("dm: don't use bio_trim() afterall") Signed-off-by: yangerkun --- drivers/md/dm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 515e6af..b22ac04 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1336,6 +1336,7 @@ static int clone_bio(struct dm_target_io *tio, struct bio *bio, return r; } + bio_clear_flag(clone, BIO_SEG_VALID); bio_advance(clone, to_bytes(sector - clone->bi_iter.bi_sector)); clone->bi_iter.bi_size = to_bytes(len);