From patchwork Mon May 1 17:53:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 9706759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 81A36602B5 for ; Mon, 1 May 2017 17:53:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77195208C2 for ; Mon, 1 May 2017 17:53:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BC6A2808F; Mon, 1 May 2017 17:53:53 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA4A0208C2 for ; Mon, 1 May 2017 17:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750723AbdEARxw (ORCPT ); Mon, 1 May 2017 13:53:52 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:56443 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750703AbdEARxv (ORCPT ); Mon, 1 May 2017 13:53:51 -0400 X-IronPort-AV: E=Sophos;i="5.37,401,1488816000"; d="scan'208";a="15320424" Received: from mail-bl2nam02lp0080.outbound.protection.outlook.com (HELO NAM02-BL2-obe.outbound.protection.outlook.com) ([207.46.163.80]) by ob1.hgst.iphmx.com with ESMTP; 02 May 2017 01:53:50 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ULM2sj8YW67C+jyROqwGiZfuhI01MDWaoffXGFxSgfM=; b=hGd/FXHW0U7pN/p8Qg4sEwiYscSMLVJJGE2/JkdFPiOe/YJny/kM06Sg48NtinMl2tBGZu1BPvvY7Y02M4ISdaKyQwONnvUGk1RbwgTu2zuoF0ESaocvMuekmxdQuknDNbufKJQOEtt8YTG042WSp1CQV1yHFiBXVNeMYrkUAUE= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=wdc.com; Received: from washi.fujisawa.hgst.com (199.255.44.173) by BL2PR04MB1971.namprd04.prod.outlook.com (10.167.97.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13; Mon, 1 May 2017 17:53:45 +0000 From: damien.lemoal@wdc.com To: dm-devel@redhat.com, Mike Snitzer , Alasdair Kergon Cc: Hannes Reinecke , Christoph Hellwig , Bart Van Assche , linux-block@vger.kernel.org, Damien Le Moal Subject: [PATCH v2 04/10] dm: Fix REQ_OP_ZONE_RESET bio handling Date: Tue, 2 May 2017 02:53:08 +0900 Message-Id: <20170501175314.10922-5-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170501175314.10922-1-damien.lemoal@wdc.com> References: <20170501175314.10922-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-Originating-IP: [199.255.44.173] X-ClientProxiedBy: BN6PR1301CA0002.namprd13.prod.outlook.com (10.174.84.143) To BL2PR04MB1971.namprd04.prod.outlook.com (10.167.97.143) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1828a6ee-3113-4ca7-705c-08d490bb049c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:BL2PR04MB1971; X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB1971; 3:2HMqLoSMgliYjtc0TAoB4KCxGqnYQ9CmqQ4tSA4EzgqLsbxJpox4+SKXsi9+jiR2r1fOY+tiJczjhZwu/tA4NMtcod8sht2VYCjvMvDZzzmcXYC5v5KzNvc51WfuxETPx73+QuQLWaj50dbcOQDVSwpzmDOO3BO7EH2GscVw3SVKe5goqc4LpDTc0cB13L5a8zlys+gkDC11RV2gwqoryaABJSffWh2ouJSG7+APm2voDf3jlK3cqkA5Nyk5D5pxMFf5wE0ZLEIr6nBvPPkMlA68Nzb3NXhbH2g+cysOPAEH/Wuz84GLgx1+vnEaKuq/dqP7TaC7Rq7qRuN0KuLeSckp/9zI5VsL1y8V1MSWy1U=; 25:AsYLZQengsNk39EW2sgsWaWKfaHmM+f47GGqwBBbtm7pqBgXRGpHleU8Qt5IkaMWCEO+rYyFBu2n60fK3hbnmFErU2f2OM5tSOB8S59AuTiVzLBzsCyxr/3UDag9nRcax4/zfvWoDpHjxshy1px46Jy2o753XzowO0r1NOplkGfhdjjwcO5VZxr9vhqYfylaFteoRv2crhXfULJsq0YFQKNWPzTSPhLoYfMO4murajzX3g6jZbcXFvuXBGzLyTo274qU/z++kgaFVEPP6RH0t/oFugXyNDYhhxpgHzmlaPPHfZrArrWhTubqmsYxKMGbAjLP4s+AACFNsUQ3dZJcD2AotbIMsjELViv6eMLeBE+qTnmuIsR5wE4zMACF/fsXpCzpYPeuSFoqBKMAmSt8EPX6qsJmuO1okpVmiej0rPJLTg9PY8pMAiD1zFtouyi4AhcSRVSz6YMxAFy4onOlQQ== X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB1971; 31:SZFMk/3zDFW7pIzKILphhz1yFFyo8N+a8L4fm2AG1S0uqREPOegmGxryz54RqU2xjolzov0+BBwWO2wNHQFYSODW/8Q0uDnGeUb6ILInjv0I2kD8VoU5Nt7vO0GTodK/yWTtHLBjEat82AwPV5ZCSjeiXBjFlIbPkhVWeg95L9a0+uSYut6O2gpLX152oS006JKwdWT8HdDHb1mPYBQosQnJQ8u/uWiMWEZzHjSZ2ZsxDZFwlQ7LCTWtzVR9yG9T; 20:cakqbGMNnZWeGVUdxrGNm/sIXj51hOgzi5f6qbzJqp8AYxmtT1xuDoHUHkyU95r/sGLUfypXyNGbOqAYFe2qmzbEHdDJKzR5mPm9I3YQoafTy3go3Ima7dlhQTJ3Ych0/LL8c6XLkHdAO3jnAtkzYU9/ORlqIZeJ19+DRmg2HCr9onDVF1Lv3J2JslXni+C/m09pjDeN96fGrVf5w0darVPsxWRz8NfSYy83FHJP34+mviWCXXwi4XV3254K9SS0UXFKoGCUdeO7vAe4SYjHJDTJJM0QR5yY1MPQvMpek8V5qXdX3yaufE8wycK46jJBXrZI/Z42LkQAn5RIQM7YUsT3Owv84K301MDdnsLC2CiqNmCd/iVmjiTppLOqSpfgNVnMcWXJrILUkHou1ZZb2gdmSvb8eFKSFIlakKJ5sPLG0c/JI2H2HwRMV1UTky4GT9ymK8Xts3AJvEjreOxOM4MWVq82mFiVIMTF+HC1yv9YzJZUSIO4wAj3ZRXKvSN+ WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123555025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(6072148); SRVR:BL2PR04MB1971; BCL:0; PCL:0; RULEID:; SRVR:BL2PR04MB1971; X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB1971; 4:zhmx54OO2dksV8iGdnejWMIcnMzynsAY7jkMp/Gid7GFeC16PpYwpVFPUzlV+ONfNjaOLWjDxkuMyBjtDJS2XMPzgoYb527vnp4XUy61s7qIA1mP/fFl52Q0IL7hYYvjzNXIoiNwNKdKZN2kzB58RooVMtYNh2mB9CCjguNj5kKRi5gh29/yIohWzSd8TMRIWWGX5wXI9I4WVSYaEiu/o+6Dh2d9Btm3NZkBBCQoVIU/19iWbYL2nBThSLPI9mzACOfetLXO6pS5pwoM048OyCLQMfwVQXSZ3btZt/BAUbfwdrLys0TowPcIdlWRu341A1NtK9NMaQPZXpGDO1zAbAe2o0NlKhwt9ZvRvsN9lxiyP8De7sTWh1IwWup6c73S5sVagf1ibpPsQEHBW64BqtsNRBn3eV/XXcRjTYE3zB8MWcy5TY6N9MPI47Zrq+KdBuBflLu0CuLtFnrtakVcAuS4qPlT/BsYYKo9iQ2bcI7ad7qSP+5PZFRVejc0GANeaKOtDYfUkvai/9lddBaPz0zKrkl5UzQmRi6T3TmX+O9XsIXATBI+WLC8nd/5ipHCMTTXR6iKa5XKPoLSrqIWoqrPF+xgt9LHgI5l6Ca0HRV/HlIkWYFswyiOM+50Pl2wVmsIgvyKViicS1ztYijF7AZyQDi2qR08Ckcj3AdK56OPCMnJwvGnuGyPCLO1WiwGvQPLp2LRdhY/QxEcEeOlZ0IwyqvmngBmKV4MRMoGr9Y= X-Forefront-PRVS: 02945962BD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39840400002)(39860400002)(39400400002)(39410400002)(39850400002)(2950100002)(47776003)(50226002)(85782001)(25786009)(42186005)(7736002)(5660300001)(6636002)(305945005)(81166006)(6116002)(3846002)(8676002)(33646002)(54906002)(6666003)(53936002)(6486002)(9686003)(189998001)(6512007)(86362001)(1076002)(50466002)(2906002)(38730400002)(48376002)(4326008)(36756003)(76176999)(508600001)(50986999)(85772001); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR04MB1971; H:washi.fujisawa.hgst.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR04MB1971; 23:n02ATfp3BoU9IAIXG9SFzm4H7jvXDkPEXClCBhWs4?= =?us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SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB1971; 7:AD6gSIdSWc3yLDdsRqaynI/kgHNVLI9/dZUExVUbM6pyMn8/PGmYDM4s2EPBriJrXNen3oYoHfrWQVf1/mEbJ4I16G28JlMjnS23HovTVV4tAsFnKqJ0DBFmVZae8/gtaWUOd01CQqOT8Co5957YRL7UCBhFE67MA8yJSGyrpRMvjaJ8jKWLMblq8GG9qzPoanf1KEjkQBfyGqogMdvHQ6zIEmUs1e9ubtVV/roZnH3KxaifTAVzDP/wAVPunzuUEEYoe9D2SiQYPPKQtRevRY4sIVViBOMoQiA1Ykhz3WR+XNcZqMXBCfeJSUWvSHemHfEZZz2uC9rBooasxS0mfw==; 20:U7avaay6M0x63FIx30pI5W/AjELdwJ6/P937CUXQhLxjjuNUEYuMalG9IggKnhmScxMrQPv6IQTKVwfmTokXp9Cz36CXHALUUWbXLZHqXLFfd86lMdsj/Ny7ajl6jVJcsIkXzuBLAEj6qLeOMgown+jOZ53pzuvdyMIrPD02wG8= X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2017 17:53:45.7562 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR04MB1971 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Damien Le Moal The REQ_OP_ZONE_RESET bio has no payload and zero sectors. Its position is the only information used to indicate the zone to reset on the device. Due to its zero length, this bio is not cloned and sent to the target through the non-flush case in __split_and_process_bio(). Add an additional case in that function to call __split_and_process_non_flush() without checking the clone info size. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke --- drivers/md/dm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index dfb7597..1d98035 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1318,6 +1318,10 @@ static void __split_and_process_bio(struct mapped_device *md, ci.sector_count = 0; error = __send_empty_flush(&ci); /* dec_pending submits any data associated with flush */ + } else if (bio_op(bio) == REQ_OP_ZONE_RESET) { + ci.bio = bio; + ci.sector_count = 0; + error = __split_and_process_non_flush(&ci); } else { ci.bio = bio; ci.sector_count = bio_sectors(bio);