From patchwork Sat Feb 27 20:44:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiva Krishna X-Patchwork-Id: 8445071 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 CA1159F52D for ; Sat, 27 Feb 2016 20:48:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 83568203AD for ; Sat, 27 Feb 2016 20:48:19 +0000 (UTC) Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4094220384 for ; Sat, 27 Feb 2016 20:48:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u1RKiX6Z013569; Sat, 27 Feb 2016 15:44:34 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u1RKiVos028079 for ; Sat, 27 Feb 2016 15:44:31 -0500 Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1RKiVF7006543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 27 Feb 2016 15:44:31 -0500 Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0089.outbound.protection.outlook.com [157.56.111.89]) by mx1.redhat.com (Postfix) with ESMTPS id 350423B75A; Sat, 27 Feb 2016 20:44:28 +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=NqnVqYX96CFOogfyliTCMpWWKiza1NNFmZebkMUYUu8=; b=O4LKUQne35jo1jBLBsktK+8Dl3j5hTkd1/66CrqWYtfn5Z1qmx8+GMCenRp7cNrtpECX6yxcv3XxKkKLsAPx512GLtwpSxSHshRQgoH1vTZwXXcoGt35iYuAfPRZxCuDq+k3S5hTKqGJQJdhjnKCgJZCTNXhiXRVk7wHpuqR9F4= Received: from BY2PR02CA0107.namprd02.prod.outlook.com (10.163.44.161) by BLUPR02MB1219.namprd02.prod.outlook.com (10.163.80.149) with Microsoft SMTP Server (TLS) id 15.1.409.15; Sat, 27 Feb 2016 20:44:27 +0000 Received: from BN1BFFO11FD026.protection.gbl (2a01:111:f400:7c10::1:124) by BY2PR02CA0107.outlook.office365.com (2a01:111:e400:5261::33) with Microsoft SMTP Server (TLS) id 15.1.415.20 via Frontend Transport; Sat, 27 Feb 2016 20:44:27 +0000 Authentication-Results: spf=pass (sender IP is 198.54.169.104) smtp.mailfrom=nimblestorage.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.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 BN1BFFO11FD026.mail.protection.outlook.com (10.58.144.89) with Microsoft SMTP Server (TLS) id 15.1.422.5 via Frontend Transport; Sat, 27 Feb 2016 20:44:24 +0000 Received: from SJC-MBX-03.nimblestorage.com ([fe80::84bf:bbc4:41c5:ecad]) by cashub01.nimblestorage.com ([::1]) with mapi id 14.03.0235.001; Sat, 27 Feb 2016 12:44:23 -0800 From: Shiva Krishna To: "dm-devel@redhat.com" Thread-Topic: [PATCH v3]multipath-tools: prevent unnecessary reinstate of stand-by paths with implicit tags mode and no active array paths Thread-Index: AQHRcZ+jy5cASiWIAUSd5n0LasgUXg== Date: Sat, 27 Feb 2016 20:44:22 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [50.143.152.202] Content-ID: 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)(189002)(199003)(23726003)(104016004)(189998001)(106116001)(229853001)(2351001)(106466001)(2501003)(92566002)(53416004)(6806005)(50466002)(6116002)(102836003)(3846002)(36756003)(19580395003)(586003)(4326007)(47776003)(86362001)(5008740100001)(5004730100002)(97756001)(66066001)(1096002)(19580405001)(2906002)(50986999)(54356999)(5003600100002)(5250100002)(11100500001)(110136002)(2900100001)(1220700001)(46406003)(87936001)(5001960100002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR02MB1219; H:mail.nimblestorage.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD026; 1:NaK41V5ZBTjAlFFzde7707SoxqTIVr4Yi9y5ljml053wYihbUfWR3F5nmaHZiKXEJbsbp6mEuLFLDkVko0fPDvbIGIppNjWlZ6El/pFWnduwp5nrDiMUDWzVIxnImoZPacDAEyuQ8e+cW3XmVqOvHUcIhwR9aY9cGUlFPdSeseUZXXjKgnndqu6bLqvR7OdFfWbYTOP5hSj03Qn/aFbJohh4gzx0NdtYytHQBPCL56tgSSvUFcQOvjXoJIhXgqMtRBVN7FCiMetEHH1tiyCI9M67uhui+GsQG3D4W3mB7y39+Ln11W7csHrwztgAQAzz06y2I43HcnmQi0ijeyBS4R91n+XXFw2z+GDqHuEdKB/0/VK8u+yG1pcKiw144/xI X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1219; 2:BYWY+EBlgXe7aJjMd7llGI7bH68bfDXw90FRaujij8wgzncZrD07VLAl/e++sbQOiNEH9mhapvUJ1El53TqVxV5s11qWF4Burqx/bsMK1PzQeSfB/gm3OmIxme/x7JXLI85MycDT79QI4JoLRD4+qQ==; 3:+m4xfj9sHgWczd90yzbguUgqvg/rm9L09/QdNlx07uXdAtXmUoVaol7APWAP44D3EeBkNuhsnY6lD0qWEZc/wUj6hXZcFGIiN3LVMi9ajS433o+vBBVKfAdLda8jbNPFHUnB6T+tt12NlIFFCrUvh35GCC6pvv7AlHPp6OumLVda4F8drXto/f//wBk9cXIl3bIEkEA2u+wg8tuToc6D4Q==; 25:ZalJ9BRXNL2Mc4Uj06zbq1RFbetWTPOzCOkCZVuLLgkL3xMKJJxXkC6QFjvjS8LBDHxgWI9AuqpELTG2fjM6xk/YjIFwDsBwaX9pKxDbHQGDNDmSbuCvGo4ITaKmloWOCjVoAvJj7wMyKVcxohUoguTsFSZO3lHDtEWyW+hBGQiR7lr1lRaQx3ODjLHlWlz9STmnjEUifDkg8F6YcO3+Fne2NeN2LrMV+BtxeiFpQNiNgphxkBDIPbnt/l9xJHcCzRLtzd45BEyvAF82YCaBECbS+hUReiwUFs3IO/nV5fOnNZEmtO9kc+XKxWk8cRy74GfRTaKCSVnpDr7pVW2OYlsBmgegY2jkndWW3MTkiYXS8v7Az+r4WtaedF3rzYs42nT+cO0RTPR9yASglWN/oQ== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:BLUPR02MB1219; X-MS-Office365-Filtering-Correlation-Id: fea0159f-2b25-4a72-9ba5-08d33fb6c78b X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1219; 20:srJcbzuyDLe38GjYxMH6Lx+SH1CpIugv/I5XRzfiw/6AvbgnKPNDIcHElUvs/5MHftD57wnMsEFcktKxWjOjss+i32Plhz/J0GYAz6bgoPuIGEQ9pcLxDUxqTSnwTui4bwKIRoqp5ZPJsKwAkts6vWGXeTnNP6dNdweYyPc7+vW5rCXqC62yt98nJ6tgOO/rdehMUCMPjz7dMeskV6kYoZJBhi/YVyTY6/YZwWaKkETGII9MSym31x5f3x/Z1vrB0uq1ZBqfO3sMNJ9mcnvskR4B4VnVOxCjR+/WYQnZvw2Z/oo+gCCAgaPhIhx0QONsPE1aYOBKB8/hobbN65KsUIBe3pT9meCKZ+UpU6WMtg17RZ0+IQpnIyfVZ6BdriqHQV+mDANPgfm5oFzIBiV2keD0T22TzbHrmNvQsAb7SwefsAU9X/pWIl103Cd+4JBwkQo9QHNNyD7o7Ahyh++zs5Cfef+O2UqWaceFyoDR3MEYjdNWOnFKrDrNcn4AlgHvBtcxhFmcVf7nLzdqd/II5JK6uwu8nUL53LqEoSYoU6x4V0sX+kBkHqV+n1KcWZPheAmZEAGgs1MmSLbnDLJx+v2bQCCSDlCwh174/uV9n2c= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(13023025)(13013025)(13021025)(3002001)(10201501046); SRVR:BLUPR02MB1219; BCL:0; PCL:0; RULEID:; SRVR:BLUPR02MB1219; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1219; 4:8oumGGeSYS01RD3nyoLKv/9jz8WO5Zv4DAxSrCBa2gruz7M9VE8yUJMCpaXP9xWnZDrLIIc0of1Exi2h42StHIb7OKL6vVDTlpvHcaPRLSg96L03f0lEZhApbRO83xZsWnC2crgepJRpYSem9/MKB+fvsWQzDKndqu+gg8p0tcwQ4xBcJ+UilIkVV1Iraf5d9azeY5Nlw21iPkrlQXUxojx3WLfCeasZn7Hv4ak33R6op2pJWsSnpwWCZrpKoYcyp2pnYKdyMXrU3UdThK5Gd4Yco/QcsuCKlP7QeFggTEj8EJcrhs52JU0LxfU/p3psUr7jpUPFqV+R2DeWdj5Si/SDf7rKflrgtFN9E/WJJwMsE+W/bG5hHg9rVm0F0G7EZuAsVqy+QpR7w2s34ETO8yHV+bAUrm6BR6etxkSbiT4= X-Forefront-PRVS: 086597191B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR02MB1219; 23:HyCFWi7Gb+BhtzuIyIA9g1IgS+WtGICrl+Yd2Mc0r?= =?us-ascii?Q?7WtKWCs0ZDieZ+rOZWXPTkIspT3UzZondFHMHJEy/R4Hf+15ATmRvNcd/Pbp?= =?us-ascii?Q?svev5FSvparxjSuR+WsQCtgS7teVMjH1HBVXZlQ3KSIoNVV6AmLpOtOlKLu0?= =?us-ascii?Q?fOpM/8U+Ele5IHqrDT4hX2SGDChtOgqtVb322U4I1JM37AcjGgeU9XuB1ROB?= =?us-ascii?Q?y43amRXI1RqP44y6NNC8lL8fylYupH6roNBhBKKJeyVlBzbMk8cwedrzfqqM?= =?us-ascii?Q?IqbPXPrXMOFY93ISG8IKyetLS8P/qm0mqjgl9wq6XN0EfSnrFmxRsZIxpfG6?= =?us-ascii?Q?D6tRhIfIGzbHJEPw7nqMnvI7m+sb9ZIKiDmHTs1xvUKq7FVl+VHYI1+oz8P/?= =?us-ascii?Q?tRHZZiddObB6KBayCOT504QjtOda2LH5wkaPM2Ujp7RR8z0bPjqXLlbmIp9Z?= =?us-ascii?Q?zdCABkZ1HNJjvm4yeouQh2eFCtTK+YasL4ws223kQPvLkFtY7gUUZZQUkfmW?= =?us-ascii?Q?dmSbfG5wpl2q9pOd+vuqjJr7C8LlkN4ElPnwVAjgInqUi3u3YU+KUctrSjTx?= =?us-ascii?Q?mNsqDmqbPvyA1faOb5ksJBDUkLdAUo57VV6LicFq7D/Mj2qzqEmKvLKa+dS3?= =?us-ascii?Q?uX2Niw4iUVNSEq0gk7Y2W1LiJRPo7aIfJ0+wkETyyKdFc/ZTqda1FDFiIbIC?= =?us-ascii?Q?BgQH5pTjxzqA1Vrnq2rHKEG+zB7exS7WTeQ2hVh9wQV5UPXv9Fugp7H6HTix?= =?us-ascii?Q?7YkkUPVHDFcaYefCmnE4ye0oZKQrydLT9W/naZfC8FAnG8Sg95vAiTTGlAT7?= =?us-ascii?Q?6x51gIYiMDuhg6oBo1dzaVKqB2YxLPUbZ9YOBxYS4VCn/ZIsUuY0/K2G5Yih?= =?us-ascii?Q?lqC7q+CRuS9t3anPX7GcLtRUJeGDo84mZudwL84xTA+Np/AFaVMYNVmm0lmB?= =?us-ascii?Q?h0M5tII21pQS4G1UVrPOp7z9xJ4nbDTEAN4UW4S4CrVc/lwyupEf09F7nSQ7?= =?us-ascii?Q?kKVKMfykGteZN4gdTUp4Tgdc9ls1ksKcChvi+64keOQpWiHivgopC+agKBS7?= =?us-ascii?Q?5TMKb3NYvwDML6F5c1vho/ySIWB2PAQkdfIBx2wKnG0gu0uxBxIosgymFMwD?= =?us-ascii?Q?wnJ34wGtjBUrfqSMjb+mMR4z3eAgmNz?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1219; 5:15IaDui3AFht0ldrpFA5V0g2kehCoRtixy8di874li/bWeMXD76pCLYYaqYa9/s7CN2YymjQxpiNM4nym9UEeFWqQtPE2867qEFcvT48/mhxkEzmJaP1P2tujp7aFfl7rPCJgfLsLj6z8br1sU6bhg==; 24:HiM7NeHZw4AcKVE0aNFAzFsuZcb+2U3yy/EAoEK+5c0flP3DOUajMg+VwPZwd0ILXTXgTKL3Fittkv+IDy9hzNPapOLYSSWRVR/+W5EuAQc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nimblestorage.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2016 20:44:24.9572 (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: BLUPR02MB1219 X-RedHat-Spam-Score: 0.387 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS) 157.56.111.89 mail-bn1bon0089.outbound.protection.outlook.com 157.56.111.89 mail-bn1bon0089.outbound.protection.outlook.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id u1RKiVos028079 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH v3]multipath-tools: prevent unnecessary reinstate of stand-by paths with implicit tags 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=-6.8 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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, for targets supporting only alua and implicit tpgs mode, stand-by paths are not reinstated by path checker unless there is an active path in the map. 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 prio alua 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: 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) UDEV [1448320136.572733] change /devices/virtual/block/dm-2 (block) UDEV [1448320136.592089] change /devices/virtual/block/dm-2 (block) KERNEL[1448320140.555389] change /devices/virtual/block/dm-2 (block) KERNEL[1448320140.556369] change /devices/virtual/block/dm-2 (block) UDEV [1448320140.574944] change /devices/virtual/block/dm-2 (block) UDEV [1448320140.594076] change /devices/virtual/block/dm-2 (block) Signed-off-by: ShivaKrishna Merla --- libmultipath/propsel.c | 13 ++++++++++++- libmultipath/structs.h | 1 + multipathd/main.c | 19 ++++++++++++++++--- 3 files changed, 29 insertions(+), 4 deletions(-) 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); -- -- 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..890d4b1 100644 --- a/libmultipath/propsel.c +++ b/libmultipath/propsel.c @@ -373,9 +373,11 @@ detect_prio(struct path * pp) { int ret; struct prio *p = &pp->prio; + int tpgs = 0; - if (get_target_port_group_support(pp->fd) <= 0) + if ((tpgs = get_target_port_group_support(pp->fd)) <= 0) return; + pp->tpgs = tpgs; ret = get_target_port_group(pp->fd); if (ret < 0) return; @@ -415,6 +417,15 @@ select_prio (struct path * pp) prio_get(p, DEFAULT_PRIO, DEFAULT_PRIO_ARGS); origin = "(internal default)"; out: + /* + * fetch tpgs mode for alua, if its not already obtained + */ + if (!strncmp(prio_name(p), PRIO_ALUA, PRIO_NAME_LEN)) { + int tpgs = 0; + if(!pp->tpgs && + (tpgs = get_target_port_group_support(pp->fd)) >= 0) + pp->tpgs = tpgs; + } condlog(3, "%s: prio = %s %s", pp->dev, prio_name(p), origin); condlog(3, "%s: prio args = \"%s\" %s", pp->dev, prio_args(p), origin); return 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)