From patchwork Fri Feb 26 02:25:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiva Krishna X-Patchwork-Id: 8430501 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 72D679F314 for ; Fri, 26 Feb 2016 02:28:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 900CB202B8 for ; Fri, 26 Feb 2016 02:28:47 +0000 (UTC) Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA0AD20295 for ; Fri, 26 Feb 2016 02:28:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1Q2PJYu054961; Thu, 25 Feb 2016 21:25:20 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u1Q2PIqh005458 for ; Thu, 25 Feb 2016 21:25:18 -0500 Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1Q2PIkE001093 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 25 Feb 2016 21:25:18 -0500 Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0062.outbound.protection.outlook.com [157.56.111.62]) by mx1.redhat.com (Postfix) with ESMTPS id 394FC65423; Fri, 26 Feb 2016 02:25:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nimblestorage4.onmicrosoft.com; s=selector1-nimblestorage-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=fR3Dkh1ItTabuOqqsOBojCpZRykPg0IMW2rkkGB+4lA=; b=Qy6PqTRPgkRnmTlI6X+uRn6iaKM5ue+PSguj3PfERmNkzRVzHb5eTHYo+ArDn1nhHzNF9wHV0+A6Wuos+gTxnyRn6l1cbYFYHgsfxpfjofKX/Jq30DpQ/QeIDpOS4zNkqaJQKFeYcvVhHdvcxvqdZyGYVSPxYTcjANkcCDFOx1A= Received: from BY1PR0201CA0010.namprd02.prod.outlook.com (10.160.191.148) by CY1PR0201MB1035.namprd02.prod.outlook.com (10.161.211.153) with Microsoft SMTP Server (TLS) id 15.1.409.15; Fri, 26 Feb 2016 02:25:14 +0000 Received: from BY2FFO11FD001.protection.gbl (2a01:111:f400:7c0c::158) by BY1PR0201CA0010.outlook.office365.com (2a01:111:e400:4814::20) with Microsoft SMTP Server (TLS) id 15.1.409.15 via Frontend Transport; Fri, 26 Feb 2016 02:25:14 +0000 Authentication-Results: spf=pass (sender IP is 198.54.169.104) smtp.mailfrom=nimblestorage.com; opensvc.com; dkim=none (message not signed) header.d=none;opensvc.com; dmarc=bestguesspass action=none header.from=nimblestorage.com; Received-SPF: Pass (protection.outlook.com: domain of nimblestorage.com designates 198.54.169.104 as permitted sender) receiver=protection.outlook.com; client-ip=198.54.169.104; helo=mail.nimblestorage.com; Received: from mail.nimblestorage.com (198.54.169.104) by BY2FFO11FD001.mail.protection.outlook.com (10.1.14.123) with Microsoft SMTP Server (TLS) id 15.1.422.5 via Frontend Transport; Fri, 26 Feb 2016 02:25:12 +0000 Received: from CASHUB02.nimblestorage.com (10.11.0.121) by CASHUB01.nimblestorage.com (10.11.0.124) with Microsoft SMTP Server (TLS) id 14.3.235.1; Thu, 25 Feb 2016 18:25:09 -0800 Received: from SJC-MBX-03.nimblestorage.com ([fe80::84bf:bbc4:41c5:ecad]) by cashub02.nimblestorage.com ([::1]) with mapi id 14.03.0235.001; Thu, 25 Feb 2016 18:25:09 -0800 From: Shiva Krishna To: "dm-devel@redhat.com" Thread-Topic: [PATCH V2]multipath-tools: prevent unnecessary reinstate of stand-by paths with implicit tpgs mode and no active array paths Thread-Index: AQHRcDzpQXezHHYls0yvaEJ6OiXNtA== Date: Fri, 26 Feb 2016 02:25:08 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.20.43.180] Content-ID: <18D4F4121B3C964B9ED2A42447FDC4F2@nimblestorage.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CPI:198.54.169.104; IPV:CAL; CTRY:ZA; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(199003)(189002)(2351001)(16796002)(106116001)(229853001)(87936001)(106466001)(53416004)(36756003)(92566002)(2501003)(5250100002)(86362001)(5001960100002)(50986999)(54356999)(110136002)(6116002)(23726003)(5003600100002)(3846002)(102836003)(1220700001)(19580405001)(586003)(47776003)(97756001)(6806005)(19580395003)(5004730100002)(189998001)(11100500001)(5008740100001)(1096002)(4326007)(2900100001)(50466002)(2906002)(46406003)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB1035; H:mail.nimblestorage.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD001; 1:AiClppbcybTSVU1ySV5UjuhUupLeDlBy+aUKSveWCO3skUkhnCw6Tp9hux1kq60z7LRVnIcR4t9q/UmPJZjwBvzYb4v/bJSz6SKZL626tv+61ylU7B+dN/9E96ftJI6unu7h64Q39rwNnIHIULKAQ3iAG9Bd9okZsPHHr93iNMQMsU2X9p0iuTStp/fqeP8m7+yXanv0TWLAzCESvgHNctSbV/xVv8+WWKkzjR7OMJ3XX9FgB9JjD/+dun6aJeT58WY5CZG37azoccOVvU8mYJtkB1eqNqbxpMrA3a7sRqeFPVyyNC2xv2ZdOTeKXvNXd95whBIp1B9J67sUQXnitXLVq+6zos4yf9SKagBxtgYJtbwS+4vAjnDnXJRsquvL/cGtpWXi05pUG46RvPTFip5FRqonHiFjUx6zaD7XewY= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1035; 2:+wkiy10sCMgNK3tVjnWOhAy3wPdkHSHchhr8ntdjt+UIrOn8ACr9zPCrzhmOiz+GGGiFoGmtsmEnfAMxAhFAU9BhoLx86jZ8XzDOsApeb7A9d3jnH5SeMcxpqdfWx/yZfDjXC6jbjLj67j06qie3dw==; 3:AzwjInsgItywpA3DUjMcGntz+c6gbG3YNRXemRYlDNEII+2I+aTaYattN/LxupF3Z0WSry+xEsu6+EVrqExH6roAck8+RwLQoogq30jkN0bScDNOw1+mAWupUYnzVpDvelZVHkxqdzfCxJABkGpenOao+DS7b6tQokgrXyyTbOUVgxbGhJGyLJjxwDisgOAESFstQmRpSOytMFJGbblSxQ==; 25:zaRgEVQo5y8I03S/zmlUqhmqOotMHGRzFYMpyI+8btil+gPapulK2MWdfUq0CAlWyiaqQPTT6+qYWyk4vCSOud2KJQggbVm2TaMiTx8jLlI2NWOAJzK5Ynjy6VA/oytSL2Z1P0bMaX8bdJ7eCv40P7tOb9sndTO3U8kGRViml3lNwfcVWCmqRipQm4TKe8ETd+ENgtuvQ3fRufKTr6ahwpDJH1atG3dC3GJ22PaVyOohUHb/iqnrXrlm+YQKjEvfNgIg9cvdIZHQ7NkNYaRvcg9/We0E2R60m4winlcZHvwR414/dYGyTdoOfhYTaAH3uClKlIYwvXAYeftxm8PEQQ== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:CY1PR0201MB1035; X-MS-Office365-Filtering-Correlation-Id: 9b625a4e-213e-44a9-a9a5-08d33e540e59 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1035; 20:KIoh7rz4zutrRfyPs+LRDumEWAAMyaDSZ/OoWeqwUR70+osyewbas3qZjyXRQJ352ZrrFPz9O1U7axfFUDhQ0j9fRMaFSl+b3KoNSgjhng0U2tWAFUY2tsW/uBk0xrjcies5WkLrOPL6+OIij81PpWJeu4DvAim+n/Oh5fNGg9l8UFj9MbXzAqiyUtJqszXPDrQ7Xe2W8OivvwSThzugnlxtgeuWJOELbd0tZ9OQve/5XW8UABqCZTiySo627jf14c6x90nJrMG1KMtKo359pVSvtJrAY/elKJfQcv6LJ8Wj8IGuGEk7ytI7gc/fTKxgLLvXXDv/nvlb1xQuemXd4OHpyCIKtZTNOGr1ngJAwpt2qgcR1bxeH85Xb6xRH3ZZm3gyk25p/EA/tag9Fgqkk3CKSJAdUPOSN/EpwnbRy0ohYmoKrlIdBISSOFuEC8dAU9JujCqfLPPV8nrcUDz+D3biACk7BKJTWauekVhymKkCoypz1BmRr9m0qzcyCfRMpopOzg0yLh8V6aOC8e8W6OL4DBZXYivHK1nv/mjhFW8ltom3qdQELpAdImSE7IeP3kt9jyrLxkac80/aapOYIdqBgKOB2dx9qrkWWujLsMc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(13013025)(13021025)(5005006)(13023025)(10201501046)(3002001); SRVR:CY1PR0201MB1035; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB1035; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1035; 4:l7NyIaKgX9UeLl9Px+PEKslNoekB8DNcjyHPEh2IBqXopX5vl96e0DVVcafUZ9/B/gtGEW+onpjo9ee8fsOhYB2Hmt0TMT7BqyNMGROz9GirP+S5eMZIwvnze4oeTz8K+SvVmGyvgu8UcvBHnZwrMdhDQecuLawzCGOA7/UmdzaP79H/TVTpPCDCVXBR5WfwWgqlkUX0GcPePaperaJPA7kul3MSRgn3mjiLrKsq5j8emkWIoLMYoO0K7HgEngYli3deNTm/73WKbMrkpP8voKvsnH3+uOsxAOk3woPQeWxljVYVo74kxhiungdfXcSFs/aCMVersr0jJ0nu/9BUK02e1fTM93mr8jae0j9hMhF5cMQ850Xku/Jkg02yZDBVWBstuC0RjSxGslaZSSORtO8f/aRL/eM04xo0K1fOckk= X-Forefront-PRVS: 0864A36BBF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0201MB1035; 23:Vss7W6r/0u79nGS/W50w6nSAKvduaysxdovjzVD?= =?us-ascii?Q?vJ4yo5oZR1WdeYnZ973/8Ok2IxYOS9g34U0Tx/os4jB8icOC8ZzEHbnWkKlB?= =?us-ascii?Q?kmbwQLc0H5XMPiWr/NZYXva6ToJbJayDx9R0S5aUh6Cv2WRxCyKXn6kXoBIH?= =?us-ascii?Q?ntYFXRQUeC+ApDbByBQqJzQ0aQK7XqiCzG08SgSCGPdFxgIpH6b+GaY5kPVF?= =?us-ascii?Q?qgsL6Ac5g4MRI4/nB2CiH1rAxKrDTzEraTSOJU4tzAASZvz5bcTivz4ivimt?= =?us-ascii?Q?QLEj5A9RUDHViY4cg+p1Q4aYs9uwGKNtmruxQ1xOrABjwvJNdGuGlVQnsx9W?= =?us-ascii?Q?NEN3FVACUX61CYU1DnIz8M720yTWUvIRg1vnJb2hu1K4vNAGxE1KT4JszrqS?= =?us-ascii?Q?3awix7WF2lc1LNykMuQXdfwCUn+Kszv8LP4hIu9UyGzKYpj03i4JOzs+4NrG?= =?us-ascii?Q?IXZbqKSfVBfFMMNKs6nllG+HtwV/o4cnoKhy0ZIngvBw1mRqTfGbPZi1pEU3?= =?us-ascii?Q?WqKPcNPwhSPjv9fAT/J3pdLJkn+zCN5se89L5AxFQLuSGFT1bZgweyELPrvv?= =?us-ascii?Q?0QBd2CNZRj2GQdWWDZYs+5jEW5BD5C9Fr9ct/f+fyWrdPBUxs1Jq47FvKQWW?= =?us-ascii?Q?vjr4N2Q9TKlK2ygQG5wLC29KfTVCICnVKsn/4Ub4AfW/m+as9XKxNtUmtCIK?= =?us-ascii?Q?kFB+VFITnejAznhsgd31pJk8MetbrqUwGc9wvy4rfBsmGEdV34YISLG0uYDR?= =?us-ascii?Q?JeRZjQKxX+lsMrNjZNZV3qC+9xMUUXH9hJlwNh3rviqrGexclodCMIlEkHGj?= =?us-ascii?Q?TLtz1C40+BdMxV1GucTiq2qbR7nPU8Mp2mLHoLVB90v31sEjSEzP4ao54dms?= =?us-ascii?Q?AIinM40SNqrQWufzxaNBHIxesPyTjk60MhCfOTsHvrpAiNHN+CBsU86xPnVk?= =?us-ascii?Q?orhhX+J99ujebF99WyGvqytJsGaY7K20MC/CzMJ97FX/UcyBFAovsQgsTYcz?= =?us-ascii?Q?XJF/DE+A701JTqT4Rw+TeD9a0zExre4jVJj/A18ToP7E/V99R/k4sOd/n4bL?= =?us-ascii?Q?EdziL2bKw5MYon63awVjo4mTP2HHiaPl/yWd3pha7Ohkhm8qhAX9fKGvWrGa?= =?us-ascii?Q?gAJ9e/C06K14=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1035; 5:/Q/V15X20wOpQA7OjpJ/bqCrBn5ByybVDH/vb0leL7EutiuUkLEHu/7/2iFK/cVUqa86AIgicjURafARBiZNnXspHU46J+bIKFWmi+GWvibtj6LJItTUcJi3IIs/dmwbS34LldEP2F5whwKTPXBljQ==; 24:LzhyLe8f0+/3Woa/9x8ZqyTZCeIOQTMnHHQ9knWZYK3RJKzOSdHZRqp/IBN4gsa+sqKIcSkHh58xGXK2IeARr4dLsaYiuOoptnO+CGGMThs= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nimblestorage.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2016 02:25:12.6276 (UTC) X-MS-Exchange-CrossTenant-Id: 84f04a72-ca5d-479c-b48d-72d80f13b585 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=84f04a72-ca5d-479c-b48d-72d80f13b585; Ip=[198.54.169.104]; Helo=[mail.nimblestorage.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB1035 X-Greylist: Sender IP whitelisted by DNSRBL, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 26 Feb 2016 02:25:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 26 Feb 2016 02:25:18 +0000 (UTC) for IP:'157.56.111.62' DOMAIN:'mail-bn1bon0062.outbound.protection.outlook.com' HELO:'na01-bn1-obe.outbound.protection.outlook.com' FROM:'Shiva.Krishna@nimblestorage.com' RCPT:'' X-RedHat-Spam-Score: 0.397 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS) 157.56.111.62 mail-bn1bon0062.outbound.protection.outlook.com 157.56.111.62 mail-bn1bon0062.outbound.protection.outlook.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id u1Q2PIqh005458 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH V2]multipath-tools: prevent unnecessary reinstate of stand-by paths with implicit tpgs mode and no active array paths 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-Spam-Status: No, score=-1.8 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP multipathd treats "stand-by" path as active(ghost) and reinstate path.This causes I/O hang issues and lots of "change" udev events in cases where only stand-by paths are present in multipath map and target supports only implicit tpgs mode(active/passive arrays) This can happen during system boot where only stand-by paths are discovered first and continuous retry of I/O's by dm-multipath and change(failed) events are hogging multipathd and slowing down the entire boot process with large number of volumes mapped (~100s). Selecting path checkers other than tur is not a solution as well, as they will continuously throw messages saying paths are failed for stand-by state. This patch will prevent re-instate of stand-by paths in this situation and thus prevent unnecessary i/o with failed events during boot or when active array goes down temporarily. With this patch, stand-by paths stay in failed state until atleast one active path is recovered or added to the map. Also, reinstate_path during switch_group Or CMD_CREATE are not affected as they will not occur when nr_active == 0. Detailed steps to hit the I/O hang issue even with no_path_retry: devices { device { vendor "Nimble" product "Server" path_grouping_policy group_by_prio detect_prio yes hardware_handler "1 alua" path_checker tur failback immediate fast_io_fail_tmo 10 no_path_retry 30 path_selector "round-robin 0" } } 1. Delete all active paths. mpathal (2e0176ad6309077166c9ce90033bfa248_1) dm-2 Nimble,Server size=20G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw `-+- policy='round-robin 0' prio=1 status=active |- 8:0:5:1 sdg 8:96 active ghost running `- 8:0:6:1 sdh 8:112 active ghost running 2. Issue I/O on mpath with zero active paths. dd if=/dev/mapper/mpathal of=/dev/null bs=512 count=1 iflag=direct & Nov 23 15:10:36 hitdev-rhel67 multipathd: mpathal: sdg - tur checker reports path is in standby state Nov 23 15:10:36 hitdev-rhel67 multipathd: 8:96: reinstated Nov 23 15:10:36 hitdev-rhel67 multipathd: mpathal: queue_if_no_path enabled Nov 23 15:10:36 hitdev-rhel67 multipathd: mpathal: Recovered to normal mode Nov 23 15:10:36 hitdev-rhel67 multipathd: mpathal: remaining active paths: 1 Nov 23 15:10:36 hitdev-rhel67 kernel: sd 8:0:5:1: alua: port group 02 state S non-preferred supports tolusna Nov 23 15:10:36 hitdev-rhel67 kernel: device-mapper: multipath: Failing path 8:96. Nov 23 15:10:36 hitdev-rhel67 multipathd: 8:96: mark as failed Nov 23 15:10:36 hitdev-rhel67 multipathd: mpathal: Entering recovery mode: max_retries=20 Nov 23 15:10:36 hitdev-rhel67 multipathd: mpathal: remaining active paths: 0 3. Monitor udev events every 5 seconds. # udevadm monitor monitor will print the received events for: UDEV - the event which udev sends out after rule processing KERNEL - the kernel uevent KERNEL[1448320131.061837] change /devices/virtual/block/dm-2 (block) KERNEL[1448320131.064802] change /devices/virtual/block/dm-2 (block) UDEV [1448320131.082838] change /devices/virtual/block/dm-2 (block) UDEV [1448320131.102134] change /devices/virtual/block/dm-2 (block) KERNEL[1448320135.551737] change /devices/virtual/block/dm-2 (block) KERNEL[1448320135.552701] change /devices/virtual/block/dm-2 (block) UDEV [1448320135.571634] change /devices/virtual/block/dm-2 (block) UDEV [1448320135.591017] change /devices/virtual/block/dm-2 (block) KERNEL[1448320136.553368] change /devices/virtual/block/dm-2 (block) KERNEL[1448320136.554298] change /devices/virtual/block/dm-2 (block) 13,0-1 Top Signed-off-by: ShivaKrishna Merla --- libmultipath/propsel.c | 2 +- libmultipath/structs.h | 1 + multipathd/main.c | 19 ++++++++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) -- -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c index f64d5e4..b9e389f 100644 --- a/libmultipath/propsel.c +++ b/libmultipath/propsel.c @@ -374,7 +374,7 @@ detect_prio(struct path * pp) int ret; struct prio *p = &pp->prio; - if (get_target_port_group_support(pp->fd) <= 0) + if ((pp->tpgs = get_target_port_group_support(pp->fd)) <= 0) return; ret = get_target_port_group(pp->fd); if (ret < 0) diff --git a/libmultipath/structs.h b/libmultipath/structs.h index 5f68a8e..ef5fb7e 100644 --- a/libmultipath/structs.h +++ b/libmultipath/structs.h @@ -193,6 +193,7 @@ struct path { int detect_prio; int watch_checks; int wait_checks; + int tpgs; char * uid_attribute; char * getuid; struct prio prio; diff --git a/multipathd/main.c b/multipathd/main.c index 04f6d02..b6b0053 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -62,6 +62,7 @@ static int use_watchdog; #include #include #include +#include "prioritizers/alua_rtpg.h" #include "main.h" #include "pidfile.h" @@ -1161,6 +1162,7 @@ check_path (struct vectors * vecs, struct path * pp) int new_path_up = 0; int chkr_new_path_up = 0; int add_active; + int ignore_reinstate = 0; int oldchkrstate = pp->chkrstate; if (pp->initialized && !pp->mpp) @@ -1235,6 +1237,16 @@ check_path (struct vectors * vecs, struct path * pp) pp->wait_checks = 0; } + /* + * don't reinstate failed path, if its in stand-by + * and if target supports only implicit tpgs mode. + * this will prevent unnecessary i/o by dm on stand-by + * paths if there are no other active paths in map. + */ + ignore_reinstate = (newstate == PATH_GHOST && + pp->mpp->nr_active == 0 && + pp->tpgs == TPGS_IMPLICIT) ? 1 : 0; + pp->chkrstate = newstate; if (newstate != pp->state) { int oldstate = pp->state; @@ -1297,7 +1309,7 @@ check_path (struct vectors * vecs, struct path * pp) pp->watch_checks--; add_active = 0; } - if (reinstate_path(pp, add_active)) { + if (!ignore_reinstate && reinstate_path(pp, add_active)) { condlog(3, "%s: reload map", pp->dev); ev_add_path(pp, vecs); pp->tick = 1; @@ -1316,8 +1328,9 @@ check_path (struct vectors * vecs, struct path * pp) enable_group(pp); } else if (newstate == PATH_UP || newstate == PATH_GHOST) { - if (pp->dmstate == PSTATE_FAILED || - pp->dmstate == PSTATE_UNDEF) { + if ((pp->dmstate == PSTATE_FAILED || + pp->dmstate == PSTATE_UNDEF) && + !ignore_reinstate) { /* Clear IO errors */ if (reinstate_path(pp, 0)) { condlog(3, "%s: reload map", pp->dev);