From patchwork Fri May 15 01:59:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 11550345 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 B8BF2138A for ; Fri, 15 May 2020 01:59:39 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78ECA20643 for ; Fri, 15 May 2020 01:59:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VZWg5j2P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78ECA20643 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=1589507978; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=e31mevXRrEbMRO1MBd4frqH99+/k/lC16YBR0vswdh4=; b=VZWg5j2P49T4Q/jJByUrpOzFZL+gFohL8HtFfUe0H1HJC4ekx7uxKReMM7LUHhu6A5vzuC IkifhVBdxROcYrowOh8P7OzW0R3kP9OKaLj5NpOoakKuVhMwSQa+Hyjxu4wesrG1s6WD5a BZvYC2/4463ebE52Cp1pWRtgGDO+Z5o= 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-450-kSvUUMELMZq6GdbP6JputQ-1; Thu, 14 May 2020 21:59:34 -0400 X-MC-Unique: kSvUUMELMZq6GdbP6JputQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BFB0380B713; Fri, 15 May 2020 01:59:29 +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 1BE755D9D7; Fri, 15 May 2020 01:59:29 +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 5FAC64E9B4; Fri, 15 May 2020 01:59:28 +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 04F1xRWn003785 for ; Thu, 14 May 2020 21:59:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2834460F8D; Fri, 15 May 2020 01:59:27 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from octiron.msp.redhat.com (octiron.msp.redhat.com [10.15.80.209]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6D67B60C47; Fri, 15 May 2020 01:59:24 +0000 (UTC) Received: from octiron.msp.redhat.com (localhost.localdomain [127.0.0.1]) by octiron.msp.redhat.com (8.14.9/8.14.9) with ESMTP id 04F1xMiP006933; Thu, 14 May 2020 20:59:23 -0500 Received: (from bmarzins@localhost) by octiron.msp.redhat.com (8.14.9/8.14.9/Submit) id 04F1xMg6006932; Thu, 14 May 2020 20:59:22 -0500 From: Benjamin Marzinski To: Christophe Varoqui Date: Thu, 14 May 2020 20:59:16 -0500 Message-Id: <1589507962-6895-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: dm-devel@redhat.com Cc: device-mapper development , Martin Wilck Subject: [dm-devel] [PATCH 0/6] multipath: path validation library prep work 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: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com I've been playing around with the SID code more and I've decided to hold off on submitting the library until I have it working with the SID multipath module better. Instead, I've pulled out the common code that multipath -u/-c and the library can use, and put it into libmultipath. I've also removed some of the ordering differences between the existing code and my new code. Right now, the only difference is that if a path is currently multipathed, it will always be claimed as a valid path. Patches 0001 & 0002 are the same as in my "RFC PATCH v2" set, and patch 0005 is the same as my "libmultipath: simplify failed wwid code" patch. Only patches 0003 and 0004 haven't been posted before. Benjamin Marzinski (5): libmultipath: make libmp_dm_init optional libmultipath: make sysfs_is_multipathed able to return wwid multipath: centralize validation code Unit tests for is_path_valid() libmultipath: simplify failed wwid code Martin Wilck (1): libmultipath: use atomic linkat() in mark_failed_wwid() libmultipath/Makefile | 2 +- libmultipath/devmapper.c | 66 +++++- libmultipath/devmapper.h | 4 +- libmultipath/structs.h | 24 +-- libmultipath/sysfs.c | 24 ++- libmultipath/sysfs.h | 2 +- libmultipath/valid.c | 118 +++++++++++ libmultipath/valid.h | 32 +++ libmultipath/wwids.c | 165 ++++++++------- multipath/main.c | 295 ++++++++++++--------------- tests/Makefile | 4 +- tests/valid.c | 424 +++++++++++++++++++++++++++++++++++++++ 12 files changed, 875 insertions(+), 285 deletions(-) create mode 100644 libmultipath/valid.c create mode 100644 libmultipath/valid.h create mode 100644 tests/valid.c