From patchwork Sat Oct 12 21:27:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11186985 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 4336C14ED for ; Sat, 12 Oct 2019 21:28:25 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0518F206A1 for ; Sat, 12 Oct 2019 21:28:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0518F206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF65410DCC8B; Sat, 12 Oct 2019 21:28:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4CD766017E; Sat, 12 Oct 2019 21:28:22 +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 50B211803517; Sat, 12 Oct 2019 21:28:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSIaK005916 for ; Sat, 12 Oct 2019 17:28:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 151A4608C2; Sat, 12 Oct 2019 21:28:18 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx25.extmail.prod.ext.phx2.redhat.com [10.5.110.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B4D78608A5; Sat, 12 Oct 2019 21:28:15 +0000 (UTC) Received: from m4a0041g.houston.softwaregrp.com (m4a0041g.houston.softwaregrp.com [15.124.2.87]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AD1A710C0938; Sat, 12 Oct 2019 21:28:12 +0000 (UTC) Received: FROM m4a0041g.houston.softwaregrp.com (15.120.17.147) BY m4a0041g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:19 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:39 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.13) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NHMsZFB6hh8oqT0nw5OfqFytoHW79F0OfccaDiBzUk166o+5wPbhZo7H7hZwikwuN7LlT+243aPeYXNDT6XMXYEZ8gkYTH2T0i6tNiw9p4pcZMKs/OR9VQctteMhP748dRHL4qEHiLCZU0e6E7DeUbGUe1Npi1ompDxB8yOldM6HcNlkLFXVvu81VEWOM+AOzkR7om5kOpvfsgWpEq5R7OJ5FgU1WnRi/0Qmp9VsAebgcO47pNDu2143it6Op1eCCo7jpsGibA8nuqYcucsQebjXQj0mrzDPaC2Qzf//CaIHFV2kPlDsuYgTK+6oDYdADq7qsZ5FxHQks4jekX3zLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QJn0BgBtYFESXnRpkLJE9gk4VTI/OIMf1y+yuDT6Dq4=; b=NKYy+N4qOH9GSA4TUvUcGJIpdSJ6R/xwZXMZ7+CFD19TPZHdbY+fqGvI3YsGhvKWWZ2TMvE6quEC7XF9Kkc+/7aZzXfyHB0jRqlxdWDASvQ42E6Eo1uRfCnNxEBeglZKS8mISgYCmUY4lqmJ3PRAa/BR7dbxS/Un14YlCFHFJK8UjZrFR3GboyUL/IkKNWMu+V0QwckQ7NQOaIr8bvMqwSUD9PfUwiWYNdYitku3EMPPuYzss9LzhX2myve+C7V/MT5IKddERw8W+AYPIs3pziStEZLAHGQZxLoj13phqarPX7JQQcmf+B2F1nbeDm2ajBiCm9lzF4JjV0lcX3U5HQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:38 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:38 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 01/72] multipath tests: move condlog test wrappers to separate file Thread-Index: AQHVgUPfUtltUC2VTUmF8/qMckPiLg== Date: Sat, 12 Oct 2019 21:27:38 +0000 Message-ID: <20191012212703.12989-2-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d3f48095-5413-4da9-d2fb-08d74f5b016a x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1201; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DT78T7AuT2tRFbQ12OxjMxtkg3envEaIvBuEFsHWy+iLPPP7pq78wnIqukZCaal5pTwg35Skh2yD0/vF1JC/XkTbdMHiIES21jMQFUvB7FjWrCm62sYiLe/ciGtsqpOjHCNI20dMzx9aIP2R/yjaxvPXXR1eJ2jbWKZKzqcXiN8fIUInFC3QISIBUlHACauBF4OMzAVDBtHPMiN4MwJ0b6NZgCslh4hp8l4Pk1+M2DL0s19Cx8C2c5o2Eb1VnfY5AWX5rOH/wfFDIymEjpnSyngQdKBmHh0LxlT1sul8xX8Cl2ILpr4/7igieuGhHUqsENOdWwC82FGj4hiWRVuEz5Pt1rgRzfPIgvwRzXs4FHaLvMuSTJyHQUrL7wpcZVuIEyMLaLt/DOSQVchn0c6Ogq2KwfklmCKsyiC86PThsxY= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d3f48095-5413-4da9-d2fb-08d74f5b016a X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:38.3159 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: eeL4LVf9C6722TfRVxuwcwSWqpCBdtJlYoZrWBKLeo2T85P8ms4DbZnGyUvo+V+i8i4Wl7l+TH8k/XrrmTqguA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Sat, 12 Oct 2019 21:28:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Sat, 12 Oct 2019 21:28:14 +0000 (UTC) for IP:'15.124.2.87' DOMAIN:'m4a0041g.houston.softwaregrp.com' HELO:'m4a0041g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.87 m4a0041g.houston.softwaregrp.com 15.124.2.87 m4a0041g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.66 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSIaK005916 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 01/72] multipath tests: move condlog test wrappers to separate file 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Sat, 12 Oct 2019 21:28:24 +0000 (UTC) From: Martin Wilck These helpers can be useful in other tests. Signed-off-by: Martin Wilck --- tests/Makefile | 1 + tests/blacklist.c | 20 +------------------- tests/test-log.c | 26 ++++++++++++++++++++++++++ tests/test-log.h | 7 +++++++ 4 files changed, 35 insertions(+), 19 deletions(-) create mode 100644 tests/test-log.c create mode 100644 tests/test-log.h diff --git a/tests/Makefile b/tests/Makefile index a5cdf390..fb3c067b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -23,6 +23,7 @@ hwtable-test_TESTDEPS := test-lib.o hwtable-test_OBJDEPS := ../libmultipath/discovery.o ../libmultipath/blacklist.o \ ../libmultipath/prio.o ../libmultipath/callout.o ../libmultipath/structs.o hwtable-test_LIBDEPS := -ludev -lpthread -ldl +blacklist-test_TESTDEPS := test-log.o blacklist-test_OBJDEPS := ../libmultipath/blacklist.o blacklist-test_LIBDEPS := -ludev vpd-test_OBJDEPS := ../libmultipath/discovery.o diff --git a/tests/blacklist.c b/tests/blacklist.c index 362c44d9..733ee398 100644 --- a/tests/blacklist.c +++ b/tests/blacklist.c @@ -21,7 +21,7 @@ #include #include "globals.c" #include "blacklist.h" -#include "log.h" +#include "test-log.h" struct udev_device { const char *sysname; @@ -62,24 +62,6 @@ __wrap_udev_list_entry_get_name(struct udev_list_entry *list_entry) return *(const char **)list_entry; } -void __wrap_dlog (int sink, int prio, const char * fmt, ...) -{ - char buff[MAX_MSG_SIZE]; - va_list ap; - - assert_int_equal(prio, mock_type(int)); - va_start(ap, fmt); - vsnprintf(buff, MAX_MSG_SIZE, fmt, ap); - va_end(ap); - assert_string_equal(buff, mock_ptr_type(char *)); -} - -void expect_condlog(int prio, char *string) -{ - will_return(__wrap_dlog, prio); - will_return(__wrap_dlog, string); -} - vector blist_devnode_sdb; vector blist_all; vector blist_device_foo_bar; diff --git a/tests/test-log.c b/tests/test-log.c new file mode 100644 index 00000000..76a266eb --- /dev/null +++ b/tests/test-log.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include +#include "log.h" +#include "test-log.h" + +void __wrap_dlog (int sink, int prio, const char * fmt, ...) +{ + char buff[MAX_MSG_SIZE]; + va_list ap; + + assert_int_equal(prio, mock_type(int)); + va_start(ap, fmt); + vsnprintf(buff, MAX_MSG_SIZE, fmt, ap); + va_end(ap); + assert_string_equal(buff, mock_ptr_type(char *)); +} + +void expect_condlog(int prio, char *string) +{ + will_return(__wrap_dlog, prio); + will_return(__wrap_dlog, string); +} + diff --git a/tests/test-log.h b/tests/test-log.h new file mode 100644 index 00000000..2c878c63 --- /dev/null +++ b/tests/test-log.h @@ -0,0 +1,7 @@ +#ifndef _TEST_LOG_H +#define _TEST_LOG_H + +void __wrap_dlog (int sink, int prio, const char * fmt, ...); +void expect_condlog(int prio, char *string); + +#endif From patchwork Sat Oct 12 21:27:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187003 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 076B576 for ; Sat, 12 Oct 2019 21:29:42 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D7FB32089C for ; Sat, 12 Oct 2019 21:29:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7FB32089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E8F7E316E531; Sat, 12 Oct 2019 21:29:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C78D719C70; Sat, 12 Oct 2019 21:29:40 +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 8D2F1180B761; Sat, 12 Oct 2019 21:29:40 +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 x9CLSO7G005976 for ; Sat, 12 Oct 2019 17:28:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 076F760BFB; Sat, 12 Oct 2019 21:28:24 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7D00E60BF1; Sat, 12 Oct 2019 21:28:21 +0000 (UTC) Received: from m4a0041g.houston.softwaregrp.com (m4a0041g.houston.softwaregrp.com [15.124.2.87]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F03A308FBFC; Sat, 12 Oct 2019 21:28:19 +0000 (UTC) Received: FROM m4a0041g.houston.softwaregrp.com (15.120.17.147) BY m4a0041g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:25 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:42 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OGNFCdlpfEUbkce15MpTPdPpM+4nYGrsaSWOWR5bBgtaL+s4c1ps8T522u3zWniIA4/l19OcPpnHLnddcd1c7i3t7xtFr9qj4g8cH0s0ap3HdFetvM6G1NZQ0xx4WKS028UzVpJvygdpJYNoPHB02O5eqcq+QuiSjF2JUwSUoSsUeDsmZtCvyL+TYU19Xa4VcUFwh9ya8e1nZOXlXzhrX3ZKxrpoO78Sx7zTR8c4KkbgD4dp9Y85hX8S3itYgIEGFcDW24lV8aqNmWbY0YhGtvCowGSEzNJPhNNlf/I6gcH/xldztz0uFYNz4GCa5rd3CXORAk2iYxBbDDeu70fCfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qafaSLgsPCxljsG2NKBH0DC3luTiWJ/cTGvZZc8LlX8=; b=cQ6KDzei9IJ84py+79Y1AWMhcZZMgjm/WtoxMc0YRPHgTpkoq+ME1vIS8YkmpB11vF8qaCQbzQ2JUNeoTJK7qEZYsqIFifcekgK8P+ex7dBFnUc+FtT+iFTuiCIMYn8tXKeENEvTHQ93QyrKKY89Rjnxs0xkqnO+virWuKh2ImQMb582OUan/PAsCWlhebZ+nT6JovJPz3bx4VJmGAQYKCX9mnViqKRr3fSQopkXtLzfWHSWN4BNsW9Y1wmp94sInpxxHBtXWdbzSiEShTAGo/WBF4TpeGifeWkHECb+2eg0zyXr2thSQAJEKcSZpxff5KOmDWz5MJICTmcttznWgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:39 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:39 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 02/72] multipath tests: add tests for alias handling Thread-Index: AQHVgUPf7mUCAzaiq0KcU90TSmh1vA== Date: Sat, 12 Oct 2019 21:27:39 +0000 Message-ID: <20191012212703.12989-3-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7f4bcba8-41bb-4d6a-731f-08d74f5b0232 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:913; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(30864003)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4IcDOlIF/lG5BMp8JcMdlmm7dzak4ov89fW3JAgfn7ShPucfaGvzUpWDFiFvW72Skcch9jOIdaBShhWQvHfs0qn5iuOQU2U57EYdyIVS17Td5Nl8X9yDsfLqWQ73mn9aJyNFOXwHTchuPjJgqtWMtogn8AncE+AClxGs7y4dtKuKdlAivxOUDAsUxgvsDhS2Y5j3yHt4URUF8U3+t8wHKG3FuEcdKnivvT3b7SH/IuGo/LXNs8TcoD5b70RE7+S4n+U6U0czW9RWckuYIuRFG2sRDWkd9Jv1Gf+UNYtB0VsSm27e6fHzpKEKCvyUHtrt0fyCpqHce34ykLm+3NFnHbBgVJ039JTXQU2VUSMIVnebcMYicx6TXnzsr4HdXS20CvQ4XPVPQ/mINX+p8ShVPLmcCBKfmmLwEAghNmWeSuE= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 7f4bcba8-41bb-4d6a-731f-08d74f5b0232 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:39.5582 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 3J3g0JQgzbRe2+8MDc3Grz5XlCCNbqOHcM2HGErnDQHN3c9FRzX8XLJvSDqQa4HqQHnM9liST0SiwFDV62l+LQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sat, 12 Oct 2019 21:28:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sat, 12 Oct 2019 21:28:20 +0000 (UTC) for IP:'15.124.2.87' DOMAIN:'m4a0041g.houston.softwaregrp.com' HELO:'m4a0041g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.87 m4a0041g.houston.softwaregrp.com 15.124.2.87 m4a0041g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSO7G005976 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 02/72] multipath tests: add tests for alias handling 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 12 Oct 2019 21:29:41 +0000 (UTC) From: Martin Wilck Some of these tests fail with the current code base. Signed-off-by: Martin Wilck --- tests/Makefile | 3 +- tests/alias.c | 590 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 592 insertions(+), 1 deletion(-) create mode 100644 tests/alias.c diff --git a/tests/Makefile b/tests/Makefile index fb3c067b..0ce318c6 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -3,7 +3,7 @@ include ../Makefile.inc CFLAGS += $(BIN_CFLAGS) -I$(multipathdir) -I$(mpathcmddir) LIBDEPS += -L$(multipathdir) -lmultipath -lcmocka -TESTS := uevent parser util dmevents hwtable blacklist unaligned vpd pgpolicy +TESTS := uevent parser util dmevents hwtable blacklist unaligned vpd pgpolicy alias .SILENT: $(TESTS:%=%.o) .PRECIOUS: $(TESTS:%=%-test) @@ -28,6 +28,7 @@ blacklist-test_OBJDEPS := ../libmultipath/blacklist.o blacklist-test_LIBDEPS := -ludev vpd-test_OBJDEPS := ../libmultipath/discovery.o vpd-test_LIBDEPS := -ludev -lpthread -ldl +alias-test_TESTDEPS := test-log.o lib/libchecktur.so: mkdir lib diff --git a/tests/alias.c b/tests/alias.c new file mode 100644 index 00000000..32fdc697 --- /dev/null +++ b/tests/alias.c @@ -0,0 +1,590 @@ +#include +#include +#include +#include +#include "util.h" +#include "alias.h" +#include "test-log.h" + +#include "globals.c" +#include "../libmultipath/alias.c" + +#if INT_MAX == 0x7fffffff +/* user_friendly_name for map #INT_MAX */ +#define MPATH_ID_INT_MAX "fxshrxw" +/* ... and one less */ +#define MPATH_ID_INT_MAX_m1 "fxshrxv" +/* ... and one more */ +#define MPATH_ID_INT_MAX_p1 "fxshrxx" +#endif + +void __wrap_rewind(FILE *stream) +{} + +char *__wrap_fgets(char *buf, int n, FILE *stream) +{ + char *val = mock_ptr_type(char *); + if (!val) + return NULL; + strlcpy(buf, val, n); + return buf; +} + +static void fd_mpatha(void **state) +{ + char buf[32]; + int rc; + + rc = format_devname(buf, 1, sizeof(buf), "FOO"); + assert_int_equal(rc, 4); + assert_string_equal(buf, "FOOa"); +} + +static void fd_mpathz(void **state) +{ + /* This also tests a "short" buffer, see fd_mpath_short1 */ + char buf[5]; + int rc; + + rc = format_devname(buf, 26, sizeof(buf), "FOO"); + assert_int_equal(rc, 4); + assert_string_equal(buf, "FOOz"); +} + +static void fd_mpathaa(void **state) +{ + char buf[32]; + int rc; + + rc = format_devname(buf, 26 + 1, sizeof(buf), "FOO"); + assert_int_equal(rc, 5); + assert_string_equal(buf, "FOOaa"); +} + +static void fd_mpathzz(void **state) +{ + char buf[32]; + int rc; + + rc = format_devname(buf, 26*26 + 26, sizeof(buf), "FOO"); + assert_int_equal(rc, 5); + assert_string_equal(buf, "FOOzz"); +} + +static void fd_mpathaaa(void **state) +{ + char buf[32]; + int rc; + + rc = format_devname(buf, 26*26 + 27, sizeof(buf), "FOO"); + assert_int_equal(rc, 6); + assert_string_equal(buf, "FOOaaa"); +} + +static void fd_mpathzzz(void **state) +{ + char buf[32]; + int rc; + + rc = format_devname(buf, 26*26*26 + 26*26 + 26, sizeof(buf), "FOO"); + assert_int_equal(rc, 6); + assert_string_equal(buf, "FOOzzz"); +} + +static void fd_mpathaaaa(void **state) +{ + char buf[32]; + int rc; + + rc = format_devname(buf, 26*26*26 + 26*26 + 27, sizeof(buf), "FOO"); + assert_int_equal(rc, 7); + assert_string_equal(buf, "FOOaaaa"); +} + +static void fd_mpathzzzz(void **state) +{ + char buf[32]; + int rc; + + rc = format_devname(buf, 26*26*26*26 + 26*26*26 + 26*26 + 26, + sizeof(buf), "FOO"); + assert_int_equal(rc, 7); + assert_string_equal(buf, "FOOzzzz"); +} + +#ifdef MPATH_ID_INT_MAX +static void fd_mpath_max(void **state) +{ + char buf[32]; + int rc; + + rc = format_devname(buf, INT_MAX, sizeof(buf), ""); + assert_int_equal(rc, strlen(MPATH_ID_INT_MAX)); + assert_string_equal(buf, MPATH_ID_INT_MAX); +} +#endif + +static void fd_mpath_max1(void **state) +{ + char buf[32]; + int rc; + + rc = format_devname(buf, INT_MIN, sizeof(buf), ""); + assert_int_equal(rc, -1); +} + +static void fd_mpath_short(void **state) +{ + char buf[4]; + int rc; + + rc = format_devname(buf, 1, sizeof(buf), "FOO"); + assert_int_equal(rc, -1); +} + +static void fd_mpath_short1(void **state) +{ + char buf[5]; + int rc; + + rc = format_devname(buf, 27, sizeof(buf), "FOO"); + assert_int_equal(rc, -1); +} + +static int test_format_devname(void) +{ + const struct CMUnitTest tests[] = { + cmocka_unit_test(fd_mpatha), + cmocka_unit_test(fd_mpathz), + cmocka_unit_test(fd_mpathaa), + cmocka_unit_test(fd_mpathzz), + cmocka_unit_test(fd_mpathaaa), + cmocka_unit_test(fd_mpathzzz), + cmocka_unit_test(fd_mpathaaaa), + cmocka_unit_test(fd_mpathzzzz), +#ifdef MPATH_ID_INT_MAX + cmocka_unit_test(fd_mpath_max), +#endif + cmocka_unit_test(fd_mpath_max1), + cmocka_unit_test(fd_mpath_short), + cmocka_unit_test(fd_mpath_short1), + }; + + return cmocka_run_group_tests(tests, NULL, NULL); +} + +static void sd_mpatha(void **state) +{ + int rc = scan_devname("MPATHa", "MPATH"); + + assert_int_equal(rc, 1); +} + +/* + * Text after whitespace is ignored. But an overlong input + * errors out, even if it's just whitespace. + * It's kind of strange that scan_devname() treats whitespace + * like this. But I'm not sure if some corner case depends + * on this behavior. + */ +static void sd_mpatha_spc(void **state) +{ + int rc = scan_devname("MPATHa 00", "MPATH"); + + assert_int_equal(rc, 1); +} + +static void sd_mpatha_tab(void **state) +{ + int rc = scan_devname("MPATHa\t00", "MPATH"); + + assert_int_equal(rc, 1); +} + +static void sd_overlong(void **state) +{ + int rc = scan_devname("MPATHa ", "MPATH"); + + assert_int_equal(rc, -1); +} + +static void sd_overlong1(void **state) +{ + int rc = scan_devname("MPATHabcdefgh", "MPATH"); + + assert_int_equal(rc, -1); +} + +static void sd_noprefix(void **state) +{ + int rc = scan_devname("MPATHa", NULL); + + assert_int_equal(rc, -1); +} + +static void sd_nomatchprefix(void **state) +{ + int rc = scan_devname("MPATHa", "mpath"); + + assert_int_equal(rc, -1); +} + +static void sd_eq_prefix(void **state) +{ + int rc = scan_devname("MPATH", "MPATH"); + + assert_int_equal(rc, -1); +} + +static void sd_bad_1(void **state) +{ + int rc = scan_devname("MPATH0", "MPATH"); + + assert_int_equal(rc, -1); +} + +static void sd_bad_2(void **state) +{ + int rc = scan_devname("MPATHa0c", "MPATH"); + + assert_int_equal(rc, -1); +} + +#ifdef MPATH_ID_INT_MAX +static void sd_max(void **state) +{ + int rc = scan_devname("MPATH" MPATH_ID_INT_MAX, "MPATH"); + + assert_int_equal(rc, INT_MAX); +} + +static void sd_max_p1(void **state) +{ + int rc = scan_devname("MPATH" MPATH_ID_INT_MAX_p1, "MPATH"); + + assert_int_equal(rc, -1); +} +#endif + +static int test_scan_devname(void) +{ + const struct CMUnitTest tests[] = { + cmocka_unit_test(sd_mpatha), + cmocka_unit_test(sd_mpatha_spc), + cmocka_unit_test(sd_mpatha_tab), + cmocka_unit_test(sd_overlong), + cmocka_unit_test(sd_overlong1), + cmocka_unit_test(sd_noprefix), + cmocka_unit_test(sd_nomatchprefix), + cmocka_unit_test(sd_eq_prefix), + cmocka_unit_test(sd_bad_1), + cmocka_unit_test(sd_bad_2), +#ifdef MPATH_ID_INT_MAX + cmocka_unit_test(sd_max), + cmocka_unit_test(sd_max_p1), +#endif + }; + + return cmocka_run_group_tests(tests, NULL, NULL); +} + +static void lb_empty(void **state) +{ + int rc; + char *alias; + + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID0] in bindings file.\n"); + rc = lookup_binding(NULL, "WWID0", &alias, NULL); + assert_int_equal(rc, 1); + assert_ptr_equal(alias, NULL); +} + +static void lb_match_a(void **state) +{ + int rc; + char *alias; + + will_return(__wrap_fgets, "MPATHa WWID0\n"); + expect_condlog(3, "Found matching wwid [WWID0] in bindings file." + " Setting alias to MPATHa\n"); + rc = lookup_binding(NULL, "WWID0", &alias, "MPATH"); + assert_int_equal(rc, 0); + assert_ptr_not_equal(alias, NULL); + assert_string_equal(alias, "MPATHa"); + free(alias); +} + +static void lb_nomatch_a(void **state) +{ + int rc; + char *alias; + + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID1] in bindings file.\n"); + rc = lookup_binding(NULL, "WWID1", &alias, "MPATH"); + assert_int_equal(rc, 2); + assert_ptr_equal(alias, NULL); +} + +static void lb_match_c(void **state) +{ + int rc; + char *alias; + + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, "MPATHc WWID1\n"); + expect_condlog(3, "Found matching wwid [WWID1] in bindings file." + " Setting alias to MPATHc\n"); + rc = lookup_binding(NULL, "WWID1", &alias, "MPATH"); + assert_int_equal(rc, 0); + assert_ptr_not_equal(alias, NULL); + assert_string_equal(alias, "MPATHc"); + free(alias); +} + +static void lb_nomatch_a_c(void **state) +{ + int rc; + char *alias; + + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, "MPATHc WWID1\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); + rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); + assert_int_equal(rc, 2); + assert_ptr_equal(alias, NULL); +} + +static void lb_nomatch_c_a(void **state) +{ + int rc; + char *alias; + + will_return(__wrap_fgets, "MPATHc WWID1\n"); + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); + rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); + assert_int_equal(rc, 2); + assert_ptr_equal(alias, NULL); +} + +static void lb_nomatch_a_b(void **state) +{ + int rc; + char *alias; + + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, "MPATHz WWID26\n"); + will_return(__wrap_fgets, "MPATHb WWID1\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); + rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); + assert_int_equal(rc, 3); + assert_ptr_equal(alias, NULL); +} + +static void lb_nomatch_a_b_bad(void **state) +{ + int rc; + char *alias; + + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, "MPATHz WWID26\n"); + will_return(__wrap_fgets, "MPATHb\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "Ignoring malformed line 3 in bindings file\n"); + expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); + rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); + assert_int_equal(rc, 3); + assert_ptr_equal(alias, NULL); +} + +static void lb_nomatch_b_a(void **state) +{ + int rc; + char *alias; + + will_return(__wrap_fgets, "MPATHb WWID1\n"); + will_return(__wrap_fgets, "MPATHz WWID26\n"); + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); + rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); + assert_int_equal(rc, 27); + assert_ptr_equal(alias, NULL); +} + +#ifdef MPATH_ID_INT_MAX +static void lb_nomatch_int_max(void **state) +{ + int rc; + char *alias; + + will_return(__wrap_fgets, "MPATHb WWID1\n"); + will_return(__wrap_fgets, "MPATH" MPATH_ID_INT_MAX " WWIDMAX\n"); + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(0, "no more available user_friendly_names\n"); + rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); + assert_int_equal(rc, -1); + assert_ptr_equal(alias, NULL); +} + +static void lb_nomatch_int_max_m1(void **state) +{ + int rc; + char *alias; + + will_return(__wrap_fgets, "MPATHb WWID1\n"); + will_return(__wrap_fgets, "MPATH" MPATH_ID_INT_MAX_m1 " WWIDMAX\n"); + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); + rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); + assert_int_equal(rc, INT_MAX); + assert_ptr_equal(alias, NULL); +} +#endif + +static int test_lookup_binding(void) +{ + const struct CMUnitTest tests[] = { + cmocka_unit_test(lb_empty), + cmocka_unit_test(lb_match_a), + cmocka_unit_test(lb_nomatch_a), + cmocka_unit_test(lb_match_c), + cmocka_unit_test(lb_nomatch_a_c), + cmocka_unit_test(lb_nomatch_c_a), + cmocka_unit_test(lb_nomatch_a_b), + cmocka_unit_test(lb_nomatch_a_b_bad), + cmocka_unit_test(lb_nomatch_b_a), +#ifdef MPATH_ID_INT_MAX + cmocka_unit_test(lb_nomatch_int_max), + cmocka_unit_test(lb_nomatch_int_max_m1), +#endif + }; + + return cmocka_run_group_tests(tests, NULL, NULL); +} + +static void rl_empty(void **state) +{ + int rc; + char buf[WWID_SIZE]; + + buf[0] = '\0'; + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching alias [MPATHa] in bindings file.\n"); + rc = rlookup_binding(NULL, buf, "MPATHa"); + assert_int_equal(rc, -1); + assert_string_equal(buf, ""); +} + +static void rl_match_a(void **state) +{ + int rc; + char buf[WWID_SIZE]; + + buf[0] = '\0'; + will_return(__wrap_fgets, "MPATHa WWID0\n"); + expect_condlog(3, "Found matching alias [MPATHa] in bindings file.\n" + "Setting wwid to WWID0\n"); + rc = rlookup_binding(NULL, buf, "MPATHa"); + assert_int_equal(rc, 0); + assert_string_equal(buf, "WWID0"); +} + +static void rl_nomatch_a(void **state) +{ + int rc; + char buf[WWID_SIZE]; + + buf[0] = '\0'; + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching alias [MPATHb] in bindings file.\n"); + rc = rlookup_binding(NULL, buf, "MPATHb"); + assert_int_equal(rc, -1); + assert_string_equal(buf, ""); +} + +static void rl_malformed_a(void **state) +{ + int rc; + char buf[WWID_SIZE]; + + buf[0] = '\0'; + will_return(__wrap_fgets, "MPATHa \n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "Ignoring malformed line 1 in bindings file\n"); + expect_condlog(3, "No matching alias [MPATHa] in bindings file.\n"); + rc = rlookup_binding(NULL, buf, "MPATHa"); + assert_int_equal(rc, -1); + assert_string_equal(buf, ""); +} + +static void rl_overlong_a(void **state) +{ + int rc; + char buf[WWID_SIZE]; + char line[WWID_SIZE + 10]; + + snprintf(line, sizeof(line), "MPATHa "); + memset(line + strlen(line), 'W', sizeof(line) - 2 - strlen(line)); + snprintf(line + sizeof(line) - 2, 2, "\n"); + + buf[0] = '\0'; + will_return(__wrap_fgets, line); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "Ignoring too large wwid at 1 in bindings file\n"); + expect_condlog(3, "No matching alias [MPATHa] in bindings file.\n"); + rc = rlookup_binding(NULL, buf, "MPATHa"); + assert_int_equal(rc, -1); + assert_string_equal(buf, ""); +} + +static void rl_match_b(void **state) +{ + int rc; + char buf[WWID_SIZE]; + + buf[0] = '\0'; + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, "MPATHz WWID26\n"); + will_return(__wrap_fgets, "MPATHb WWID2\n"); + expect_condlog(3, "Found matching alias [MPATHb] in bindings file.\n" + "Setting wwid to WWID2\n"); + rc = rlookup_binding(NULL, buf, "MPATHb"); + assert_int_equal(rc, 0); + assert_string_equal(buf, "WWID2"); +} + +static int test_rlookup_binding(void) +{ + const struct CMUnitTest tests[] = { + cmocka_unit_test(rl_empty), + cmocka_unit_test(rl_match_a), + cmocka_unit_test(rl_nomatch_a), + cmocka_unit_test(rl_malformed_a), + cmocka_unit_test(rl_overlong_a), + cmocka_unit_test(rl_match_b), + }; + + return cmocka_run_group_tests(tests, NULL, NULL); +} + +int main(void) +{ + int ret = 0; + + ret += test_format_devname(); + ret += test_scan_devname(); + ret += test_lookup_binding(); + ret += test_rlookup_binding(); + + return ret; +} From patchwork Sat Oct 12 21:27:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11186995 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 2E2E61709 for ; Sat, 12 Oct 2019 21:29:00 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B06B206A1 for ; Sat, 12 Oct 2019 21:29:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B06B206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 0E96F18CB914; Sat, 12 Oct 2019 21:28:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E13BF60BF1; Sat, 12 Oct 2019 21:28:58 +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 B46D2180B76F; Sat, 12 Oct 2019 21:28:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.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 x9CLSSjH006021 for ; Sat, 12 Oct 2019 17:28:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7F0BA10013D9; Sat, 12 Oct 2019 21:28:28 +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 09B721001B08; Sat, 12 Oct 2019 21:28:26 +0000 (UTC) Received: from m4a0041g.houston.softwaregrp.com (m4a0041g.houston.softwaregrp.com [15.124.2.87]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 85038356CE; Sat, 12 Oct 2019 21:28:24 +0000 (UTC) Received: FROM m4a0041g.houston.softwaregrp.com (15.120.17.147) BY m4a0041g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:30 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:43 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RNYzJfG4G4gccplsYuLeHydaerVrhm4iAYp+CRWnN/wACNWwn7bTuDfwx2KAYUxYMqHkd2oQhKNdt7UuoXNb7uHDjIuogXwfF38c4uGB7rIJgiLF0KL+fMdKWAZN2QIEymTWKHSKlHVIeFUSkGXRmu/dos7i6W7BNfnGFu9QtixHZ4Ky7Vw19gDciDyNijoP1cYCsZx4PIaDQi4xMZepvpB/jYYULOBCgA9WZyMOJYwEJ1S8rkw8xzGJBs7EWL8wfPzZWjYyBmZYIGctPbqYfD98uDboYooqMbpQG5oCG1pvXOlNQvjT1blMhOvQybv4QPtykpWmGXZwlITcVBe54w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7dir853+WFg1lQchXQ9PpL/4e5n0BA4uCFd7G2LAiXY=; b=F8SjOSLumTuk7X3EuZiTifmURBtLhdI+IYVj8y+qwa7CTDHX4kSaNMmW5DjwvwMMp0hWmEKR8MTKM00NqpHnhCYwhvToKciLcu1A9jj//i/vamqb8Ns3jmfSUL5E4uYQ56TCAP5H4CBfheqFlj8gqYo2a/h4VsS5LqEDYomvLclv5duqgBdYsarXsceDlLzKHvyUqGKJIxlwj43no3D+ITdMkingJOv8IAvp3wVVi2NSNuJvh/K4vC+PmW5U/GxnFG4nvlsjS/nX26I4yHMkY0cTNrMWd0ueANLohD4hnRDHBvEHbLlakVNmcsbbyshDPhVi1if/6R/NGb6J8y0q9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:40 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:40 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 03/72] libmultipath: alias.c: constify function arguments Thread-Index: AQHVgUPgW+Y5/BVJckmjeqKmCKgQpg== Date: Sat, 12 Oct 2019 21:27:40 +0000 Message-ID: <20191012212703.12989-4-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e5a07ea4-979a-4f7b-36fd-08d74f5b02ea x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:288; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kvY9E2BVSTDwPhA5zubjVY/FlWY6qNCTolN3Ra5i50Clb1FvLM77f0Gxk2Fhs2hZLcNK4YT3lWJ83dfgJOLjwD7h220xu7Lp5oCVy3ru7ylaM/hha6GOjqSvWIk/4wiadh1eFSWzaAuqiPs06XAkBebI93c5+kh7dI6mqjAlkqq3kNJZrmpdPPTyaCYatnBDvl56kLgd3lu5MQlW5EDzJ/DXJy0hFjl6VVoWA2EJBAojlTR1ClSdaQI5XhxL7depH5TVP+dgVUT0udf5KD9jW4/R3Z4Es4KC9PvyBrAvcgFXENvLsmM9bYJIlJK/WTRqvdcTtKG4sLWVfVc3Xxke2EDy+bZOWDEy0eEbvZP+8bKygnbDos09khuA7cbPptI0mZ/eCp/MTt5INdXViI3jHL5UG+HFsJgf6pPaNEr6A70= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e5a07ea4-979a-4f7b-36fd-08d74f5b02ea X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:40.7555 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: huTWZQl6NALyB7yNyqgepQCCOjoWj+jqJlnWiH9Q5n1MbIclQJEcJWTD74m0F+nUxvlCOwUOpwzCVoqYagQgLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 12 Oct 2019 21:28:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 12 Oct 2019 21:28:25 +0000 (UTC) for IP:'15.124.2.87' DOMAIN:'m4a0041g.houston.softwaregrp.com' HELO:'m4a0041g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.87 m4a0041g.houston.softwaregrp.com 15.124.2.87 m4a0041g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSSjH006021 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 03/72] libmultipath: alias.c: constify function arguments 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.6.2 (mx1.redhat.com [10.5.110.63]); Sat, 12 Oct 2019 21:28:59 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/alias.c | 29 ++++++++++++++++------------- libmultipath/alias.h | 12 +++++++----- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/libmultipath/alias.c b/libmultipath/alias.c index fd6b7f91..5b05ff69 100644 --- a/libmultipath/alias.c +++ b/libmultipath/alias.c @@ -37,7 +37,7 @@ */ int -valid_alias(char *alias) +valid_alias(const char *alias) { if (strchr(alias, '/') != NULL) return 0; @@ -46,7 +46,7 @@ valid_alias(char *alias) static int -format_devname(char *name, int id, int len, char *prefix) +format_devname(char *name, int id, int len, const char *prefix) { int pos; int prefix_len = strlen(prefix); @@ -66,9 +66,9 @@ format_devname(char *name, int id, int len, char *prefix) } static int -scan_devname(char *alias, char *prefix) +scan_devname(const char *alias, const char *prefix) { - char *c; + const char *c; int i, n = 0; if (!prefix || strncmp(alias, prefix, strlen(prefix))) @@ -97,7 +97,8 @@ scan_devname(char *alias, char *prefix) } static int -lookup_binding(FILE *f, char *map_wwid, char **map_alias, char *prefix) +lookup_binding(FILE *f, const char *map_wwid, char **map_alias, + const char *prefix) { char buf[LINE_MAX]; unsigned int line_nr = 0; @@ -109,7 +110,8 @@ lookup_binding(FILE *f, char *map_wwid, char **map_alias, char *prefix) rewind(f); while (fgets(buf, LINE_MAX, f)) { - char *c, *alias, *wwid; + const char *alias, *wwid; + char *c; int curr_id; line_nr++; @@ -154,7 +156,7 @@ lookup_binding(FILE *f, char *map_wwid, char **map_alias, char *prefix) } static int -rlookup_binding(FILE *f, char *buff, char *map_alias, char *prefix) +rlookup_binding(FILE *f, char *buff, const char *map_alias, const char *prefix) { char line[LINE_MAX]; unsigned int line_nr = 0; @@ -162,7 +164,8 @@ rlookup_binding(FILE *f, char *buff, char *map_alias, char *prefix) buff[0] = '\0'; while (fgets(line, LINE_MAX, f)) { - char *c, *alias, *wwid; + char *c; + const char *alias, *wwid; line_nr++; c = strpbrk(line, "#\n\r"); @@ -197,7 +200,7 @@ rlookup_binding(FILE *f, char *buff, char *map_alias, char *prefix) } static char * -allocate_binding(int fd, char *wwid, int id, char *prefix) +allocate_binding(int fd, const char *wwid, int id, const char *prefix) { char buf[LINE_MAX]; off_t offset; @@ -243,8 +246,8 @@ allocate_binding(int fd, char *wwid, int id, char *prefix) } char * -use_existing_alias (char *wwid, char *file, char *alias_old, - char *prefix, int bindings_read_only) +use_existing_alias (const char *wwid, const char *file, const char *alias_old, + const char *prefix, int bindings_read_only) { char *alias = NULL; int id = 0; @@ -311,7 +314,7 @@ out: } char * -get_user_friendly_alias(char *wwid, char *file, char *prefix, +get_user_friendly_alias(const char *wwid, const char *file, const char *prefix, int bindings_read_only) { char *alias; @@ -358,7 +361,7 @@ get_user_friendly_alias(char *wwid, char *file, char *prefix, } int -get_user_friendly_wwid(char *alias, char *buff, char *file) +get_user_friendly_wwid(const char *alias, char *buff, const char *file) { int fd, unused; FILE *f; diff --git a/libmultipath/alias.h b/libmultipath/alias.h index 95473ff9..7c4b302b 100644 --- a/libmultipath/alias.h +++ b/libmultipath/alias.h @@ -7,9 +7,11 @@ "# alias wwid\n" \ "#\n" -int valid_alias(char *alias); -char *get_user_friendly_alias(char *wwid, char *file, char *prefix, +int valid_alias(const char *alias); +char *get_user_friendly_alias(const char *wwid, const char *file, + const char *prefix, int bindings_readonly); -int get_user_friendly_wwid(char *alias, char *buff, char *file); -char *use_existing_alias (char *wwid, char *file, char *alias_old, - char *prefix, int bindings_read_only); +int get_user_friendly_wwid(const char *alias, char *buff, const char *file); +char *use_existing_alias (const char *wwid, const char *file, + const char *alias_old, + const char *prefix, int bindings_read_only); From patchwork Sat Oct 12 21:27:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11186999 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 367EC1709 for ; Sat, 12 Oct 2019 21:29:21 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 13EFC2089C for ; Sat, 12 Oct 2019 21:29:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13EFC2089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 1C3A3300BEAC; Sat, 12 Oct 2019 21:29:20 +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 E569260C05; Sat, 12 Oct 2019 21:29:19 +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 A0BA04EA71; Sat, 12 Oct 2019 21:29:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSNtq005962 for ; Sat, 12 Oct 2019 17:28:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 051EB6092F; Sat, 12 Oct 2019 21:28:23 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EFD3B608A5; Sat, 12 Oct 2019 21:28:22 +0000 (UTC) Received: from m9a0002g.houston.softwaregrp.com (m9a0002g.houston.softwaregrp.com [15.124.64.67]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9EADDC0568FA; Sat, 12 Oct 2019 21:28:21 +0000 (UTC) Received: FROM m9a0002g.houston.softwaregrp.com (15.121.0.190) BY m9a0002g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:42 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:43 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PF/H9dwxgeVdXGjlaaGZ14xx5ukfuaFCqyH2xck4esJCDldBtY9MURjf3OwVQaW1+wtk1pjETndxOjaiwKUm/YDVyEY/yZjwUSMHP1od1W0mGw3WNRNB4zWEvrsrdECAu+JkqzPXSFlkBor1250aplFdyOrCiR+JHNWoyoHoYHhni/9Tj3gAjNG/ieqdRL36QyW3ZMx60t6ioCwuiHCKEcMJVjF/FQhZGL0274xyamQkwHaFmW796VgJHqfBomCvjnD8pfEy0SbTBP8UhYhKzbOvT35D3WkSZdE43H33hJF0FqS3EkYRb/K+IHd2z7JwD7VRWaQzO+QPJCOrHRxtbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/9Zh9ic6aQn2y4nbayDmQ+9N/x2Q5tgeCPPyabd5aJw=; b=ZYXC+jXLxpn0nAerTAEq+v71Hz+hAJ/RR+olG2avZyu67T1IrZCwSJyLlCyA6gPIyh/htaSZ/nAR0JubUNmuRN2HqvPAlcU4/r+Il/HCXf5GQ8HnNMDDfBFRolIhu29vc0tGp2CTQcV0SO883QUCnbt8HRUsIIrdwytQ7cBFrdvUfgF+1Oi7JVIHJpwyqcTKsEXOggmabT//M0QpmP1PNAe0KvSRtPKfZ+rGXFcElltugkmj1qXLVK49IBpJyGcLpWvMmXZFrGKrkQ4O4dBXzN/3ISVmCTBpLkYMxAdd72at4EN6RS/nC+XzyvM9Q3JxglEdZTOSGugA4UBktGRCvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:42 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:42 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 04/72] libmultipath: alias.c: use strlcpy(), and 2 minor fixes Thread-Index: AQHVgUPhUByRHRMx1UCW8GPIzVX0Tw== Date: Sat, 12 Oct 2019 21:27:41 +0000 Message-ID: <20191012212703.12989-5-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9b472986-a357-42d5-fae3-08d74f5b03a1 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:454; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: C18cWM0fDbDpqW+ihJkvWnEEkYhJ2wqtXW40YQmVmYgSkNpIlpAG8z+wAoBB1gNkl6ne7QIOGF00S4ahiF2ABY/JGqbtoeXmcxehws7GUbZiwcCXCejgoevQJ063Rq+W/ivZ0d42uV3SSkj28pt7MTSK+OAix81ctDqbXIoZ5WPyTjifDmFT2z7jEu44KjdasrcjDw/yN4JLcptoAtu8EDAomeEgwP2oasUToodbC5iStSzuY25IOvKWH4Jf6+/HsDCIgGJvq9mpZARnixRCwSz4Nv670ZVzgzY9QT9IMuW41409Xfam6eInBHHoEm6aXPdbarIHNPDhNC1y4a2WZQ1AzLZ3MWxTZFqZwbjloN9/brx9f0jods63KV4cHo3haTD6ukSQqr0CTftwq2LnP6VDQyjM/FiTzeMUrQ9ihUU= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 9b472986-a357-42d5-fae3-08d74f5b03a1 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:41.9409 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ApGiWlDHLBNDe5+POVuMVs8WB00eE9Kvci+RD2fWCDomh/aRcqN0Y8Nc7/K5qDjd7hhA9RRCRh4zkUnZcPRVsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 12 Oct 2019 21:28:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 12 Oct 2019 21:28:22 +0000 (UTC) for IP:'15.124.64.67' DOMAIN:'m9a0002g.houston.softwaregrp.com' HELO:'m9a0002g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.67 m9a0002g.houston.softwaregrp.com 15.124.64.67 m9a0002g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSNtq005962 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 04/72] libmultipath: alias.c: use strlcpy(), and 2 minor fixes 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.40]); Sat, 12 Oct 2019 21:29:20 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/alias.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libmultipath/alias.c b/libmultipath/alias.c index 5b05ff69..412ab5b4 100644 --- a/libmultipath/alias.c +++ b/libmultipath/alias.c @@ -10,6 +10,7 @@ #include #include "debug.h" +#include "util.h" #include "uxsock.h" #include "alias.h" #include "file.h" @@ -189,8 +190,7 @@ rlookup_binding(FILE *f, char *buff, const char *map_alias, const char *prefix) if (strcmp(alias, map_alias) == 0){ condlog(3, "Found matching alias [%s] in bindings file." "\nSetting wwid to %s", alias, wwid); - strncpy(buff, wwid, WWID_SIZE); - buff[WWID_SIZE - 1] = '\0'; + strlcpy(buff, wwid, WWID_SIZE); return 0; } } @@ -214,7 +214,7 @@ allocate_binding(int fd, const char *wwid, int id, const char *prefix) i = format_devname(buf, id, LINE_MAX, prefix); c = buf + i; - snprintf(c,LINE_MAX - i, " %s\n", wwid); + snprintf(c, LINE_MAX - i, " %s\n", wwid); buf[LINE_MAX - 1] = '\0'; offset = lseek(fd, 0, SEEK_END); @@ -265,7 +265,7 @@ use_existing_alias (const char *wwid, const char *file, const char *alias_old, close(fd); return NULL; } - /* lookup the binding. if it exsists, the wwid will be in buff + /* lookup the binding. if it exists, the wwid will be in buff * either way, id contains the id for the alias */ rlookup_binding(f, buff, alias_old, prefix); From patchwork Sat Oct 12 21:27:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187013 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 90CA018B7 for ; Sat, 12 Oct 2019 21:30:03 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6DE1B206A1 for ; Sat, 12 Oct 2019 21:30:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6DE1B206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E7F3F30ADBAF; Sat, 12 Oct 2019 21:30:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AACB15C22F; Sat, 12 Oct 2019 21:30:01 +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 6A4C8180B536; Sat, 12 Oct 2019 21:30:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSYMG006102 for ; Sat, 12 Oct 2019 17:28:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id D083F60470; Sat, 12 Oct 2019 21:28:34 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 85C36601B3; Sat, 12 Oct 2019 21:28:32 +0000 (UTC) Received: from m9a0002g.houston.softwaregrp.com (m9a0002g.houston.softwaregrp.com [15.124.64.67]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B4A188306; Sat, 12 Oct 2019 21:28:31 +0000 (UTC) Received: FROM m9a0002g.houston.softwaregrp.com (15.121.0.191) BY m9a0002g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:52 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:54 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GHb4rpnS4DRV25VDyd6f3aCJ4yD/6hjfwHxQku7+AglBS219fesersRZKaQAUgdjUXef7aMa0332gw7R8S5V/yinL5/VecGmoUDWWhG1dPe5ThOHInYKfRZ2ZOxZV12iWnbDHTjbCJY9clxJto3MdvV7FLtU7RW/0YSud1G0IWTeoisdZOD/YC+wDOV7ZBx+cbsGhOTyrG3eQ9HQfyS8irMjgKpmJBJj6Gdq4Hs+H10BZrZmmtukePbkDf4utCcfILijSUl1/QjJHNAE7dekz0RdSx7bKHynO4MYUwelXeul24AkvAFKWdPjD4RwvKG3pTDgXwNpLX2dJI+Y8gIrHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Aw1rtJeSs+iSGBS8VshGUQMRNLkQYNO0QNBEk3o38sU=; b=VAgiVaEBgjLT8SHeGbP/ckAtqchh+DpN0v/4GjK7STl+ihFay7uxz/tasu9JzqZ6X/rOAiWZwI+C1zwiYUhEE05dYQiXESDEWp8wjvHA4hGLzV4gUsjI5j0R0K7hgRT95rW8ZGhFAQPcGi3A7Nd4i4qe8oN/zsUAzN46UO7Z/tgQQhOps9yecRw/ho8Rnv4tID0BAD3SZJVSg4q8COlYnlBvefWuHpqeOnd2ROyrj3Swrw3gGscrQZedmXquVPXJnk4hSdJwmMFXTJV1BISQY0wVg2F7WoV/DzfSMRBtmnNOGYxWb0uy/o0hTSUTvCQ0XO7zVCXaUJj1uwRJ7cUT9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:43 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:43 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 05/72] libmultipath: format_devname: avoid buffer overflow Thread-Index: AQHVgUPhXN0oLbktKUK1abPpUwjsog== Date: Sat, 12 Oct 2019 21:27:43 +0000 Message-ID: <20191012212703.12989-6-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a81b6427-06e7-45f6-4e27-08d74f5b0457 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uu6TjCqngdmeN/VkOaF4dt2VOdRqNz1jkbQ6kuSd1Olo7E2lS/JQAug3vaMmOTVeMIoh//8IPqEXsQ4zBpRJMcQ9CczKgZvOf3HyLyFoM/T9YoqO5LwTdvSi5ji4cO8W+GPlN1+Anj9BP51kIp0/nkunSO6ikQal0iY0RqmFrE/GMooDd2GeZdsbRhaK+GLZQFNdFb0LnQvrANC91rt+rTx2hBEU50kDgD9EO/eBjwfJ0yochvjKECHyHuhTTz5IGWWVvtBugq6OcXJCvlQE8pFbOOoQJwWiCwRVSbrHRILtCfpAChCgwoWeEl+Q2vnKpwr3KmU0mhNqDUY4U8bDrPaER45ARlbwKYoWTxDRt4kTQuYSKQ19D+1PYMxSSm75lo4+6vOh5W9VlrE4OTKJ3NnzB/5e7zHSYeovG9yFFKo= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a81b6427-06e7-45f6-4e27-08d74f5b0457 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:43.1412 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: a0UP3b6FAtVQj0O6MJe87XHVYv+Pywc8g4YN6+3pQ6X3XpcUPtpuKKMWsHAmreuTTRZkqFgp1pS7bpodpDMzbw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 12 Oct 2019 21:28:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 12 Oct 2019 21:28:32 +0000 (UTC) for IP:'15.124.64.67' DOMAIN:'m9a0002g.houston.softwaregrp.com' HELO:'m9a0002g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.67 m9a0002g.houston.softwaregrp.com 15.124.64.67 m9a0002g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSYMG006102 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 05/72] libmultipath: format_devname: avoid buffer overflow 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sat, 12 Oct 2019 21:30:02 +0000 (UTC) From: Martin Wilck If the buffer was too short, the current code could write the terminating 0 byte after the actual buffer. Also, assert sufficient buffer length, and positive id. Signed-off-by: Martin Wilck --- libmultipath/alias.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/libmultipath/alias.c b/libmultipath/alias.c index 412ab5b4..0fb206d1 100644 --- a/libmultipath/alias.c +++ b/libmultipath/alias.c @@ -52,18 +52,24 @@ format_devname(char *name, int id, int len, const char *prefix) int pos; int prefix_len = strlen(prefix); - memset(name,0, len); + if (len <= prefix_len + 1 || id <= 0) + return -1; + + memset(name, 0, len); strcpy(name, prefix); - for (pos = len - 1; pos >= prefix_len; pos--) { + name[len - 1] = '\0'; + for (pos = len - 2; pos >= prefix_len; pos--) { id--; name[pos] = 'a' + id % 26; if (id < 26) break; id /= 26; } + if (pos < prefix_len) + return -1; + memmove(name + prefix_len, name + pos, len - pos); - name[prefix_len + len - pos] = '\0'; - return (prefix_len + len - pos); + return (prefix_len + len - pos - 1); } static int @@ -213,6 +219,9 @@ allocate_binding(int fd, const char *wwid, int id, const char *prefix) } i = format_devname(buf, id, LINE_MAX, prefix); + if (i == -1) + return NULL; + c = buf + i; snprintf(c, LINE_MAX - i, " %s\n", wwid); buf[LINE_MAX - 1] = '\0'; From patchwork Sat Oct 12 21:27:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11186989 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 DDA1D76 for ; Sat, 12 Oct 2019 21:28:29 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BAB70206A1 for ; Sat, 12 Oct 2019 21:28:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAB70206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 970C7307D965; Sat, 12 Oct 2019 21:28:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B205601B3; Sat, 12 Oct 2019 21:28:23 +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 142CC1803518; Sat, 12 Oct 2019 21:28:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSJ5i005926 for ; Sat, 12 Oct 2019 17:28:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 29DE85C22F; Sat, 12 Oct 2019 21:28:19 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx24.extmail.prod.ext.phx2.redhat.com [10.5.110.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 959A45C223; Sat, 12 Oct 2019 21:28:16 +0000 (UTC) Received: from m9a0002g.houston.softwaregrp.com (m9a0002g.houston.softwaregrp.com [15.124.64.67]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D476E10CC1E0; Sat, 12 Oct 2019 21:28:14 +0000 (UTC) Received: FROM m9a0002g.houston.softwaregrp.com (15.121.0.191) BY m9a0002g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:35 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:50 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ezIKU4r3SOpnrkGDpsDZrLnQ0mNG8Gv9C4pdOUyYpGL/9GKYWq86tlywtURI7Dzm/mRQxRvwnd0kBtGzLzuS1N648Rvc9fz0x+KYaUkScabVNDtRXQg92cXdf7FMAW0AAqaXA8GjZ1NDhDL+j5kHc5MyuklYCmJyRlS23ad2pacoOBTIspsalmTTGwnzIy3sHKKJEy/ckhQxrx7zYE7DdBc5GUar7/DS4yHWYyFHdHAVtdsvYpMBMK2hq7ZGpJ7F2EoLBiBxUV8Qv1ysHmph9rNwxZk7fYsNVvckfpzyQnPiVNq8wdRp+ne4bbuumWwgum9T6OM9FGz8B1F9I8Z1gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TYf9COWlrjjsb3wkntfzZoZ+JRRXRJ2Mej1VxOSps+M=; b=B6Bw5wfntYnr9tX6lgpuTWXwx2ftzYKk5wd2TBs68kxU9UBJ6XLDKn3ROrg8lCiXTi3lW+4OVx5vhS1zCupq6PV4nUDVBPQ4SJAl04OfxFy6J/W1BpNEpOhGyazu+pWGvOwkwipUnq3Vw1Q6/sU+Lq9yHfPO5A3kBwOZorThAmjBTesHpXO0d82qpRqLP+UGc/fI0tmCMwX8ILClSn40JOfcBNobwwhn9KREIH2mn5S0jRDzxQXDZWDGpW/3QsemZKWqNnGfvQt7egEUcAXnq9mvXwn09VNiEKugUw3o6QX6p0yNF9nzmFIBcqzrTYskhK11LJPug6N7aokib3KZIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:44 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:44 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 06/72] libmultipath: scan_devname: fix int overflow detection Thread-Index: AQHVgUPiigmZ0oY4f0Shl8VUC6Ag2A== Date: Sat, 12 Oct 2019 21:27:44 +0000 Message-ID: <20191012212703.12989-7-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1776a4ae-4a1e-4b4c-6019-08d74f5b050f x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(52314003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: y1yrpFX8Y2dEuAZZkUIj0S6KHGLp6E9WC0m7rNA86CE7WcGzAT4Z7FprKu2K3X0XAjGHt5xwwFOU2mQeZjSfn9wEIQzueBY/HFJhKG7bNxTNkZpfGIrzGPpgMVZQd9LtTaJMVXPla6vOucf9kHFl4a0dy9FDi3erLAjbX9Cp9jjJ6VW2UUP6rUo/DVcu11OkEV56rRdaOWggXlk2OO8xThgT3wUphFvKH25ekhmsIRcMYM2aRGpuWTnG8xbXMk3duY9tVXSDjsKtr0vvQwQvqPKD1llwSOamw+qBcfoCganDSvAzGuWblcb2QGN02oAT6elwRqHjysTJu8q6Odi5UzYD3GqAvH+MD/293yHhKQa4pwH3ifwtnFE5mChYfFQj9mHV5i71B4TSqKdSMGP8Ax/xEyV5DlAfnvXA4kpLYjE= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 1776a4ae-4a1e-4b4c-6019-08d74f5b050f X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:44.4694 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qfgwyNvR1CvIvXOo9k0OeJO9a22Q2kTerElDYRoAyifM3MIOijxaNUoH4i84EZo1D5XS/jYwHH1ZR2AIyRDIEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Sat, 12 Oct 2019 21:28:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Sat, 12 Oct 2019 21:28:15 +0000 (UTC) for IP:'15.124.64.67' DOMAIN:'m9a0002g.houston.softwaregrp.com' HELO:'m9a0002g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.67 m9a0002g.houston.softwaregrp.com 15.124.64.67 m9a0002g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.65 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSJ5i005926 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 06/72] libmultipath: scan_devname: fix int overflow detection 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sat, 12 Oct 2019 21:28:28 +0000 (UTC) From: Martin Wilck For an int n, it's possible that n > 0 and (26 * n) > 0, but and still 26 * n overflows the int. E.g. n = 0x0ec4ec4e; 26 * n = 0x17fffffec, truncated to 32 bit yields 0x7fffffec, which is > 0. And anyway, relying on a signed int overflow to detect a problem is wrong, as the result of such operations is undefined in C. Signed-off-by: Martin Wilck --- libmultipath/alias.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmultipath/alias.c b/libmultipath/alias.c index 0fb206d1..a96ba5cc 100644 --- a/libmultipath/alias.c +++ b/libmultipath/alias.c @@ -77,6 +77,7 @@ scan_devname(const char *alias, const char *prefix) { const char *c; int i, n = 0; + static const int last_26 = INT_MAX / 26; if (!prefix || strncmp(alias, prefix, strlen(prefix))) return -1; @@ -93,9 +94,9 @@ scan_devname(const char *alias, const char *prefix) if (*c < 'a' || *c > 'z') return -1; i = *c - 'a'; - n = ( n * 26 ) + i; - if (n < 0) + if (n > last_26 || (n == last_26 && i >= INT_MAX % 26)) return -1; + n = n * 26 + i; c++; n++; } From patchwork Sat Oct 12 21:27:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11186991 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 075D976 for ; Sat, 12 Oct 2019 21:29:00 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D834A206A1 for ; Sat, 12 Oct 2019 21:28:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D834A206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B6D68830A; Sat, 12 Oct 2019 21:28:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DCA626092F; Sat, 12 Oct 2019 21:28:58 +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 B3AF5180B761; Sat, 12 Oct 2019 21:28:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSMP7005949 for ; Sat, 12 Oct 2019 17:28:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 640C15DA8D; Sat, 12 Oct 2019 21:28:22 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx24.extmail.prod.ext.phx2.redhat.com [10.5.110.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A5965D9CC; Sat, 12 Oct 2019 21:28:22 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E8A310CC1E0; Sat, 12 Oct 2019 21:28:20 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.146) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:26 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0334.microfocus.com (2002:f78:1192::f78:1192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:50 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n2fIp5e4r/+rS4jHZ1JOL7f8UBRZoTPA8BKlbd0JbMbNzHu4xfil4PMrIA/wWHW164I8+Vf5SRHKp9m6cP2C4tdHrgE1qjVYGu1nEuKnP18/tNFG+L9AdpHRA1bCi6C4/+4QG7xZzcqs7wbiRr1g840laZqPruQqKsf0heLTz7lNgJVEbmLSAdDij9BXo1E0NysMZVlm15gXfZ8SqX2kyw+0q+06oxzauRZo/CLjbYx9URvSzJRkvosYXq0tkHFCF79f3dN2f8isejQgh/RRvQSC/EHKKqwJtUp98/uiOpPnVRSbg2pJhFCJqQbhU6lSNKBQkEjqcDnCG/VLiZrF6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GtIU09vJuecqOLQmRR8IktuemBsDUH78ymkbsxoEYH0=; b=HKaNz5iQ6g+yQfZGGMqbFbMKHHr3xO+imElI24JsY7kBHuFONFvCWDtiURXXLzJt/nZoRZGEuakLizl6HtaEKuiwaEFVjp0L5+CQis2C7luoVfI+8kYFS59s95pF7D76Sxa0grrlLdCRDRBkKmpSZVgSHhyug/CQp+Q9A2G+IpBB6yCNEdXOqtKGDTOImEBvqlwr6WBsr70DNZ+xQhjEPHLdmmCQyz6iECn1JynZE6knmo1mQUXtNlCnsTo2RuujReu2+k/H8EFf2RZmJA805Vh+AQn0e+bJYiZkgi8cvn40NFlNFhcs9JVYHeTa1kwie7YbGWW7vA4RcLuyzjZXqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:45 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:45 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 07/72] libmultipath: lookup_binding(): don't rely on int overflow Thread-Index: AQHVgUPjmlPzR6wJn0GcDt9CCv+bZg== Date: Sat, 12 Oct 2019 21:27:45 +0000 Message-ID: <20191012212703.12989-8-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d5a58c90-f107-4ae0-befa-08d74f5b05d9 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qfRu+0jcD//Bq3FpAN/ABjdP3Uu3zLZ3+LJJmepdSqfnQkJKsBgPd7Z2JR5RSIXLJM2w1IsCkX0Q3/8FEy6MKE7XCG9chEKmm39nbFfBSsRwfgBFnsbcIjCQvXoLLqUoNRQhiN1jlVtYHx49tLZc9wb0Zu8p/dmHCIg08yNoaIIVrG4KRbxfPehjtYZIb1ecv2KtPk0Ro1/4n6Lyrghh96meQsJxYk9El2SVdJiyXvTXdTIMVZSVbwBDQFBJYDZ5iK8wU+AuEwOvhxziWmERo22nSDJzAnBU+/4n2dlc7AY4nOSnVfGGhFOpLJ/ljKSACrkC4sIw4WtA6fYULlRukQswMSw+0LJQTP8eaAvHbfb0i/EPlZeBlA/XDvi5mABgHnuOJsq3ZRF54I4E+Y3mZUn5O6vNvUrLX35jHNql0vw= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d5a58c90-f107-4ae0-befa-08d74f5b05d9 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:45.6768 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nK5galxHiKnrHhkq0xYtyfZhQKrTsJ6ssNmfKojMIygxr8XiaW3MroDuxLMhVMUFqubh1l2YkR9zhOWxQxqkbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Sat, 12 Oct 2019 21:28:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Sat, 12 Oct 2019 21:28:21 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.65 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSMP7005949 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 07/72] libmultipath: lookup_binding(): don't rely on int overflow 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 12 Oct 2019 21:28:59 +0000 (UTC) From: Martin Wilck lookup_binding() would return a negative result and issue an error message if variable "id" became negative. But id is only incremented, starting from 1. Relying on an int overflow is wrong, because the result is undefined behavior in C. Also, an overflow might as well (actually, more likely) occur if biggest_id == INT_MAX. Also, lookup_binding() would return 0 both in an error case and if a matching wwid was found. While the two cases could be distinguished by checking if *map_alias was NULL after return, this is highly non-standard and confusing. Return -1 in error case. Because of the semantics of lookup_binding(), the test for "id" before calling allocate_binding() in get_user_friendly_alias() is redundant. Signed-off-by: Martin Wilck --- libmultipath/alias.c | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/libmultipath/alias.c b/libmultipath/alias.c index a96ba5cc..ac342a54 100644 --- a/libmultipath/alias.c +++ b/libmultipath/alias.c @@ -104,6 +104,13 @@ scan_devname(const char *alias, const char *prefix) return n; } +/* + * Returns: 0 if matching entry in WWIDs file found + * -1 if an error occurs + * >0 a free ID that could be used for the WWID at hand + * *map_alias is set to a freshly allocated string with the matching alias if + * the function returns 0, or to NULL otherwise. + */ static int lookup_binding(FILE *f, const char *map_wwid, char **map_alias, const char *prefix) @@ -130,8 +137,14 @@ lookup_binding(FILE *f, const char *map_wwid, char **map_alias, if (!alias) /* blank line */ continue; curr_id = scan_devname(alias, prefix); - if (curr_id == id) - id++; + if (curr_id == id) { + if (id < INT_MAX) + id++; + else { + id = -1; + break; + } + } if (curr_id > biggest_id) biggest_id = curr_id; if (curr_id > id && curr_id < smallest_bigger_id) @@ -147,20 +160,26 @@ lookup_binding(FILE *f, const char *map_wwid, char **map_alias, condlog(3, "Found matching wwid [%s] in bindings file." " Setting alias to %s", wwid, alias); *map_alias = strdup(alias); - if (*map_alias == NULL) + if (*map_alias == NULL) { condlog(0, "Cannot copy alias from bindings " - "file : %s", strerror(errno)); + "file: out of memory"); + return -1; + } return 0; } } - condlog(3, "No matching wwid [%s] in bindings file.", map_wwid); + if (id >= smallest_bigger_id) { + if (biggest_id < INT_MAX) + id = biggest_id + 1; + else + id = -1; + } if (id < 0) { condlog(0, "no more available user_friendly_names"); - return 0; - } - if (id < smallest_bigger_id) - return id; - return biggest_id + 1; + return -1; + } else + condlog(3, "No matching wwid [%s] in bindings file.", map_wwid); + return id; } static int @@ -363,7 +382,7 @@ get_user_friendly_alias(const char *wwid, const char *file, const char *prefix, return NULL; } - if (!alias && can_write && !bindings_read_only && id) + if (can_write && !bindings_read_only && !alias) alias = allocate_binding(fd, wwid, id, prefix); fclose(f); From patchwork Sat Oct 12 21:27:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187019 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 6E19918B7 for ; Sat, 12 Oct 2019 21:30:25 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B9EF206A1 for ; Sat, 12 Oct 2019 21:30:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B9EF206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E98B176528; Sat, 12 Oct 2019 21:30:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C74E05C22F; Sat, 12 Oct 2019 21:30:23 +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 8DF03180B536; Sat, 12 Oct 2019 21:30:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSQb5005991 for ; Sat, 12 Oct 2019 17:28:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 49122608C2; Sat, 12 Oct 2019 21:28:26 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 404866092F; Sat, 12 Oct 2019 21:28:26 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CDBF281DE0; Sat, 12 Oct 2019 21:28:24 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.146) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:31 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0334.microfocus.com (2002:f78:1192::f78:1192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:51 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dIFh0ipWtiCagOqWeoMlrBM/KlVmgr9jI/IPq47UGpFwD6iYXm4JHDANqGNf0/PXa5g7cE4ZiEtIKk2b/sUu01mXg9glqzcnOjEiogT5HDeauEoKESZ9Iuc0pBprcRld7lj44QhnscX/drQ8u5ZXyo+BDo12dMIOuRRgP0CrThOi9jaBF1fRoARllTGovI+0hAnFEAbKDnXznZZXEEO+BQuUwEfZyz9DMzbL+MS4c9efC8h0HW2tPCI7aDTN8sev0kRTdTQcpn4t5D9B/eltWA/FxA/Dz4NQ7lRSr1EYvIrsSzBBEeTKubHrl/iu0CdV9K+BqPFMSWUY7qJpvl0Qmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jLX1Z2WIt8y5BWAMHjQAJqnnf4p7cC09f8Z7oay6pCU=; b=CBPjTJ8JJoAmmNXrDK2YCQWOsAL6AL+YNCysWnF4OipaNfrmgXGzyb+KGDYatxEe1T0vdnXuzZm6p9GHxqakbMwn7FKbKdx5+Dy3gdIM0ShAzTsmJJeVXZS1yfihrDePYzyo80IJ4PhM9Moidw4wQLyjEEsGWtZ4+blVjtXgde1zakm/SawdJFH2FIP8IRv1pxza9SPQQONiA9lBPNgBLfw1GGe2vNyMiV2e0HJcV4km3qPKlItP9Ezel4o66Bw8ON2w+7J3Lc87HBNxCQftI1H2Segnby/Dh6AF1RS9P0XPexiYoEdXBltjND2lVLA0kLC81Ww80/MjQpItiR/3WA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:47 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:47 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 08/72] libmultipath: rlookup_binding(): removed unused parameter Thread-Index: AQHVgUPkCeN2IDucrk+ZIP9PWbH0qA== Date: Sat, 12 Oct 2019 21:27:46 +0000 Message-ID: <20191012212703.12989-9-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2fb95730-f3ce-4599-5bca-08d74f5b0691 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UvfrQNdHQDiNP14N8F/hT0RL9hGWoXj3c1R+CyIU29l9thh+ItnRGrJh3IeKl/9G4HcDIjtI4k7rHzNv9UcwotoQwlWq+UdZ3Vl99h2MwB63LLSuy73hLASCNf5Kj2ozn1mQ1iLrNQhHVuGJwls7f7CFwXyPnHODDrfwNB0i43lCwoAjbx8AhgW1swHyYn9YHcASMDgksk7wFAZIQDwrxOZoq2WZSFc8VCB0qkA/Ft7b/cG7M5ptUgFHqcbzFWEZWGoXAhcbNVrgB/gnnSW595dR1Xm5P4WvPxQyZTsgexPRYa6sKHyp35Zl6F/hXbZcklt4rJm3tXrAqTEpUVQ20eosuruQ1v1/9/TLZ0wQG8nINA4pfmYrKnzb6jaQm4K022h6cKicI1zf6n0S+i4Cb9xvDQpsw0zHLun318NaG8Q= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 2fb95730-f3ce-4599-5bca-08d74f5b0691 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:47.0020 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: SuqlsO7zWab60bmac7b0ySwN0nHKuDJALCf8zAeteOCV+0y3k9TYSgztxMK/3J3aGbIleNRrLaCzB1z8hXwdMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sat, 12 Oct 2019 21:28:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sat, 12 Oct 2019 21:28:25 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSQb5005991 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 08/72] libmultipath: rlookup_binding(): removed unused parameter 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 12 Oct 2019 21:30:24 +0000 (UTC) From: Martin Wilck The parameter "prefix" is unused in this function. Signed-off-by: Martin Wilck --- libmultipath/alias.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libmultipath/alias.c b/libmultipath/alias.c index ac342a54..767800d0 100644 --- a/libmultipath/alias.c +++ b/libmultipath/alias.c @@ -183,7 +183,7 @@ lookup_binding(FILE *f, const char *map_wwid, char **map_alias, } static int -rlookup_binding(FILE *f, char *buff, const char *map_alias, const char *prefix) +rlookup_binding(FILE *f, char *buff, const char *map_alias) { char line[LINE_MAX]; unsigned int line_nr = 0; @@ -297,7 +297,7 @@ use_existing_alias (const char *wwid, const char *file, const char *alias_old, /* lookup the binding. if it exists, the wwid will be in buff * either way, id contains the id for the alias */ - rlookup_binding(f, buff, alias_old, prefix); + rlookup_binding(f, buff, alias_old); if (strlen(buff) > 0) { /* if buff is our wwid, it's already @@ -412,7 +412,7 @@ get_user_friendly_wwid(const char *alias, char *buff, const char *file) return -1; } - rlookup_binding(f, buff, alias, NULL); + rlookup_binding(f, buff, alias); if (!strlen(buff)) { fclose(f); return -1; From patchwork Sat Oct 12 21:27:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11186993 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 1E31E14ED for ; Sat, 12 Oct 2019 21:29:00 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EFDE32089C for ; Sat, 12 Oct 2019 21:28:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFDE32089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 mx1.redhat.com (Postfix) with ESMTPS id 06FB781F19; Sat, 12 Oct 2019 21:28:59 +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 DEA4C5DA8D; Sat, 12 Oct 2019 21:28:58 +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 B24394E58A; Sat, 12 Oct 2019 21:28:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSMAW005957 for ; Sat, 12 Oct 2019 17:28:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id E4E545D717; Sat, 12 Oct 2019 21:28:22 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx26.extmail.prod.ext.phx2.redhat.com [10.5.110.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5D255D6A3; Sat, 12 Oct 2019 21:28:20 +0000 (UTC) Received: from m9a0002g.houston.softwaregrp.com (m9a0002g.houston.softwaregrp.com [15.124.64.67]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C198801664; Sat, 12 Oct 2019 21:28:19 +0000 (UTC) Received: FROM m9a0002g.houston.softwaregrp.com (15.121.0.191) BY m9a0002g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:40 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:52 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AIRd1t9y2v5Zy/OBDEnxVFTmrocZxPFmb2r7jRW4jwDh3KbxK48psQiVE3SFCCEdEFDz1oLQoZ5OErdl0zTCVFVekp0uTUdjQSPmpew3NZTWACBej2ItnPr0ldeuN97NqLp/TskMLe4zJGN/Nwsg472zVpOQdQW+Jlppp9oGA8+jEKGxB9Zmti05qTXBF9Om5Ylpm6eLF2H7kJ83XrZy3MeJaY4GFltXsCquFO0pxsrCWni1dPrOCn80nm2F4jP0F3SseuNVdhvj+XR5U7f965kfiGjoLpRHTFL6s3/rIhAbvM+OYlx/RoYEFbv9nBGAeBdrbNL78e1HCmU5Mp2ONg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uMqd0t4oAckFt/3JlLR3cVw9UzHAQIPcGHoia2tpyas=; b=erY1+NjYmJnWoonXIS35jZe2eahdnWUMjf60XcC+VCe04oqNYTxYQXyCqaloRflouMG7S5uxbM4IOij0K1N0U5Galqn/uL4nQTM65Cc070HoN2JviQ0L9YRlDRGMgsCiJKqS2mbjtTlvYaO+pgrnomt50feadwiFOyMb8c2VrjlJz4O5AB6L+W9kMj5fSFkn5qClbw7VBojqadHns8yOlAYohY7RkzdHxyj5GL3Z8zdd4iPPhk32l8e0bl+4054RleWMaEcxDW8+nnxP2P5Fgu4aVlXmZsTeSGsHYkIBJrfZgBPGqtGlD9ZE1WR7Lq05v5VbCmDlbff9gT48DANOiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:48 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:48 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 09/72] libmultipath: allocate_binding(): error out for id=0 Thread-Index: AQHVgUPlPKVGomRkqESDwfnyQ87iNg== Date: Sat, 12 Oct 2019 21:27:48 +0000 Message-ID: <20191012212703.12989-10-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f37f0f5b-391a-4c58-639f-08d74f5b075f x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8UvcVGTYIh9mE0hUTLuCA14+7FnjXmfmI5H8e5bjLGMOvYKIvL4UIdmLfIXseRH1PjOONx+wUwg+F6bgFfUPLTmq304sDjT2C6dhOkqUxplSkYUp2ar4z59oSwWzcogdDJLoZO5jz8jEnz6BgeoVQ9qa6CJHFCYs8mZmI/nNvxLLFJ+FGV9aUkQOTUDbwIdktlFKJVcqCNyGxZYlB2/Pg3kBt91ju/ffO8wt8LNqzzN2xQWfMIbogE0sYn+v6MDYDUBocOQxYq1xCpw3sAGWg0vMC4bdRDg8YimV802kdb69ZUYy2QcWvpcEEeeGHIdYu5Y5STr+DhOin5od3DaYeeyr/O5wwcEa5YzLol7a75W2smK9xGumgqqGtsNKTsWwBtKQXcz39ZR4aB0ky19vKeB4HN/L8QZZK+dNrBSBjmw= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f37f0f5b-391a-4c58-639f-08d74f5b075f X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:48.3373 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: MRr1wqdj8v3m/cjeWDyEPif7IHtOGN/ThF8+gJxgyREdMiWPKOtqqysxgAUZjq4/6dO7PqrFOes7uj/4SOiS2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Sat, 12 Oct 2019 21:28:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Sat, 12 Oct 2019 21:28:20 +0000 (UTC) for IP:'15.124.64.67' DOMAIN:'m9a0002g.houston.softwaregrp.com' HELO:'m9a0002g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.67 m9a0002g.houston.softwaregrp.com 15.124.64.67 m9a0002g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.67 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSMAW005957 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 09/72] libmultipath: allocate_binding(): error out for id=0 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sat, 12 Oct 2019 21:28:59 +0000 (UTC) From: Martin Wilck Only for positive id can we allocate a binding. All current callers make sure the id is positive. Yet, fix the implementation in allocate_binding(), too. Signed-off-by: Martin Wilck --- libmultipath/alias.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmultipath/alias.c b/libmultipath/alias.c index 767800d0..2df34f32 100644 --- a/libmultipath/alias.c +++ b/libmultipath/alias.c @@ -233,8 +233,9 @@ allocate_binding(int fd, const char *wwid, int id, const char *prefix) char *alias, *c; int i; - if (id < 0) { - condlog(0, "Bindings file full. Cannot allocate new binding"); + if (id <= 0) { + condlog(0, "%s: cannot allocate new binding for id %d", + __func__, id); return NULL; } From patchwork Sat Oct 12 21:27:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187011 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 4F3DD14ED for ; Sat, 12 Oct 2019 21:30:03 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B92B2089C for ; Sat, 12 Oct 2019 21:30:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B92B2089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 13EB14FCCE; Sat, 12 Oct 2019 21:30:02 +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 B878C19C6A; Sat, 12 Oct 2019 21:30:01 +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 6FA714EA71; Sat, 12 Oct 2019 21:30:01 +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 x9CLSODF005982 for ; Sat, 12 Oct 2019 17:28:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 39CF260BF4; Sat, 12 Oct 2019 21:28:24 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx30.extmail.prod.ext.phx2.redhat.com [10.5.110.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3086A60BF1; Sat, 12 Oct 2019 21:28:24 +0000 (UTC) Received: from m9a0002g.houston.softwaregrp.com (m9a0002g.houston.softwaregrp.com [15.124.64.67]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A0E31DB6; Sat, 12 Oct 2019 21:28:23 +0000 (UTC) Received: FROM m9a0002g.houston.softwaregrp.com (15.121.0.191) BY m9a0002g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:43 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:52 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L7tU4fF1D8fR/6xNS5YwbetaavstC9Zz249O+7WBRlSpf68Cg+/zLNcqZywlwS82YjugbWXVRcmqDKIwz5QhwZH0gJZ9xIagx3SpSwLdu+85fMaVF59QZez17O3eUD/sAP0SNDo9XhIE0vfQfKIdfToGePy0PED1aaCRi0npqsUSgoJTH1Ul7Wb8MPj1qu9/AUTrUFoiZv2eaZZhpltgqML9ExCwcPwIcG1zB/G8l6JDTVYBHLHcPt9/zb8BP69vNfedov9Am/Lp/KSK2yfokA72UOEyTKHK/6vpi/2qULkpWH+JRmhmD2kj81ZYhOzo+xHADqXtbyM8oK8JEjZfOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TKLVMg0m7IPPvrpYacrDA4DsJZ1iC3Xs76nF4ZfyFXA=; b=oSA2Mri2zLdmM9wtsO0t0DBNh3Fx/JZzY15UF4NNmIZQo8X9f4L8m2WjmD56t9VwmPbmYJyOBVlpv3yLTvzDCI4yqrQ4m1XGk7bTzf2Br29DpFwMadWO96y+kNbk2qpKt+E4wZ4uQhUeE5W4S2S83CZ0M/hjXEQMRzgm2S+e+rKxhgmHjfqJBcZNTzYfKzf5n0dv8ZaMuRZnt6O2zrZmmztM77eMt1wFrvVd2IEeKraXEAqNPqvmFGb6eyJKfy4A4KQwJrKuzS4qraW8VuDzQGJHDfPBNBmCrH0iftjMWSZLB+pxju8YFMpmoAFT1001listA7p+0Je+mefKnldndA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:49 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:49 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 10/72] libmultipath: allocate_binding(): detect line overflow Thread-Index: AQHVgUPlujh3OPFUWUGuHS5xoFp89g== Date: Sat, 12 Oct 2019 21:27:49 +0000 Message-ID: <20191012212703.12989-11-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8de7a1b5-8f88-438f-8a23-08d74f5b0828 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:459; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mSmRG+2DhGeKwWC5/z09+6wPKGIsG0Altwe15bmyQaz5igN44Vu6cXl3hAzY5xAuSovP+AMhog2beWh+PiR5fF3iAuEnb1F4baxejuiGHrT9IPz5IZIGXLqqlEDiozRn2CzZ7dmWwUTULCLI4j/dx1FgvNsFZWxEFO7Dd9ofn9jeb6gwBhosxS3yW4jQtjpisZCncQQfW+LulP7O2Gcx1W0p6s0O19KRF9ivtAP5xe6rQ2y+t1UVs8VM4N5sJXB8V4NudrhraAbMJrIIke2QOEkPDHq7dOLywer2i2GLQvxl4xX/CdEJ7DmQ7Ryt4vmXDOFEVzU9UAhuJfP4hSZJFgXcynF1vipj9IJQsRqXHSdtSPh+0X2wJlt9eTeex2XMNhdTgaBGqVt/pP3ZMdXAWNbpDcb2k9/4m3RstpSYC/w= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 8de7a1b5-8f88-438f-8a23-08d74f5b0828 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:49.6245 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Yik9eRJvCQ9rgpprcyz+lbt30teXYSTrWf9meG+7qdR7G4GXrgGoKQLg9Fm7xM20ebTEuo9l53KYM0Jqxatuxg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Sat, 12 Oct 2019 21:28:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Sat, 12 Oct 2019 21:28:23 +0000 (UTC) for IP:'15.124.64.67' DOMAIN:'m9a0002g.houston.softwaregrp.com' HELO:'m9a0002g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.67 m9a0002g.houston.softwaregrp.com 15.124.64.67 m9a0002g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.71 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSODF005982 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 10/72] libmultipath: allocate_binding(): detect line overflow 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 12 Oct 2019 21:30:02 +0000 (UTC) From: Martin Wilck Be sure not to truncate the WWID. This shouldn't happen under normal circumstances, but play it safe. Signed-off-by: Martin Wilck --- libmultipath/alias.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libmultipath/alias.c b/libmultipath/alias.c index 2df34f32..15bbc8ed 100644 --- a/libmultipath/alias.c +++ b/libmultipath/alias.c @@ -244,7 +244,10 @@ allocate_binding(int fd, const char *wwid, int id, const char *prefix) return NULL; c = buf + i; - snprintf(c, LINE_MAX - i, " %s\n", wwid); + if (snprintf(c, LINE_MAX - i, " %s\n", wwid) >= LINE_MAX - i) { + condlog(1, "%s: line too long for %s\n", __func__, wwid); + return NULL; + } buf[LINE_MAX - 1] = '\0'; offset = lseek(fd, 0, SEEK_END); From patchwork Sat Oct 12 21:27:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187027 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 7BC831668 for ; Sat, 12 Oct 2019 21:31:06 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 571AD20700 for ; Sat, 12 Oct 2019 21:31:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 571AD20700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A335581F19; Sat, 12 Oct 2019 21:31:05 +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 7D36D6046B; Sat, 12 Oct 2019 21:31:05 +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 44B814E58C; Sat, 12 Oct 2019 21:31:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSUo3006060 for ; Sat, 12 Oct 2019 17:28:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 43C27608C2; Sat, 12 Oct 2019 21:28:30 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 39B7C608A5; Sat, 12 Oct 2019 21:28:30 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9DC40307D971; Sat, 12 Oct 2019 21:28:28 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.146) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:35 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0334.microfocus.com (2002:f78:1192::f78:1192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:52 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=liCkzdTuwHLdw8RkljD1nzjZUzmGAc2H4HoEYAH9De99FZdeOQtob2s0MeS880a5zRaAWr2kb2Q5TYba/RDEfXkm8QKFPXmseF1YMllykETGjBjjLFelu6sxDET0kY9ASyP/o4LbjBH8aR/GaypmdimTjpCTvrnNGKHPSjpC5oJhTFmMs//HsODlflD6g9+F9sCqvYJzr5v4adok49mA2KR8xODvypkornwGq6qnlAeB/nYFY4GxsOQ75uvP6sRaIfWckeIbdDXTiXlFb6rW+FtFNqoQY5G5FI7k/C9JXAOf1Hu0S3mT+/3iZQHTNmnNx/THSx2X2X+dni9TJyoITQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R8EuTIXqsrGB5wewPlolr+OymBij5aERJFSg+ItwQKc=; b=U6gfen984cD+lZ065VQiKRkHc7sXBaYoRStNntsmzkQQFonh7b3X41BfOX2xYJj/cc+uwh+Go46T+w6r0b2A1C97EAzw0pnmD+D9XEwAzKUSm98Jdqb8OPySpB8Wx/ves699qy9YYIh+YxysPkO0vlBDQsHX2nboAz6XuE5330p4ebflL4fWJ6yzQGQAnOX+8plh9my7ESqMvX5/IR37aRFYRB8R/o4wo9X3XkqF496yD7P0bF/l5NLpG3M+D31e5e/L+2muBocI5IOjCuKEO+oDduv+tWpAGyNts93lnGZl/0yvaG8Mig5Y5Mxs4a1hNYxupwn0CD1tcfRyR+N47g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:51 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:51 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 11/72] multipath tests: alias: add tests for allocate_binding() Thread-Index: AQHVgUPm2auRXL3ebkCFreIF12xa/A== Date: Sat, 12 Oct 2019 21:27:50 +0000 Message-ID: <20191012212703.12989-12-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b7490ed3-6e86-49dc-3b87-08d74f5b08f1 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4nVmYidzetXGtxp0EAmFBl3iL8GQH87LT7bj0UQT/bSHHJ8zM98kpuUncQYPwyisBiCPgvhUGMFVEUqgYT4mwn1J2eMflZv2MkrJYeY6L6bhkJ/6vCCTqPnTxfu3x4ftemSBP5/OekvE42WYfcy32kdQt5VAit6L6kYkwDVSdmrAFXwx6FRqwxh04b5inB3dl9w6cEdyjE8jHiz5n8/2a288uWWX2qYh5d56Pwko5vIDAfqBTrkEstgiA90XRdAh8bJO83sxqLi0cbyCX5aKjcRa3/c0Q/ssxw/dpfn4DLn5dcECo87iIIWUAQgEeNQCM8m/iW1SJ6SENhsSkSqH/QwKZyddqxxmNnf4QIaFhm0yPBKO4D05J1eBZMr9LISWEl6gM0iA0U8YfZUUKtpyFf5jTew+Jcz8dRNs+uZTEis= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b7490ed3-6e86-49dc-3b87-08d74f5b08f1 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:50.8638 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: M4VYQWLxbxu2EVPmUTT877oKD4tPKVd0rwWRlz6+luTN4wS7a6KlB6bt3+lvWdbia+QhTAR090KMaiB3e9BU8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sat, 12 Oct 2019 21:28:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sat, 12 Oct 2019 21:28:29 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSUo3006060 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 11/72] multipath tests: alias: add tests for allocate_binding() 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sat, 12 Oct 2019 21:31:06 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- tests/alias.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/tests/alias.c b/tests/alias.c index 32fdc697..170ebbeb 100644 --- a/tests/alias.c +++ b/tests/alias.c @@ -5,6 +5,7 @@ #include "util.h" #include "alias.h" #include "test-log.h" +#include #include "globals.c" #include "../libmultipath/alias.c" @@ -30,6 +31,36 @@ char *__wrap_fgets(char *buf, int n, FILE *stream) return buf; } +static int __set_errno(int err) +{ + if (err >= 0) { + errno = 0; + return err; + } else { + errno = -err; + return -1; + } +} + +off_t __wrap_lseek(int fd, off_t offset, int whence) +{ + return __set_errno(mock_type(int)); + +} + +ssize_t __wrap_write(int fd, const void *buf, size_t count) +{ + check_expected(count); + check_expected(buf); + return __set_errno(mock_type(int)); +} + +int __wrap_ftruncate(int fd, off_t length) +{ + check_expected(length); + return __set_errno(mock_type(int)); +} + static void fd_mpatha(void **state) { char buf[32]; @@ -577,6 +608,98 @@ static int test_rlookup_binding(void) return cmocka_run_group_tests(tests, NULL, NULL); } +static void al_a(void **state) +{ + static const char ln[] = "MPATHa WWIDa\n"; + char *alias; + + will_return(__wrap_lseek, 0); + expect_value(__wrap_write, count, strlen(ln)); + expect_string(__wrap_write, buf, ln); + will_return(__wrap_write, strlen(ln)); + expect_condlog(3, "Created new binding [MPATHa] for WWID [WWIDa]\n"); + + alias = allocate_binding(0, "WWIDa", 1, "MPATH"); + assert_ptr_not_equal(alias, NULL); + assert_string_equal(alias, "MPATHa"); +} + +static void al_zz(void **state) +{ + static const char ln[] = "MPATHzz WWIDzz\n"; + char *alias; + + will_return(__wrap_lseek, 0); + expect_value(__wrap_write, count, strlen(ln)); + expect_string(__wrap_write, buf, ln); + will_return(__wrap_write, strlen(ln)); + expect_condlog(3, "Created new binding [MPATHzz] for WWID [WWIDzz]\n"); + + alias = allocate_binding(0, "WWIDzz", 26*26 + 26, "MPATH"); + assert_ptr_not_equal(alias, NULL); + assert_string_equal(alias, "MPATHzz"); +} + +static void al_0(void **state) +{ + char *alias; + + expect_condlog(0, "allocate_binding: cannot allocate new binding for id 0\n"); + alias = allocate_binding(0, "WWIDa", 0, "MPATH"); + assert_ptr_equal(alias, NULL); +} + +static void al_m2(void **state) +{ + char *alias; + + expect_condlog(0, "allocate_binding: cannot allocate new binding for id -2\n"); + alias = allocate_binding(0, "WWIDa", -2, "MPATH"); + assert_ptr_equal(alias, NULL); +} + +static void al_lseek_err(void **state) +{ + char *alias; + + will_return(__wrap_lseek, -ENODEV); + expect_condlog(0, "Cannot seek to end of bindings file : No such device\n"); + alias = allocate_binding(0, "WWIDa", 1, "MPATH"); + assert_ptr_equal(alias, NULL); +} + +static void al_write_err(void **state) +{ + static const char ln[] = "MPATHa WWIDa\n"; + const int offset = 20; + char *alias; + + will_return(__wrap_lseek, offset); + expect_value(__wrap_write, count, strlen(ln)); + expect_string(__wrap_write, buf, ln); + will_return(__wrap_write, strlen(ln) - 1); + expect_value(__wrap_ftruncate, length, offset); + will_return(__wrap_ftruncate, 0); + expect_condlog(0, "Cannot write binding to bindings file : Success\n"); + + alias = allocate_binding(0, "WWIDa", 1, "MPATH"); + assert_ptr_equal(alias, NULL); +} + +static int test_allocate_binding(void) +{ + const struct CMUnitTest tests[] = { + cmocka_unit_test(al_a), + cmocka_unit_test(al_zz), + cmocka_unit_test(al_0), + cmocka_unit_test(al_m2), + cmocka_unit_test(al_lseek_err), + cmocka_unit_test(al_write_err), + }; + + return cmocka_run_group_tests(tests, NULL, NULL); +} + int main(void) { int ret = 0; @@ -585,6 +708,7 @@ int main(void) ret += test_scan_devname(); ret += test_lookup_binding(); ret += test_rlookup_binding(); + ret += test_allocate_binding(); return ret; } From patchwork Sat Oct 12 21:27:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11186997 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 2AE4514ED for ; Sat, 12 Oct 2019 21:29:21 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 07D57206A1 for ; Sat, 12 Oct 2019 21:29:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07D57206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 33BBF3091782; Sat, 12 Oct 2019 21:29:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 00F066017E; Sat, 12 Oct 2019 21:29:19 +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 B11121803B48; Sat, 12 Oct 2019 21:29:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSTdx006027 for ; Sat, 12 Oct 2019 17:28:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 25FE65D717; Sat, 12 Oct 2019 21:28:29 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx27.extmail.prod.ext.phx2.redhat.com [10.5.110.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C03D5D6A3; Sat, 12 Oct 2019 21:28:29 +0000 (UTC) Received: from m9a0002g.houston.softwaregrp.com (m9a0002g.houston.softwaregrp.com [15.124.64.67]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 996DBA3CD70; Sat, 12 Oct 2019 21:28:26 +0000 (UTC) Received: FROM m9a0002g.houston.softwaregrp.com (15.121.0.191) BY m9a0002g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:47 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:54 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l+SqhnNJkAVjcs+iNMOW3naf1e+M0e9cvX+sAWE26uOPRGD1/U2nqbLNGfuAng8fboKT+A3dKphMocVLQExtIDoiZ83WV7F/WXVshaUUZcCUF06tF2lOasl7bR5SnzKz+Z822AM6oCVuyU+/uvSSsO/k+/svHdgJtsomyfV2Ie58cpCA75DceoGufo5Geaif8pcsm1qYH4sUDEsVqG87XcT1LeZbRAaOnur2EmhQ4a8sdGH0qQwuPAQwwnjPHph/a83m0VaLsMvXKvOvLGgtmm+OIy/ICNX4kPKjegWYmORMroTaKB9gd4FKEBnVTuip1eoXUqGt8C0riEWjUA28jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/1I5s3OF9n5rzA0s2mpe13ab5GIpCFzstQIoVK7Nabw=; b=FIXiNjVFHf+htgs1gR49iMl7n+ebNoXzqild0+guEJ5xVDA03oIPr7pVP//ODBxCIQBjZX6AwjazTvWl3mTAZU51AhLiNu1fOg050bHl2smM3fgO0o3hlJX1k93f78Vz2yam81x1R2jRgcdvBYdNDohKtGmOzExuMkJKBV0+SSxfZIxfpiRoiN1JOpzmzMaMKMkuVh+6gaq9Syp8Oftwr7yKZ+iTGsUh1AFEzpg0mNOGuh7VbaLIlROkzr/G7x7WEerl6SToIrxRc7AttFwnNi8WNhHA7k9SqVcvgfV8O7l5ROVPRGkXDMXn3mKXWlbw80arOggKYrri4xRTwl4Y+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:52 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:52 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 12/72] multipath tests: alias: add format/scan test Thread-Index: AQHVgUPni+wtQF4/DkmCgCxfWlwOTA== Date: Sat, 12 Oct 2019 21:27:52 +0000 Message-ID: <20191012212703.12989-13-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ccc7655e-9e78-46d5-9b8f-08d74f5b09a9 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:983; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: k3hMqwlrI1GzkTZ/wrqzjsVLqDhop7N/QSdU356f/X2tJWAfUUVtyzHHHvOgOqodbIM/ipaNxnzthC4wHmBu0j1+/2w3xqcPzcRPf1cJLaeeOmZgtlhjm/unNVji0I6Q1R1fBKx9dU92lon1SL7JnnlAfraLtEuNYgk9QWOx45bcZWS2mu4LAY1da2OCRO/VW55v0OCnf5P5DKgmr2+ePTTUBtHRBvUjTnsGKo1AH1XVaVk5JFuBFhP7Go0RTL8UOJnRRyTMCn9bCOs0P92JpE3SKPD185N7rtg71l9Zn0ZHODxhOCdoeyBxmZqouzNVyr4+EuvTriuWofSwhJ/UX72txP+SB598hEdVh2+VWfHO8p1fLrz0APOZFBPdBLVOcv4dMS0ZWpzi4zpMhn/M2NfM6c+LU/jq+CFnd20Ull8= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ccc7655e-9e78-46d5-9b8f-08d74f5b09a9 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:52.1821 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: opJssBDFNHVuiFZAPuCIcRASpzKX+C+Eu9KnbFTgLYEiF25ubOM6N5cLG2N2k6QK22ZOKOrqKOpo3bmpNJsNdg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Sat, 12 Oct 2019 21:28:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Sat, 12 Oct 2019 21:28:27 +0000 (UTC) for IP:'15.124.64.67' DOMAIN:'m9a0002g.houston.softwaregrp.com' HELO:'m9a0002g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.67 m9a0002g.houston.softwaregrp.com 15.124.64.67 m9a0002g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.68 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSTdx006027 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 12/72] multipath tests: alias: add format/scan test 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 12 Oct 2019 21:29:20 +0000 (UTC) From: Martin Wilck Test scan_devname(format_devname(id)) == id. Signed-off-by: Martin Wilck --- tests/alias.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/alias.c b/tests/alias.c index 170ebbeb..30414db0 100644 --- a/tests/alias.c +++ b/tests/alias.c @@ -297,6 +297,34 @@ static void sd_max_p1(void **state) } #endif +static void sd_fd_many(void **state) +{ + char buf[32]; + int rc, i; + + for (i = 1; i < 5000; i++) { + rc = format_devname(buf, i, sizeof(buf), "MPATH"); + assert_in_range(rc, 6, 8); + rc = scan_devname(buf, "MPATH"); + assert_int_equal(rc, i); + } +} + +static void sd_fd_random(void **state) +{ + char buf[32]; + int rc, i, n; + + srandom(1); + for (i = 1; i < 1000; i++) { + n = random() & 0xffff; + rc = format_devname(buf, n, sizeof(buf), "MPATH"); + assert_in_range(rc, 6, 9); + rc = scan_devname(buf, "MPATH"); + assert_int_equal(rc, n); + } +} + static int test_scan_devname(void) { const struct CMUnitTest tests[] = { @@ -314,6 +342,8 @@ static int test_scan_devname(void) cmocka_unit_test(sd_max), cmocka_unit_test(sd_max_p1), #endif + cmocka_unit_test(sd_fd_many), + cmocka_unit_test(sd_fd_random), }; return cmocka_run_group_tests(tests, NULL, NULL); From patchwork Sat Oct 12 21:27:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187005 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 0AA7D1709 for ; Sat, 12 Oct 2019 21:29:42 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3716206A1 for ; Sat, 12 Oct 2019 21:29:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3716206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 053463086E2F; Sat, 12 Oct 2019 21:29:41 +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 D91ED60471; Sat, 12 Oct 2019 21:29:40 +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 A65034E58B; Sat, 12 Oct 2019 21:29:40 +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 x9CLSYgr006097 for ; Sat, 12 Oct 2019 17:28:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3E23160BF4; Sat, 12 Oct 2019 21:28:34 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 32F9360BF1; Sat, 12 Oct 2019 21:28:34 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AC00E30B4B02; Sat, 12 Oct 2019 21:28:32 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.146) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:39 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0334.microfocus.com (2002:f78:1192::f78:1192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:54 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SCFAwA00vUqmmYhoWO0RBzUkdAvTJ11psoaLAp/B10E3+8k8k3/ElOPY3sMPb3RVkbnpScnAro+3BEyIGAT2i/widnX2p28afwg3OHhjZ/NTvS52poFzxSncuL9WMqk4InRiVhB5vjGd4LXJg5lLaqoS/bNxxdjX+nPaa0dlgXPF4RGMyJCiwjHhnxxZWdB/vhwv9GUbwKiclyvBy+oXn9Zux26l/oVlO7CwwVO2yhnJjmk90DWr/UnEHZp8POWafcARFoxKo59VHYejY9LYoLswdZOcVU0EivjvdWtPnwzlN01Br5dKzvJ+jfT8WqiG7FuEYEiMiQ9FwwqqLEbcDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VBo01cjmkLbAeIMCj2rJCwRTMbdnK+gWJBSeHAxtAQo=; b=OpDJEldvru35AX/e9z3hHwZ5h+OaIk6Nqm3WdFXDk8dFZdoGXpoUUYuWeQEEn+zwv5B21UJtEamnSII5xxGp9k2ouJmoymg9KdAzKloTXOzAk75QRdnfgnPGq2oOZ4psVECVimiWKpARjUzll16yAfQkeVsYVsFOfnur9jr6wluQ2tzOPXAGYsHBJlrIwKzY14YcTs2ads4jCZOR3xXjuse9CKPw9gQOWqF8QaQnavFKX4QsrIBDx6klMzJ9L2yKxoH5JvZiGYLFcW7/11UruHCsZpm+vScmpwtfXZqeVSd0/pjGE16yCQUNYi13NoLWopLhTwMK0cfekXCMVfFW+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:53 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:53 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 13/72] libmultipath: alias.c: prepare for cancel-safe allocation Thread-Index: AQHVgUPocYwhLMcMeU6z+oLkPaM5Hw== Date: Sat, 12 Oct 2019 21:27:53 +0000 Message-ID: <20191012212703.12989-14-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 24449e7d-0892-4537-6f81-08d74f5b0a74 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:348; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fpgnkQSR/KtrCADpTi2nJqAfuqogz3AdvR+opW/8kN5B0q3mjUJXIwi6Q0xXrMNxHC6N+kDKztFLHZAOhreK+S1jDbufsFQvLCwNVL9rd5BxQB8H1/M9IrKzsxS/NEG4yvO34aYYoI9iceVZr8YbI7MFzWkXEx+vbvHLosPOfei0PfUzxTW0rDrDPB6BuYboMD2ZWnWJBUxAQv5az9VpSUUt9LoIW9yZX1Rsfcffp8l7ZwJyRzzZ1skdOPzk4KBla4q6O4BB5qIJ4G//jU8C4Ov7/Lcl+ARh+VQ0lnb9yox2EJTpR/e06RhYlMirAEfjIoM08938fqXVX7MturUpL/1z5zd5avo/Atc8iyT1kb3tiPv4SZ+4PCnFaWytz6WwG6cO0gD8M2e+r8RJjjwoXcOTHV4PIwnnYTmqBj6BioA= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 24449e7d-0892-4537-6f81-08d74f5b0a74 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:53.4794 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jrxUHBwm7EyfJdMmkjI2TnjPUeD/74pIxYyvqPQZWrnSk+Y4St9qI5YufWp9X7VMgwqlItGPZ2FaO4CdyzLv+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sat, 12 Oct 2019 21:28:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sat, 12 Oct 2019 21:28:33 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSYgr006097 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 13/72] libmultipath: alias.c: prepare for cancel-safe allocation 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sat, 12 Oct 2019 21:29:41 +0000 (UTC) From: Martin Wilck In functions that return newly allocated memory, avoid cancellation points before returning, and if that's not possible, guard the code that contains cancellation points with a cleanup function calling free(), and immediately before returning, call pthread_cleanup_pop(0). Signed-off-by: Martin Wilck --- libmultipath/alias.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/libmultipath/alias.c b/libmultipath/alias.c index 15bbc8ed..0fc9e542 100644 --- a/libmultipath/alias.c +++ b/libmultipath/alias.c @@ -268,13 +268,12 @@ allocate_binding(int fd, const char *wwid, int id, const char *prefix) c = strchr(buf, ' '); if (c) *c = '\0'; + + condlog(3, "Created new binding [%s] for WWID [%s]", buf, wwid); alias = strdup(buf); if (alias == NULL) - condlog(0, "cannot copy new alias from bindings file : %s", - strerror(errno)); - else - condlog(3, "Created new binding [%s] for WWID [%s]", alias, - wwid); + condlog(0, "cannot copy new alias from bindings file: out of memory"); + return alias; } @@ -342,7 +341,9 @@ use_existing_alias (const char *wwid, const char *file, const char *alias_old, } out: + pthread_cleanup_push(free, alias); fclose(f); + pthread_cleanup_pop(0); return alias; } @@ -378,18 +379,19 @@ get_user_friendly_alias(const char *wwid, const char *file, const char *prefix, return NULL; } + pthread_cleanup_push(free, alias); + if (fflush(f) != 0) { condlog(0, "cannot fflush bindings file stream : %s", strerror(errno)); free(alias); - fclose(f); - return NULL; - } - - if (can_write && !bindings_read_only && !alias) + alias = NULL; + } else if (can_write && !bindings_read_only && !alias) alias = allocate_binding(fd, wwid, id, prefix); fclose(f); + + pthread_cleanup_pop(0); return alias; } From patchwork Sat Oct 12 21:27:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187077 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 746AC18B7 for ; Sat, 12 Oct 2019 21:33:32 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 519892089F for ; Sat, 12 Oct 2019 21:33:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 519892089F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C32C10DCCA7; Sat, 12 Oct 2019 21:33:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2148F5D784; Sat, 12 Oct 2019 21:33:31 +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 B63151803B4A; Sat, 12 Oct 2019 21:33:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUAII006518 for ; Sat, 12 Oct 2019 17:30:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 354096092F; Sat, 12 Oct 2019 21:30:10 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 717FB608A5; Sat, 12 Oct 2019 21:30:07 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 60419316E535; Sat, 12 Oct 2019 21:30:05 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:27 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:55 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hufGDckSClQSDWilujzKaYmKtsmtNt+t9Sk/03HBTqZCnpGsCfLejowmcdjl014a2B8oBbcdl/RCUd4sMFC4DwAq15OJPvzyZQiyVIaJL0ZPi8UhsAGtE1Wqr7qkXK3SjndX7EJs3xiFdyFl9jk+9FO/SYf6Bd1Dt4lnzAGXDVifO3LhpPGrYnbaoF7DpyYXnve0EyoHpo69vDM4+kMbzKCJ/DW7KUFnxQgW92ABGgqEMd0fHqHCqi20aHlwmFkQqPjVrsfklev8OCF49SYn8RY75qlvrNKA49TtOf1MCiQEu8Pu6Q1HZlMwlxEw90M58K80CSWIS+irlKvFqCexAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GuUutE6yO1Fd1YLeopVVsO8ouk3XxGRq+zUYpiGLXfo=; b=MP2Zc1kmmszDCDyjaCzMDcv/gFwcms8abeP7lbqCQ6VpN/NeguWD+VCXTtdMjS0zRYq3QOYiLeoyE1bY7vyDF45mdXCQPa3n8tEQ6vQ0/ohOreuj+G7qHlW3NSsfP7c3qVMNXOiP/i128kdgUs25jrxEv9MH8pmeq3I9MAv+Yh7ocGGyx1ePsTa1oWJsyTF7pQtRsj9jMB4q2a57GLeYrxmqqAYBYyiOqW9Y7iCuSmtN79owJpNHmabhF1gvZVHiBvOStvzytD1+QSJ7y0yxLWER9x1BWP2xLE4HqHd9m7OsSluiXEaNraziANjYB9p0Zk8KCArsPTFafHS/5uqSig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:54 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:54 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 14/72] multipath tests: use -lpthread for alias test Thread-Index: AQHVgUPo21WZ2c5n+UKwOtczpUMYKA== Date: Sat, 12 Oct 2019 21:27:54 +0000 Message-ID: <20191012212703.12989-15-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8485c3ea-2fa6-4e54-1d05-08d74f5b0b36 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:669; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7/2PvVZZ9eNxeR1/PGGSl4ndyHRW6HS6v3FTphKZ1PgZejqMlmmpSFZG5k7fG5CIiECB7A0c6iaAT0BG/7+dPmlmAZUlhypyPi6NAb1FOFdZVHe+7l2mlW7AVW/OWP7GyZ559pRDc5t7IuDQraZPRyaacN6OJiBkL6V0uUsIrtncotor6BR+8N9CvU3lgILtXUIfnmuM3YLVcSPzfqltkPCztZ1UdWN8lkTWvQ0J/IEr1WuDvFndXyugDKfMeEPR3rP06qyIkNpxFaqmXigiMxp8HGBt5y688Z0iHI3m4Mdl4BV8cJwzta5Y4yRl8mXnjEsjjWsT6TxY+dNgq8NOw9Pt1QKHqi69TlZ4MFkEDbSC1F0GHUTVYe1y26JQMX0CYp/YS+ZrJbp7um4+SF7okCHGSwNZwotASWXUoJM7bvM= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 8485c3ea-2fa6-4e54-1d05-08d74f5b0b36 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:54.7826 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8YBlUB7CIDu039MxG8BRSPqqjAakWzcUADy5b4Ldbm84SPCLVFu/8hGMQ5DxAQAHRC2JOw9xQ25z2AyFds93lg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 12 Oct 2019 21:30:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 12 Oct 2019 21:30:06 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUAII006518 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 14/72] multipath tests: use -lpthread for alias test 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Sat, 12 Oct 2019 21:33:31 +0000 (UTC) From: Martin Wilck This becomes necessary because of the previous patch. Signed-off-by: Martin Wilck --- tests/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Makefile b/tests/Makefile index 0ce318c6..0dce8571 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -29,6 +29,7 @@ blacklist-test_LIBDEPS := -ludev vpd-test_OBJDEPS := ../libmultipath/discovery.o vpd-test_LIBDEPS := -ludev -lpthread -ldl alias-test_TESTDEPS := test-log.o +alias-test_LIBDEPS := -lpthread -ldl lib/libchecktur.so: mkdir lib From patchwork Sat Oct 12 21:27:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187025 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 16E5918B7 for ; Sat, 12 Oct 2019 21:30:46 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E4ED5206A1 for ; Sat, 12 Oct 2019 21:30:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4ED5206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DB6E8316E534; Sat, 12 Oct 2019 21:30:44 +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 B4F3D19C6A; Sat, 12 Oct 2019 21:30:44 +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 80BFC4E58A; Sat, 12 Oct 2019 21:30:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUB9e006537 for ; Sat, 12 Oct 2019 17:30:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id C5CE75D71C; Sat, 12 Oct 2019 21:30:11 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B8F0E5D6A3; Sat, 12 Oct 2019 21:30:11 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C449082DA; Sat, 12 Oct 2019 21:30:09 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:31 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:57 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.11) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X/UIvTlqbAczpYwL45suUoqab2qAojTQ7rdsye80lQefk6LiQruCMvgvZQ19SmSd2W7eUZz6y7JNjJoGbk1cA2wVvzVEh4RU16uNIdghF+ea9ki1wULzbdqnSBXSCQb+9C3WcEg3llmfG16yMqfw1CQGNSDZ8zMk4rtKuV5CFSaTJvPvesb3+Zpdx8LcxITrrP9Lvo/d/MWjPf13Dux0Kz3uWZ294Re0XXiU5xAh1IDiKJ7ngX9xPAYTE+OD5tlPmeYCl/n6FDqFDqsSMzX4HAQlXaJ3kH7jujN6tJU3WuzOFvpMyyNnFCwIKTh2DrDdSZ64yU0jpnkZUUokWR0Eeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vd/2lrKG73GXZdTv0cn8MuznbGImrIrYCLXjnUiyFVk=; b=c1qp8x3TEKu3iv73ChmRTEckSXLgCn6Ocbvp/Cu6/wd4gc1droNvzpQvAzKYJT+SCB82v/2Y5WHYKulg9Q69QcEZIfAfqTpD/UEdD8xFSbkREcLeyjyvIU/3OwqCe/P0KuGFNAXx7n5fGpo0M8Uas+yit9SI3Hlf+qiYNHQV/9Ub1K6JlxCsLvCFouKb3j4p3Z8di65fwirvAehDeouY8REcRH9MpzLzXgRyqU6K7um/vq54VGZ6wkCxcE7bEY0b3KIWRKftqAbnvI/mux+yh79WrwX2daezQPG0Km+MEtgSqgDcahEWm6iIN8kncDNbe4voUErD7PHxZ0QYJgO2zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:56 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:56 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 15/72] libmultipath: path_discovery: handle libudev errors Thread-Index: AQHVgUPpR7Z/P6K5y0qSWZA+rQnfJw== Date: Sat, 12 Oct 2019 21:27:55 +0000 Message-ID: <20191012212703.12989-16-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 63641be2-5064-4beb-d2e0-08d74f5b0bfc x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:313; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: G2Tjxn60BWYNwjBk9lZl0BDZFuj7aO7246GTRpOZ3RE65Znynxeq82PSgtRQmPwoHdY5BaMU+6JQ96/gO5pj29OBsStUk8twrYXKD8C2wLGiEn+mRaajJMNaIFTuPmzKm2gKZFWufu06wTCbGGeVpFHAVBBrrkuI5/LZQq2hGYhC/sOBVa1qB9zmIaX8U3XOpcyIUa6CfbVLCACLxSo0oQm1fTSZC9tCjxsI6qzYVbCeWRTehrGDe6J6KcFdstuHOi5dV6w8B0FzrG0/r6UUpuHcU85j3T34X9cvjiD/wIaT38LrSYcH7zc8s231Wt/ge7LakoPLrMY2QZHtRr3iOJPEnXqchPW5wahbMACcYREtjOvNrYypzVOezYsLPiuY5Cy+XCpAbqG1FVCnaWHZObyhUqWRjMI6p9BHwNBJYMY= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 63641be2-5064-4beb-d2e0-08d74f5b0bfc X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:55.9500 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Fx6ZPMH7zkE+pJGvd/WQZ6M4coaiKxGj5M9V/q+BJTEzh/9V4vSGjGLcWH3VlM4ZRDXzmEMRFfT4QKdkNZhcIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sat, 12 Oct 2019 21:30:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sat, 12 Oct 2019 21:30:10 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUB9e006537 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 15/72] libmultipath: path_discovery: handle libudev errors 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 12 Oct 2019 21:30:45 +0000 (UTC) From: Martin Wilck pass out if any libudev helpers return an error code. Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 72f455e8..e68b0e9f 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -148,15 +148,19 @@ path_discovery (vector pathvec, int flag) struct udev_device *udevice; struct config *conf; const char *devpath; - int num_paths = 0, total_paths = 0; + int num_paths = 0, total_paths = 0, ret; udev_iter = udev_enumerate_new(udev); if (!udev_iter) return -ENOMEM; - udev_enumerate_add_match_subsystem(udev_iter, "block"); - udev_enumerate_add_match_is_initialized(udev_iter); - udev_enumerate_scan_devices(udev_iter); + if (udev_enumerate_add_match_subsystem(udev_iter, "block") < 0 || + udev_enumerate_add_match_is_initialized(udev_iter) < 0 || + udev_enumerate_scan_devices(udev_iter) < 0) { + condlog(1, "%s: error setting up udev_enumerate: %m", __func__); + ret = -1; + goto out; + } udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(udev_iter)) { @@ -180,9 +184,11 @@ path_discovery (vector pathvec, int flag) } udev_device_unref(udevice); } + ret = total_paths - num_paths; +out: udev_enumerate_unref(udev_iter); condlog(4, "Discovered %d/%d paths", num_paths, total_paths); - return (total_paths - num_paths); + return ret; } #define declare_sysfs_get_str(fname) \ From patchwork Sat Oct 12 21:27:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187001 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 64F8776 for ; Sat, 12 Oct 2019 21:29:21 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 430A2206A1 for ; Sat, 12 Oct 2019 21:29:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 430A2206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 mx1.redhat.com (Postfix) with ESMTPS id 0EF4FA3CD6D; Sat, 12 Oct 2019 21:29:20 +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 D9664424B; Sat, 12 Oct 2019 21:29:19 +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 9F4F54E9F2; Sat, 12 Oct 2019 21:29:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSTuq006048 for ; Sat, 12 Oct 2019 17:28:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id D17B5608C2; Sat, 12 Oct 2019 21:28:29 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx18.extmail.prod.ext.phx2.redhat.com [10.5.110.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C9157608A5; Sat, 12 Oct 2019 21:28:29 +0000 (UTC) Received: from m4a0041g.houston.softwaregrp.com (m4a0041g.houston.softwaregrp.com [15.124.2.87]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B849301D671; Sat, 12 Oct 2019 21:28:28 +0000 (UTC) Received: FROM m4a0041g.houston.softwaregrp.com (15.120.17.147) BY m4a0041g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:34 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:27:58 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.11) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:27:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XkDac5CJqRTOGaO1og+J8gAx88HEaXhU+f3/zVPjd4AAuBvecPDg9vDjQAgBjAfJZQZrIYdCNFm+gjLxdSzyntnyRZoi7ciSIr19WvwI9bHaIZLvd/EJAqxRUWBAwNWHf840wFxk2TzPN5M7uV/6y1fW33wDUVkX4TDA8APfYacJqt8wNpf0c9ng55IR+amnmC3ssIAXEGBnDBk+/iF+ZyU1KWq62PRIxggLsyXx4RwirZL/uKKpko58fggiDYFPfchzb12q4ExsZHPttie4AzPIx2F2zTIXTT/xmEW6IIo4Ekp1tnmozeTeMx0LTFbSIFPnHEuN66Du+KE8noGdXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xH7DKghXMUAQsPP05meR5e6gY2G/5HvR++AzbhX/tzw=; b=epGFOvqyc2SKflQx6FEen0b71UxkLkUBQgsBGIIalf/lO7rs/XwGKQQtZ9r3vdMrbouzdKLGBQuA5NmJbbFYUgzcAjX0BgMZkpPYcUQ1z7CQ5An1Lx3HSvda3pwwPR5EWRK9Fug7cICADUnzEgSVD5hkxTETsiN6WmHFwYaeG6pX9TNmI995XJMTA1mBi0kzVUpXvmM+tuy4M3MZ/euktIxFdqtdVBSURNQLoYMS2Abu3gAZPwkhCrc8ntITF3eHNduXQM7EJNIywFRT4On5qULp5fvZs3cQ4X6cB+VBdL/12QOBeI3t/UpTgXKWqAQl/6SeIyhgDQx4xjKtI2+B3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:57 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:57 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 16/72] libmultipath: make path_discovery() pthread_cancel()-safe Thread-Index: AQHVgUPqnzv3jnlGqEilDNHk61rXRA== Date: Sat, 12 Oct 2019 21:27:57 +0000 Message-ID: <20191012212703.12989-17-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 25ce0e5a-06d3-4733-675c-08d74f5b0caf x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1284; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kPNWgCr4RFeQbU3Yu7fi3CMzLaGSA70ke3x02ciVOPN8ngBbtGb1/UmfJG9o4eTVRsrROMWFOjUjL/rSi30XdLfEDzYNHPivCvBkpnPd/dguIBc3voEqq/OqVdpfJaYXpEkeKicAAU1k1AYXNrhUmubTjoRIBS0f71NbCVRh2qr5FMvjstBCZ0luDXL75recWHJuLfn783UCYcJK5MxC2lP8RnGDFdgE7N/6V1CilP3B6rivb62lHTIfn9U22vWkvVo8xOFJ7g2kHHUK3PtErdYdc1jyY7hinIpZttaPAJJlQf1YT4wJdckHHZEMwevJ1sjiJPWZzYuQqwQkg8rRvvxjfYzG9PlRtCpcqiotzwb87PKFDA4ih+jfhXITpuZFJWt30jUFiud6FqmPVdAD0gaibF4NTeLL4fz9x2wad+Q= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 25ce0e5a-06d3-4733-675c-08d74f5b0caf X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:57.1353 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: iIbYILz/EZ1DhTOXTAv2amjc8WY69rXZOESeec/zjYuupGK2lDP2ZjZOBpOFIvGoh4RyhTAQ6+G9mWIA2Avs4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sat, 12 Oct 2019 21:28:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sat, 12 Oct 2019 21:28:29 +0000 (UTC) for IP:'15.124.2.87' DOMAIN:'m4a0041g.houston.softwaregrp.com' HELO:'m4a0041g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.87 m4a0041g.houston.softwaregrp.com 15.124.2.87 m4a0041g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.47 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSTuq006048 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 16/72] libmultipath: make path_discovery() pthread_cancel()-safe 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Sat, 12 Oct 2019 21:29:20 +0000 (UTC) From: Martin Wilck The udev_enumerate and udev_device refs wouldn't be released if the thread was cancelled. Fix it. Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 51 +++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index e68b0e9f..d217ca92 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -140,19 +140,47 @@ path_discover (vector pathvec, struct config * conf, return pathinfo(pp, conf, flag); } +static void cleanup_udev_enumerate_ptr(void *arg) +{ + struct udev_enumerate *ue; + + if (!arg) + return; + ue = *((struct udev_enumerate**) arg); + if (ue) + (void)udev_enumerate_unref(ue); +} + +static void cleanup_udev_device_ptr(void *arg) +{ + struct udev_device *ud; + + if (!arg) + return; + ud = *((struct udev_device**) arg); + if (ud) + (void)udev_device_unref(ud); +} + int path_discovery (vector pathvec, int flag) { - struct udev_enumerate *udev_iter; + struct udev_enumerate *udev_iter = NULL; struct udev_list_entry *entry; - struct udev_device *udevice; + struct udev_device *udevice = NULL; struct config *conf; - const char *devpath; int num_paths = 0, total_paths = 0, ret; + pthread_cleanup_push(cleanup_udev_enumerate_ptr, &udev_iter); + pthread_cleanup_push(cleanup_udev_device_ptr, &udevice); + conf = get_multipath_config(); + pthread_cleanup_push(put_multipath_config, conf); + udev_iter = udev_enumerate_new(udev); - if (!udev_iter) - return -ENOMEM; + if (!udev_iter) { + ret = -ENOMEM; + goto out; + } if (udev_enumerate_add_match_subsystem(udev_iter, "block") < 0 || udev_enumerate_add_match_is_initialized(udev_iter) < 0 || @@ -165,6 +193,8 @@ path_discovery (vector pathvec, int flag) udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(udev_iter)) { const char *devtype; + const char *devpath; + devpath = udev_list_entry_get_name(entry); condlog(4, "Discover device %s", devpath); udevice = udev_device_new_from_syspath(udev, devpath); @@ -175,19 +205,18 @@ path_discovery (vector pathvec, int flag) devtype = udev_device_get_devtype(udevice); if(devtype && !strncmp(devtype, "disk", 4)) { total_paths++; - conf = get_multipath_config(); - pthread_cleanup_push(put_multipath_config, conf); if (path_discover(pathvec, conf, udevice, flag) == PATHINFO_OK) num_paths++; - pthread_cleanup_pop(1); } - udev_device_unref(udevice); + udevice = udev_device_unref(udevice); } ret = total_paths - num_paths; -out: - udev_enumerate_unref(udev_iter); condlog(4, "Discovered %d/%d paths", num_paths, total_paths); +out: + pthread_cleanup_pop(1); + pthread_cleanup_pop(1); + pthread_cleanup_pop(1); return ret; } From patchwork Sat Oct 12 21:27:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187021 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 82FE914ED for ; Sat, 12 Oct 2019 21:30:45 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 60121206A1 for ; Sat, 12 Oct 2019 21:30:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60121206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A8D7FC053FDF; Sat, 12 Oct 2019 21:30:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 790B360629; Sat, 12 Oct 2019 21:30:44 +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 47580180B76F; Sat, 12 Oct 2019 21:30:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSQEU006002 for ; Sat, 12 Oct 2019 17:28:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 696435D71C; Sat, 12 Oct 2019 21:28:26 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx18.extmail.prod.ext.phx2.redhat.com [10.5.110.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F9715D6A3; Sat, 12 Oct 2019 21:28:26 +0000 (UTC) Received: from m9a0002g.houston.softwaregrp.com (m9a0002g.houston.softwaregrp.com [15.124.64.67]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 501A630ADBAF; Sat, 12 Oct 2019 21:28:25 +0000 (UTC) Received: FROM m9a0002g.houston.softwaregrp.com (15.121.0.190) BY m9a0002g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:46 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:03 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dkR5cN6z3KUUHpjndvyEEDCq8g92Z7Zu7LJxvW8r2hRyxgLJO9kLhC0810Xoy0yoB977OXbu6kxA/5sTbOIvkJQ8N1yF5Fjs0SozuV6M7H/AUD1Rl0i4KM96uitYqsEClt95CpdWPZJU7akPqD+YjCxede2ry9Eu3HtGILswol3DV1oNJvZJ3ZW5Cpc+klsNOXhrzz98X8pErMVa5xI6MaBrGQUiJ5k+Dcr4TbhuCVVnoLM1GYJyC09zDqFRt2yBJ6Qr4IxxAbig7fXLfY6Y95QzGP3nylwsq+uQukv0uhbQs+rS6bpa/oxEj7lb8ANTYabxgou1aYvBd0I03aN6EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OHFat1GuFXEDHr7G3//pvI57Vc1EElq1bP7aD6mCdCg=; b=mq35vmSg4PQVONCUjXlnCS7wDtokhXy7xluseNQDh3Ro6vUtwKQroidu1dHZU08yJIaSq/KwAhAYDgllXz/6rwQdDwY8Y1eq5VVX9cxccr19nuEkkc8KBYGuEuFGMBNZ1w7zL/XPNRAqiLZ9WC/rR49lBZyHfbYt6yEI+jOWbZcgLshXh2Kcjh9BeTCvd9f+PgFsm7zml53+kEQMNeF+lb7Yt1seHdKpNEzqizkOueTdfm6/zqMFsNbpIxz8+y422562iH1GLYiwMw/ZY+RXYjoodCqnvuS9g6oOjyQNs6X4fkK0Md+nH2H4DmsZvWK3ceaKXZfv1yWk+UDC8ihpVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:58 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:58 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 17/72] libmultipath: uevent_listen(): fix poll() retval check Thread-Index: AQHVgUPrY7KFvL+IXke8okcJ6XDuOw== Date: Sat, 12 Oct 2019 21:27:58 +0000 Message-ID: <20191012212703.12989-18-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a1fc9d71-b7da-4dcc-938c-08d74f5b0d64 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:346; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gcXyWknixZqv/dqrUTFZuEAI1EMUhaPa6CUPfSyVL2XTGXpJYmIxCFrn85lAnk8WRducHDVhuUfVRNYXrBWbCjtehN271VHqGlyjLhdyxyQLLcmFJenXlki+shDB5R8N9Q7tEyfFCKOCU01e+cVmyUNCLHT6AzhAEav8o7U5xe73Dpfsny8ssYFMh4uJo6Lce8mPSZ7l8bIrhHh97WBrp0WWBlZ5Q6bfIChugpDpaONJJnqQNnFMrIszp7cWCXaAaeL1p0qalyijWFgGosg9zehGdnvHvVjpi29DLVbkJTty+wOtvGoLWUzdTDFpPspX2/KIkgIXKqXTpU1wAif+XU9sw3G6+Pb4SBDwEeTJ/NO7Q1WNIRcc7wrW9iW7s+SYBvEnoOkm/FoaelJtxKTwTJbpYvvPndFuMuieerSdocQ= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a1fc9d71-b7da-4dcc-938c-08d74f5b0d64 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:58.4426 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5F5u5Puk0hJAV2eZ4CPVQm88mAKAVwkk7tCj1zJCqm3z7c0ZCP9a1dvOQ6ikheY2TNxbHlNsWvAMZRVUtYo1Tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sat, 12 Oct 2019 21:28:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sat, 12 Oct 2019 21:28:25 +0000 (UTC) for IP:'15.124.64.67' DOMAIN:'m9a0002g.houston.softwaregrp.com' HELO:'m9a0002g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.67 m9a0002g.houston.softwaregrp.com 15.124.64.67 m9a0002g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.47 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSQEU006002 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 17/72] libmultipath: uevent_listen(): fix poll() retval check 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 12 Oct 2019 21:30:45 +0000 (UTC) From: Martin Wilck Only check revents if poll() returns a positive value. Signed-off-by: Martin Wilck --- libmultipath/uevent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/uevent.c b/libmultipath/uevent.c index 8f7b2ef5..f128ced2 100644 --- a/libmultipath/uevent.c +++ b/libmultipath/uevent.c @@ -853,7 +853,7 @@ int uevent_listen(struct udev *udev) poll_timeout = timeout * 1000; errno = 0; fdcount = poll(&ev_poll, 1, poll_timeout); - if (fdcount && ev_poll.revents & POLLIN) { + if (fdcount > 0 && ev_poll.revents & POLLIN) { timeout = uevent_burst(&start_time, events + 1) ? 1 : 0; dev = udev_monitor_receive_device(monitor); if (!dev) { From patchwork Sat Oct 12 21:27:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187007 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 17F1314ED for ; Sat, 12 Oct 2019 21:29:42 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E81312089F for ; Sat, 12 Oct 2019 21:29:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E81312089F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E89D118CB914; Sat, 12 Oct 2019 21:29:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C7EE95C3F8; Sat, 12 Oct 2019 21:29:40 +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 9111F180B76F; Sat, 12 Oct 2019 21:29:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSTOd006053 for ; Sat, 12 Oct 2019 17:28:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id E5C44608C2; Sat, 12 Oct 2019 21:28:29 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx22.extmail.prod.ext.phx2.redhat.com [10.5.110.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB9CB6092F; Sat, 12 Oct 2019 21:28:29 +0000 (UTC) Received: from m9a0002g.houston.softwaregrp.com (m9a0002g.houston.softwaregrp.com [15.124.64.67]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AEFEB18CB911; Sat, 12 Oct 2019 21:28:28 +0000 (UTC) Received: FROM m9a0002g.houston.softwaregrp.com (15.121.0.190) BY m9a0002g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:49 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:04 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y/EeVZxNkcI42IzLXCx0j4ThfrR4dmaAjBRLR6nonXeCoHXB2gEmdkIOSBBkQeZn8azTrWNET1ESYIOjf0KICCyrXwBWyl/4hQzqP4QHXiu+peKIoaw8dSzTbpSuE+Hujqxitdop1gss5lp3mlTnqup5FsgJOROsGWLnPc1pJrDbupdUMdr4p2WNn8+utdCwKC3sEMov034QqvrRGCYH7n/MOmxqBpJ+tiQeCW284XvdGR/Vv+uofzaQ2ZFZ2nWZsDT4HGBdMPMH7Ak/AWN3pT7WcnAHNWtCkPZYTKM3pmGiApyWkTy/IEXwbjclSX/JA94Ejl4I+7jnmanK14cOug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PehmhR5xseIHIlbqwiI3iTUfHqlApcH5xM0DvPlaRlU=; b=kaBysfyRz8l9wF7p7gwI0QkiIKu2SKKjRc/yalAoebA9UPHPwoLBnAG4aMDLuF88RROZVCLXHFxjHD11t8mIJpHm6c5fkZW3AcHHgQpbwUG2YRXQj0T+smOSABomvzEUxCqBzGXkl+EleUAaGX2fVc1gk+d0QSePK9kEOVRNPW3yBowqFPS1Oj2g4YUc2nOYv74CADS/IwqZV3tYlXtLH6vuSiCcSkwkWhMAYPnpRNXmNT0q2DAMg2IK7ZftmlcinPRRgXm7ZIcebV3jM9PcWUt1mCnTgLI9uA/+YApa+EmpGYTO6O6rp7TjXPgeCGuQXPuUExG6hvDhjFnrYfJT+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:27:59 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:27:59 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 18/72] libmultipath: replace_wwids(): fix possible fd leak Thread-Index: AQHVgUPr6yMRc5vuHES2mGT1672frg== Date: Sat, 12 Oct 2019 21:27:59 +0000 Message-ID: <20191012212703.12989-19-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bf147db9-1736-42c9-f25d-08d74f5b0e2e x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2582; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xYan9guyW6/UPvlZFuj08HcAq4oa6ONb4Ovb0R5GTyluUOQGCD/Pyq4fs+u2be5cv9wHnSgud3DXKABsdBNRs4sa3WG1FRdejJiDFu9HdoSIfhsxuN8m/ON51p2MofhJAHIbb8XJnExbod9B9irXa+VwvD/sc49vnVKLNHXn/TFI+3EucwsJLr7HnBmOtbrawpjNRlS1vtvIQ25TQzb4oYmAPeym2dlt/m/loY01f3s/EvvYBTbmLYSXuszMscApuAxUePR6EHCFPBoNHucpG8KQXirAr53Je7YhPuNCl1Qc/ThX61HvrH4yAZkK6nHzfUtWE6V84J18mDQPbCQ8Wv0Vs+zUEPL0f16ZjV4wastBVti5VFEQl2JZqNCwqKqy54TnlP+qfv9407NfZTO794O1EPh4tSr3g6Ue2o0ovLg= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: bf147db9-1736-42c9-f25d-08d74f5b0e2e X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:27:59.7618 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: svap+4W4U+J0jwzNti2OBa9u+zT9RWTpWfqNix5m0gZVTaJCeQ6T+o0ffSRDDwP77eEQCMYMAXcUrEJnjpjv9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Sat, 12 Oct 2019 21:28:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Sat, 12 Oct 2019 21:28:29 +0000 (UTC) for IP:'15.124.64.67' DOMAIN:'m9a0002g.houston.softwaregrp.com' HELO:'m9a0002g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.67 m9a0002g.houston.softwaregrp.com 15.124.64.67 m9a0002g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.63 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSTOd006053 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 18/72] libmultipath: replace_wwids(): fix possible fd leak 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Sat, 12 Oct 2019 21:29:41 +0000 (UTC) From: Martin Wilck ... in case the thread is cancelled. Signed-off-by: Martin Wilck --- libmultipath/wwids.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c index ef748125..f69ed6f5 100644 --- a/libmultipath/wwids.c +++ b/libmultipath/wwids.c @@ -7,6 +7,7 @@ #include #include +#include "util.h" #include "checkers.h" #include "vector.h" #include "structs.h" @@ -87,7 +88,8 @@ write_out_wwid(int fd, char *wwid) { int replace_wwids(vector mp) { - int i, fd, can_write; + int i, can_write; + long fd; struct multipath * mpp; size_t len; int ret = -1; @@ -99,6 +101,8 @@ replace_wwids(vector mp) pthread_cleanup_pop(1); if (fd < 0) goto out; + + pthread_cleanup_push(close_fd, (void*)fd); if (!can_write) { condlog(0, "cannot replace wwids. wwids file is read-only"); goto out_file; @@ -132,7 +136,7 @@ replace_wwids(vector mp) } ret = 0; out_file: - close(fd); + pthread_cleanup_pop(1); out: return ret; } From patchwork Sat Oct 12 21:28:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187015 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 014CC14ED for ; Sat, 12 Oct 2019 21:30:25 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D1FE1206A1 for ; Sat, 12 Oct 2019 21:30:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1FE1206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C879300157A; Sat, 12 Oct 2019 21:30:24 +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 DD47A60468; Sat, 12 Oct 2019 21:30:23 +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 999EC4EBC0; Sat, 12 Oct 2019 21:30:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSYYF006103 for ; Sat, 12 Oct 2019 17:28:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id CFA286031D; Sat, 12 Oct 2019 21:28:34 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx28.extmail.prod.ext.phx2.redhat.com [10.5.110.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 568D56017E; Sat, 12 Oct 2019 21:28:33 +0000 (UTC) Received: from m9a0002g.houston.softwaregrp.com (m9a0002g.houston.softwaregrp.com [15.124.64.67]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2FD20883858; Sat, 12 Oct 2019 21:28:32 +0000 (UTC) Received: FROM m9a0002g.houston.softwaregrp.com (15.121.0.190) BY m9a0002g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:53 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:04 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OUusrqv18phASB2JhIK7RRuSDiZDZLC7FDSlhTRawmdxhXx69eV7nfpu9w4ytKTguLhIOpbE5fzr2XRE29LGXCCYAYbWqRHJI04COFWhRat8C4FAo8V0ctWq9PB697YQFG0LCF7LtDyD2f8YA9klUop81UwKT3fTZkNEtNTLJpvPt0kEZY5GrgWJS6pw0mMb8ZeO0v32fUc6Qf8hNTsjNRwo/XkHkN6ptiy0aunxO6gZjsXGPEFac3YN3k6WOtZAZRiYCQqWlyORphDfnjGfbPZeYPKXHMSZDmXG2wUU3ypeAkc5ANw83DfJIyrUh4rHKNULS6UatQlXdsXqug1hIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0IGYyKs1FB/oykR2Scj9xXtuYX8go0qwXMDhSF3k2W4=; b=FNe/IvPKk9VFYdbDbvmojAHW/05/Ax664UQ6VlN7Z85Q+69/gZ7Un2k3AaC08z4MzwaE4Nq5R/OI6d7o+se+kwB7r5Ea1sPSFGXPeAdjAAqB95IziDy2Snwa2fDb7ilozlaVvkGB+PCHfF1UGQIj38YgJug39FPfx8gfppGBnyuK0jdvo+BP8Zt+5xidAVgKzo1qrkZLD06gKiMoq6Aq6CKvSLJdVEtEJdb3WACiXVl2Qr6vGV90zFGFwkBHdvo/1CPG7/6Nik6BBkllzlRI5tM34EdUIsZnwUm0IJjlCwLLl/xu+JQdyL4nxmS7W4n/LgLkS8tHpAdUkFINJezbHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:01 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:01 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 19/72] libmultipath: remove_wwids(): fix possible leaks Thread-Index: AQHVgUPsWMMnM1T/rEmvQ3bRTwvVdQ== Date: Sat, 12 Oct 2019 21:28:00 +0000 Message-ID: <20191012212703.12989-20-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ab3137ea-4dce-44dd-4cb4-08d74f5b0efb x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:120; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QsFEPVI6BadBDa14V+Hibd6HVkGcSc9BQPCVF0WHYwipxAXTbeITOxPDaqu0N1xaeWjxWGBR9oTACi74aUiM8d6abQf6oMv+ubl7dCqgb7bJUcTEW4ZvsQ++xPwTErX2cCyn5lmpsmsmMTvVMFLe8TT5PInKuyO8bOTutHSt9dz5khjQMXLjsa7TNqOj+XGhCrZ3Kfeobgp2a37gV0pnFsGjLWwJqT005MSog5QAsbHM8kLLwWfY0/X3EZjZoPMU+bT6BWJ5PsjVu3a2fdYBsd3H0OiE0D9RiO89qTG3vc5bTr903+MRCMmmwfPY058yc40Eg3giSWJmLyhNDgNDqL1Owv4OpUXMh1nKUnUuzonZHr+TACNCdpZBYnmAs8W7dgduYNWjfyiK2Qq9NxUNRCLiALDjtxptea67JVBuJFw= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ab3137ea-4dce-44dd-4cb4-08d74f5b0efb X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:00.9981 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: /rsQI7NbjEOCJVGMuOpHx2YvFy/vaUc1Qpti23yYdb7iIdwgnOB7kbFo1bGsi21U4dp2wi9mPqc1OojYjk7IaA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Sat, 12 Oct 2019 21:28:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Sat, 12 Oct 2019 21:28:32 +0000 (UTC) for IP:'15.124.64.67' DOMAIN:'m9a0002g.houston.softwaregrp.com' HELO:'m9a0002g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.67 m9a0002g.houston.softwaregrp.com 15.124.64.67 m9a0002g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.69 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSYYF006103 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 19/72] libmultipath: remove_wwids(): fix possible leaks 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sat, 12 Oct 2019 21:30:24 +0000 (UTC) From: Martin Wilck ... of fd and memory. Signed-off-by: Martin Wilck --- libmultipath/wwids.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c index f69ed6f5..d02a7072 100644 --- a/libmultipath/wwids.c +++ b/libmultipath/wwids.c @@ -195,7 +195,8 @@ do_remove_wwid(int fd, char *str) { int remove_wwid(char *wwid) { - int fd, len, can_write; + long fd; + int len, can_write; char *str; int ret = -1; struct config *conf; @@ -207,8 +208,10 @@ remove_wwid(char *wwid) { strerror(errno)); return -1; } + pthread_cleanup_push(free, str); if (snprintf(str, len, "/%s/\n", wwid) >= len) { condlog(0, "string overflow trying to remove wwid"); + ret = -1; goto out; } condlog(3, "removing line '%s' from wwids file", str); @@ -216,18 +219,22 @@ remove_wwid(char *wwid) { pthread_cleanup_push(put_multipath_config, conf); fd = open_file(conf->wwids_file, &can_write, WWIDS_FILE_HEADER); pthread_cleanup_pop(1); - if (fd < 0) + + if (fd < 0) { + ret = -1; goto out; - if (!can_write) { - condlog(0, "cannot remove wwid. wwids file is read-only"); - goto out_file; } - ret = do_remove_wwid(fd, str); -out_file: - close(fd); + pthread_cleanup_push(close_fd, (void*)fd); + if (!can_write) { + ret = -1; + condlog(0, "cannot remove wwid. wwids file is read-only"); + } else + ret = do_remove_wwid(fd, str); + pthread_cleanup_pop(1); out: - free(str); + /* free(str) */ + pthread_cleanup_pop(1); return ret; } From patchwork Sat Oct 12 21:28:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187055 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 7BA0D1668 for ; Sat, 12 Oct 2019 21:32:09 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 594482089F for ; Sat, 12 Oct 2019 21:32:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 594482089F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 751FB7FDF0; Sat, 12 Oct 2019 21:32:08 +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 4C9EC601B3; Sat, 12 Oct 2019 21:32:08 +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 14AB44EE69; Sat, 12 Oct 2019 21:32:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.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 x9CLTGQQ006282 for ; Sat, 12 Oct 2019 17:29:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id CAE4D1001B07; Sat, 12 Oct 2019 21:29:16 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 384DF1001B08; Sat, 12 Oct 2019 21:29:14 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B3900300BEAC; Sat, 12 Oct 2019 21:29:12 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.146) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:28:19 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0334.microfocus.com (2002:f78:1192::f78:1192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:05 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UOH0JBkuNO7ZQJxcBTBT2ibj6mRFKC1rUiApvRdOkVP9F5wNSGZ//lIO5J8iA9DxXApueSHSGtkHNaKsSyzfo2JL1z884fFs/QQ7b1ilUuQ7ODXGe+ByyWhq/JHhKijRO+rvmURWIhS5gI23BiRElDEKxa5itgBs4Hk0HmprEJKJLwLjvIjZOlVPzRI/DHLiTIZ8vmJejcOU0ODFheu+aEBBSRacmxk3cI+3zPrx+YAhRn0uWMcZwbGcIrPVg5C5/8Ko1J9v/ewDDLXdCRUx+A2SFHsQwoVb3lEsRq54e6Cm/URQarOMOHJ/JgoNZcH7k401dMi4n9NwmM3nu3foCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2DBGCrnJN/46u/YWt0oVwUd1qjTfjFNkmkr37gsXVpY=; b=etDE7uQ9Ss9ihi8xqsMMjRbnHF5zgWc0cZE10bn92s55xIGdzE48yN+0niJX3zhyX0rUNcCzDXvG5ILsmGe10THip1kvGxLp4/aJG3Z4m6hn3Fa/lU5hFKmDlnGar0jf94R8fUf5cA0l/qo/UvkpLgc0cZ+e3ZQ0YYqqyT3i1SKzfdx2oWft/KnVl/Vr2SH/bMR85w1DCfdnxyxEtMZJ4neh4titkWm37wbPmh/ho/bgAt/Zk+kCuAfYiWKw+70wLL7qJ++4Olp7Fu3nxGoFz76tPzE1Qy0kcJR/8pHrjlzGbZUNwmkw2UoBi76OnAfWOv4Cm4dmPQngn91vja1B4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:02 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:02 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 20/72] libmultipath: _init_foreign(): fix possible memory leak Thread-Index: AQHVgUPtYZZkDLBj+EW4dhojrwgACw== Date: Sat, 12 Oct 2019 21:28:02 +0000 Message-ID: <20191012212703.12989-21-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 100ce104-ab6d-4d91-3c15-08d74f5b0fb1 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:109; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(1496009)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9Y0SuidAt9FBGbzwYwtP7SKHBycQ14pJy7o7PwI+0FPgXflR21cVlqlEVGQJe2mt7zNpVEdpY0bcfoX+qa2gL3FNJFWPOlPqkHJQ9OsyuBr0EwLQJutMJIUq83c/u0zOwE9WTE+8PHHbtIBdyWTBkO20DQgxXVINy+bD6tiEoHQwZ+ubIT6V2sNRYDXvTYb66rN5wNLvf713q+IKWVJmazG82Gc23PuMYYrlcfjKm1b3tL1UJGJT3V664h6vAjWfmvVVUDqv+Li0XatNospgJcAaTDX8CfbxVqenjD2+uJjvu7Y4kaUebvGNiwm70ka0avEllH9nDj41B4WNjRuKa7JCEDpVDUIluEoVrcgspoUaU5hxOi2L/yPjxKYfO4pxq57RycLquliftwfWkr3QpE84M7a84LZmipncEMRg/Wo= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 100ce104-ab6d-4d91-3c15-08d74f5b0fb1 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:02.1645 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 2mYhKe20O9U6BGrHcL7/G69/UedbwFKJ2bKZ0KkGPAycU9oR1hg/JoDsdA2HrKiXKIn0PefYvZOfprmIJck28g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Sat, 12 Oct 2019 21:29:13 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Sat, 12 Oct 2019 21:29:13 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.40 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLTGQQ006282 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 20/72] libmultipath: _init_foreign(): fix possible memory leak 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sat, 12 Oct 2019 21:32:08 +0000 (UTC) From: Martin Wilck free_pre() wasn't called if scandir() failed. Fix it. Signed-off-by: Martin Wilck --- libmultipath/foreign.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libmultipath/foreign.c b/libmultipath/foreign.c index 4b34e141..9ef8ad19 100644 --- a/libmultipath/foreign.c +++ b/libmultipath/foreign.c @@ -148,7 +148,7 @@ static int _init_foreign(const char *multipath_dir, const char *enable) (void)regerror(r, enable_re, errbuf, sizeof(errbuf)); condlog (2, "%s: error compiling enable_foreign = \"%s\": \"%s\"", __func__, str, errbuf); - free_pre(&enable_re); + goto out_free_pre; } } @@ -157,13 +157,13 @@ static int _init_foreign(const char *multipath_dir, const char *enable) if (r == 0) { condlog(3, "%s: no foreign multipath libraries found", __func__); - return 0; + goto out_free_pre; } else if (r < 0) { - r = errno; - condlog(1, "%s: error %d scanning foreign multipath libraries", - __func__, r); + r = -errno; + condlog(1, "%s: error scanning foreign multipath libraries: %m", + __func__); _cleanup_foreign(); - return -r; + goto out_free_pre; } sr.di = di; @@ -249,9 +249,11 @@ static int _init_foreign(const char *multipath_dir, const char *enable) dl_err: free_foreign(fgn); } + r = 0; pthread_cleanup_pop(1); /* free_scandir_result */ +out_free_pre: pthread_cleanup_pop(1); /* free_pre */ - return 0; + return r; } int init_foreign(const char *multipath_dir, const char *enable) From patchwork Sat Oct 12 21:28:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187023 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 9EEAD1709 for ; Sat, 12 Oct 2019 21:30:45 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7C36A2089C for ; Sat, 12 Oct 2019 21:30:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C36A2089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 mx1.redhat.com (Postfix) with ESMTPS id A887A316E52F; Sat, 12 Oct 2019 21:30:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A8891EC; Sat, 12 Oct 2019 21:30:44 +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 595FF180BA9A; Sat, 12 Oct 2019 21:30:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSdNS006139 for ; Sat, 12 Oct 2019 17:28:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 99162F6E1; Sat, 12 Oct 2019 21:28:39 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx30.extmail.prod.ext.phx2.redhat.com [10.5.110.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A16B19C70; Sat, 12 Oct 2019 21:28:37 +0000 (UTC) Received: from m9a0002g.houston.softwaregrp.com (m9a0002g.houston.softwaregrp.com [15.124.64.67]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A8A4A1DB0; Sat, 12 Oct 2019 21:28:35 +0000 (UTC) Received: FROM m9a0002g.houston.softwaregrp.com (15.121.0.190) BY m9a0002g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:56 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:05 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZhLFbAdqnb9A/vcoQP9DnBzDkhNHJNCzYG7OoTilk2QDvs/UoNyoyW6uuRruoiGv5QkREr2MAOpa2B7OUprr90k7VpBGXEokSfrBg2mDeYo4hOGQfO2IzZ7R1dm+96qiuxHQWxAKm5M9+XbuiQk6/iQEa8QVMqiTAC0/r3PU7/ZYLqS/kJ6sPkFyxH67SneGAygkadDgjV8o5rNAbO6ut0LfeSCUIE2V1KNCE8cAlRq++3Wwg2K2DJAjIK11q7VQPe4guKrbbZ1GGhlRWUluGoJzL/OhhKvHegQ7X/I1hxc+8zMfM6352mVR9Ovtcxrp2hwV74PNmjDMiqhKFDNMdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EsZn2fNEJJ86VpaG92OiYpmOQXeGq3FEx6av4yj7XZI=; b=H9PqzWGfSaVVEOZHuYPxfZiLp/KOPhfHfzt7NfXnWk0c9lY3XkI3XT0xTLuMAgW9IMPqZUYnwcksfRHrfOsWUaraEJ79OC7FG7gWjtOoOL0zgCPBdElo1IxN96rX8fOaFBKRLcr+bb1fLYXRgMg8wpLQl6q9Xedgx2pcKWQ26zeg8un8TEsRyDWzwkRqTD780BAW+VrtHqIhKqc3nHXqX9cvmABhLoISi8XgOnso/ahNMj/5YGoI4ly0koV9vzEHx99mWFPxiqEIU39e8OoXbpuX/janNHeM67FUC2gzBfGSGVvBBbM5+I+c04dNb4N7jbPfz5x8jUwZG2wSyslQRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:03 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:03 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 21/72] libmultipath: process_config_dir(): remove unused argument Thread-Index: AQHVgUPuSf8/ntVI/EGpWwboc2+xow== Date: Sat, 12 Oct 2019 21:28:03 +0000 Message-ID: <20191012212703.12989-22-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cabc182b-9750-4603-8281-08d74f5b1063 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(1496009)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UU59VYNG9VQmwyf45i05hlbxMokM/MtqkUCJnDcXAXxi42EWPAQBgAo/pMJuyXN9o+2tBik1dByMPvv76E5jos60QyEzeYBxOt4k41YKPBL0f932RSd3YsP0FHtXNuMEJIeH/+R8QiYZ0RGl0WHJVei1byUzKmN4UJGlDuQVW4OYeirOrBXOFUdpRr7J9wNgMr9S/fkeGtkttxixbWWN3gZaBQvZ8XHZbWJ2wJQogbGCbjTxdXbX7QotjcBGsZEsKTRu3tit1xZfEXu84fCLp0rawQrf+JbBcawiMh8vboPfu8h0dgdtHHgY1Jsebtm2gZgqUoXU8AD0ghQNIh5ZLZy6cDEDfRIIIJqHkgYrr0EckbIKK+OaKz4rJSbaM9n39r1oNBhPUcs/ZSjhpl3BSkpHWSiuyyYnDUkJhSCaI2U= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: cabc182b-9750-4603-8281-08d74f5b1063 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:03.4817 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rVZp6Y/n3nmXQGThakKBfKDn9DdMyoaQpo3Zywa9CkpBabEgGiBEFuKvouChAzisUEihmp8SC+eibD3/nYkasw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Sat, 12 Oct 2019 21:28:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Sat, 12 Oct 2019 21:28:36 +0000 (UTC) for IP:'15.124.64.67' DOMAIN:'m9a0002g.houston.softwaregrp.com' HELO:'m9a0002g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.67 m9a0002g.houston.softwaregrp.com 15.124.64.67 m9a0002g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.71 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSdNS006139 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 21/72] libmultipath: process_config_dir(): remove unused argument 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 12 Oct 2019 21:30:45 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/config.c b/libmultipath/config.c index 20e3b8bf..49723add 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c @@ -644,7 +644,7 @@ free_config (struct config * conf) /* if multipath fails to process the config directory, it should continue, * with just a warning message */ static void -process_config_dir(struct config *conf, vector keywords, char *dir) +process_config_dir(struct config *conf, char *dir) { struct dirent **namelist; struct scandir_result sr; @@ -749,7 +749,7 @@ load_config (char * file) if (conf->config_dir == NULL) conf->config_dir = set_default(DEFAULT_CONFIG_DIR); if (conf->config_dir && conf->config_dir[0] != '\0') - process_config_dir(conf, conf->keywords, conf->config_dir); + process_config_dir(conf, conf->config_dir); /* * fill the voids left in the config file From patchwork Sat Oct 12 21:28:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187037 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 78C3F14ED for ; Sat, 12 Oct 2019 21:31:27 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 51ECC20700 for ; Sat, 12 Oct 2019 21:31:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51ECC20700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 92FAB316E536; Sat, 12 Oct 2019 21:31:26 +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 662A860BF4; Sat, 12 Oct 2019 21:31:26 +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 2D1E14E58C; Sat, 12 Oct 2019 21:31:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSiPK006173 for ; Sat, 12 Oct 2019 17:28:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5FE6A6092F; Sat, 12 Oct 2019 21:28:44 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24F78608A5; Sat, 12 Oct 2019 21:28:42 +0000 (UTC) Received: from m9a0002g.houston.softwaregrp.com (m9a0002g.houston.softwaregrp.com [15.124.64.67]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 591D430BBE82; Sat, 12 Oct 2019 21:28:39 +0000 (UTC) Received: FROM m9a0002g.houston.softwaregrp.com (15.121.0.190) BY m9a0002g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:28:00 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:06 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bRTC1ILE58qcWTCbmbN/H4qWS+PMpF6EEgqY8lJUaDzpjoxN7Id+rG/6kVaAK5NNrPW0eB82U5vHXLXwSmZb+OrK5n5X0faY4JOpw0W/okXF1K9F6gG4xP5PxsS9n4w4fFXGyAqbCj1I/s7ZmGLD7GFd5Bb8YK2thuR9oFuVqMhJDlhAvTVpyURB7K29p3r4tT1ikF+ejaxm4+0dXOJnMQqkQy+BrJwjNODMVCxUxy0DlTY0LV2wy+wy9NsZLKbjZfZERlKc0wHBY+uPJOEbMKsDKRZN+O58H8i4y2FKZzKDo8OTw3+99GuuDULN7TLtgqlrhgpnxLKZx6peCL2ULg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sfK/oHABZ6CG+GkXgadEVaoWjYXtXLZr4WL91GgcgCQ=; b=bzZEV+Kg7RkrEDAso34+Jc0fnG3U44OIItkBKVgXQmSrRg8jsc+vdSHdm6fantYyYdeyIQzrA74YOwsHfMid2aGAwpfjzukByS+XSlpo3hqoC53UhE1KbUJzAmOYWGvleihtJn1/6X22gGQLKuAiGvThlj2g85aHc3UdVxlDYx/Hhp7jbY3gA7dAbPA9aD4G3Y/NlXdPYb5v31/Ttw9BoMpfnd8quxK/7UTEqhpXbr9RZnmrAKZ2u979bU5fOmaCcg+Ej9mQC7YME9hpKmVu5BF/d/uKezHoTmd+tCytqu2DN41AP0w6Bt+iX4VduMf8LIlsj2ZlQuMkfO1By4Mj4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:04 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:04 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 22/72] libmultipath: mark unused arguments in partmap functions Thread-Index: AQHVgUPuHwVUnVeWtUKudHgLXBz+bA== Date: Sat, 12 Oct 2019 21:28:04 +0000 Message-ID: <20191012212703.12989-23-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 18e3ba36-e954-4b12-0860-08d74f5b112e x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:346; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(1496009)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4ArHyLiXy1LM3ZPCc/9Q5lDMyDz6ogG2BPxJuXGThc3sUS4UVWiOp9dpOJPw5Usq/Pjw0FQgWKV0XljCrjqazQC3qDQMqhAzFDvQoLwNo1xoDg7+LP13vPpY3ohKOgZvDdkC6mKwzuyAvED2AhftklZapjZJWigiT2wUU2NM46HvP3JQr9YfObF3rTBsLZHQS1PuknDnqPr0D+OEBEGXGT6zoPaQcTqSzDk7ZNEOhyFmDjyuBogYQTJuebnSKQaN3fGMLki8pyb+OaykTPdbpTAvXXegGzelrSSgUb+k3PfnjkJJu3b5V4UVZ0BnJbNZ8u6tCUi2AY1CP0rb487fl6rxlgTI6FdbJX31AM9EGCkZ99JnQC2qCmrLCkRAZWzCOlII0MxQhseh3XrxuCRYHitJ61OopWmr9UVYqwOdb20= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 18e3ba36-e954-4b12-0860-08d74f5b112e X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:04.7880 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: V3lM38YmbUqBleZbsSl0AVvbFynGQerZAWFIEIT8Qm/L1+27M94j8VQMUTaziE/8GUBF7wKhk2jgZVh7Y4tdbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:28:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:28:40 +0000 (UTC) for IP:'15.124.64.67' DOMAIN:'m9a0002g.houston.softwaregrp.com' HELO:'m9a0002g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.67 m9a0002g.houston.softwaregrp.com 15.124.64.67 m9a0002g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSiPK006173 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 22/72] libmultipath: mark unused arguments in partmap functions 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.41]); Sat, 12 Oct 2019 21:31:26 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/devmapper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index 0f0c3a34..f478ac2d 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -812,7 +812,8 @@ dm_get_major_minor(const char *name, int *major, int *minor) } static int -has_partmap(const char *name, void *data) +has_partmap(const char *name __attribute__((unused)), + void *data __attribute__((unused))) { return 1; } @@ -1308,7 +1309,7 @@ dm_remove_partmaps (const char * mapname, int need_sync, int deferred_remove) #ifdef LIBDM_API_DEFERRED static int -cancel_remove_partmap (const char *name, void *unused) +cancel_remove_partmap (const char *name, void *unused __attribute__((unused))) { if (dm_get_opencount(name)) dm_cancel_remove_partmaps(name); From patchwork Sat Oct 12 21:28:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187073 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 ADE4014ED for ; Sat, 12 Oct 2019 21:33:11 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86AAD20700 for ; Sat, 12 Oct 2019 21:33:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86AAD20700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 70EA28830A; Sat, 12 Oct 2019 21:33:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A57360BF4; Sat, 12 Oct 2019 21:33:10 +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 13BF31803518; Sat, 12 Oct 2019 21:33:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUIh6006573 for ; Sat, 12 Oct 2019 17:30:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 51FE65D9CC; Sat, 12 Oct 2019 21:30:18 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0E725DA5B; Sat, 12 Oct 2019 21:30:15 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 137B8C01DDF8; Sat, 12 Oct 2019 21:30:14 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:35 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:08 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fUsG99JISv75N1VxzXkMnmbKaoUYDvl0zGHPWn2urzqTerYXV03yeMIK+Za8ZwIzIrFBnnEzkjt63nLyaRkoGwSQcrGU9M80URmc1Giraysfd3pSViuqFpeMZhYtEx8DL2eleVWuXpe6mw/B8VwL7jliUS3KD/r0NxO5WCtpfPbuGco+oRRDno9EOy6fN62Hp8F8XdSDDgUctuc8oQXDeKSrvBaXg/idlspBgL+zJiH8iWEpxBzKQIlOyuiZZWRtilgJmHriNJnotZZYIIMWLPJQSSgxKuEapDexMMbIYh+hCrtDzjXAr2ReawfngxoGT/wXCyQ2VJBMWPLDsUAUfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Hr+hBqDNnx7+KgbZGrgcyLoCjglrrvu1iLDoNs+r6lk=; b=C0cGK6yNP+xubCjByjoodT1CIDEA3WhW/3/+Yun2zwgRmbvYtt5+UkoSxLM/3MzgP66acMJpUEVJTOKkz2jk3PTK5yj5dQ01gh7XhDhauRO6vHZUSIWF/qSMcFkVFgZZCS+VMNseZ7ltMIxrZk17RdNwDpWIosO8MhzkGczt7wTIvtV4XfXrlNTbfO5aNPyn92B1HtUVJthln0ReOSirZ90zeBsd6ZAdSssWIqyvRc/nvqipGiLZWe4/lKE2/6LP/qW2rBfVxrmJI+CseNP9vYHY1Scxu84vLlCqnOD00nxoUfOJchCZ+37YNFTCYCxgJgAA1cZOYYQ1BDrCzxrY+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:06 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:06 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 23/72] libmultipath: scsi_ioctl_pathinfo(): remove unused argument Thread-Index: AQHVgUPvghIrB42IdkCiIqQjvw2ykg== Date: Sat, 12 Oct 2019 21:28:06 +0000 Message-ID: <20191012212703.12989-24-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 03f45df0-cc1e-4a1d-85db-08d74f5b11f3 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:181; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(1496009)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lTnD3Y04bGCPBUlJp8szxvmbZ4gGKvk+d5XfqEJiMYZNmfMnNTWeBmp5mFB/P8V8jvFxXFHzAZ0obiPTXqvhfhmVmrXvJ3nZ6y9a5acQ5J+7EyeBclXaYxkscOBm9sxMHtWfAA4Fsobh+gp9zDvWGtzOx4F2np6RLHdIqgAQf3xYyCWTZqqL9Bq10bOUtnMXAmZHMebmkQqWYuojt8sOrwmhdIiLoeqlYlmMiDOkJxCr5pI1e8uDHfpKoP/NvPisfx6Wpt0WOUP3oc8kP5+hiOGaY51lehDryaKc4nVd2PBEBlRjdQvKL9dYRnddhAcxxyxIE/ixEFR1P/w1E0MGxZakCF1Epb55EQF6pUx65EnaTLDriL34fcqTDNvpgQtw57nIJtcxv/C/QvQGU5n5d9UjBqLvryu1/3xG8vf0JqY= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 03f45df0-cc1e-4a1d-85db-08d74f5b11f3 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:06.0943 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cYhiBLbdvjLRo66pJkXMud1HYv9rCP2UC/AZEcdJpsPn3aKaxOU3OpBxY/mKc9OBw3qmyYTfiCEMr5RxinSD/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:30:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:30:14 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUIh6006573 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 23/72] libmultipath: scsi_ioctl_pathinfo(): remove unused argument 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.28]); Sat, 12 Oct 2019 21:33:10 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index d217ca92..4d93c91b 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -1571,7 +1571,7 @@ sysfs_pathinfo(struct path * pp, vector hwtable) } static void -scsi_ioctl_pathinfo (struct path * pp, struct config *conf, int mask) +scsi_ioctl_pathinfo (struct path * pp, int mask) { struct udev_device *parent; const char *attr_path = NULL; @@ -2050,7 +2050,7 @@ int pathinfo(struct path *pp, struct config *conf, int mask) get_geometry(pp); if (path_state == PATH_UP && pp->bus == SYSFS_BUS_SCSI) - scsi_ioctl_pathinfo(pp, conf, mask); + scsi_ioctl_pathinfo(pp, mask); if (pp->bus == SYSFS_BUS_CCISS && mask & DI_SERIAL) cciss_ioctl_pathinfo(pp); From patchwork Sat Oct 12 21:28:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187041 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 18FC61709 for ; Sat, 12 Oct 2019 21:31:28 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA73120700 for ; Sat, 12 Oct 2019 21:31:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA73120700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8DB453091782; Sat, 12 Oct 2019 21:31:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 67E8E60624; Sat, 12 Oct 2019 21:31:26 +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 2DAA01803517; Sat, 12 Oct 2019 21:31:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUJJb006585 for ; Sat, 12 Oct 2019 17:30:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 95EEE60A97; Sat, 12 Oct 2019 21:30:19 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8BD70608C2; Sat, 12 Oct 2019 21:30:19 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 03558308C21D; Sat, 12 Oct 2019 21:30:18 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:39 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:08 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eyXzr1KDdxoqFxCxib24SmWAHtcidswVSLMHTUPmdgkdkDPhmLyoXAAIaO99qAZ5kI74S6kF58928tvC8t+iQVWE6Ehw5vfIiP5fHkn12DI8G6ElfX34I+XBFGqSJI5KpcC/zV640VtnD2PguJrwoFxCa3DsErNLHyikuVJWfqa7C9llyOLcvo5QHtUG8UYxfz1x7zYyFPG34FS7BPrRnbiJwdRqeeMYTBvO92bMZLdUp3P1668xeUh0KdAMreehtt5FsVRD99BfcDxUWq53I7aKxPuu2dmKbBVyIGU/MwxvyE/st3Ua9/O1HqRpk6lLFUDCT7heZz02KhJStU1J8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gZPbyZAMlyXz6JZVzRh+O91rX+gCngSjk/Aw5q5iJBY=; b=PLxNT/R1kPhxm19IA7N/+DyTC5waZtzlh4ceudkZa/nbVGBgWkmTn1AQQkTB5jzpYBig/0y0WXzVH6bHFVb4QpQzqLXxTOKCQg2hQoGxQ8Jlh4LTsVoEny5Gn00gDZLZ+SfZnvyUW1p9zrBOjYXFD15NbBmrVSxzxqcWZpOmPeZhuikSPUqhWnn7oFtzvGf9P23jDIF9HnfFlhv0LY83/czQs/oCDwZDaSo/nDWAm5MiiL/ecIwqy9NQsF15C6a1Ab0vNMe9GWxB+5tpiIuL0jdDdKISbvdFszvVIE5Jn70zkD1vuKsPlL5+YcdXfB7IFtGJIoW9QUX2T6oyPenL6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:07 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:07 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 24/72] multipath-tools: mark unused params in signal and cleanup handlers Thread-Index: AQHVgUPwO6+Sup1NoU+rWOMaFFGDWQ== Date: Sat, 12 Oct 2019 21:28:07 +0000 Message-ID: <20191012212703.12989-25-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a1d2b9ba-8027-4c6b-e4a7-08d74f5b12bd x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(1496009)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ckrd1xoG0pPoTmrt2kjc2V0UJHE5gT6kriXInNhPKLPq334c2HIzJm5Gs2/GvrthVhR03eYwS8CMASE4GOv6sEI3K896iTEfkFHy8jT5bGN62gULEH7NBSUgBqRMydVATChndFbs5ZL/FRZaE7sDoG4vqjY+koPtiPnDwK18BYuUPdPbRsUW7/p+7+8CLglCvaVWvH3kyZhEIptV1NblZ+Gpg8vbL1Z6WMexmJFhn/LF/GSZwsZa4iTK8dRfkDJGkkUjM/Jsxl1YicOlYJxwQYZpUvDxKjElmy4RpUhYErCHGTfXRrrQRh6oBz6W5WtDC99ivOj5oQjfnVOtnCxvbeKET14ulouSGUXKgHiF03svMt81f/nV+SzhuDCb3cjm+Si38hBUiwhgMWKFkESc4x0rt0Ag/h3es0R2lb+jQEQ= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a1d2b9ba-8027-4c6b-e4a7-08d74f5b12bd X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:07.2706 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: MdvbZL+0UEcchdrsLwPVi8mNSjy/wW48rpwCtYJ4eXi5Dkab7KVbW8kSjX6VnG1/jg+ioSKw026ClD1omX9Rdg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sat, 12 Oct 2019 21:30:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sat, 12 Oct 2019 21:30:18 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUJJb006585 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 24/72] multipath-tools: mark unused params in signal and cleanup handlers 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 12 Oct 2019 21:31:27 +0000 (UTC) From: Martin Wilck These parameters are all rightfully unused, yet need to be declared because of the function prototypes. Signed-off-by: Martin Wilck --- libmultipath/file.c | 2 +- libmultipath/foreign.c | 2 +- libmultipath/io_err_stat.c | 4 ++-- mpathpersist/main.c | 2 +- multipath/main.c | 2 +- multipathd/dmevents.c | 4 ++-- multipathd/main.c | 14 +++++++------- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libmultipath/file.c b/libmultipath/file.c index 8727f160..5cb06e1f 100644 --- a/libmultipath/file.c +++ b/libmultipath/file.c @@ -74,7 +74,7 @@ ensure_directories_exist(const char *str, mode_t dir_mode) } static void -sigalrm(int sig) +sigalrm(__attribute__((unused)) int sig) { /* do nothing */ } diff --git a/libmultipath/foreign.c b/libmultipath/foreign.c index 9ef8ad19..f05db162 100644 --- a/libmultipath/foreign.c +++ b/libmultipath/foreign.c @@ -50,7 +50,7 @@ static void wrlock_foreigns(void) pthread_rwlock_wrlock(&foreign_lock); } -static void unlock_foreigns(void *unused) +static void unlock_foreigns(__attribute__((unused)) void *unused) { pthread_rwlock_unlock(&foreign_lock); } diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c index 554b7778..6b3a3e19 100644 --- a/libmultipath/io_err_stat.c +++ b/libmultipath/io_err_stat.c @@ -84,7 +84,7 @@ io_context_t ioctx; static void cancel_inflight_io(struct io_err_stat_path *pp); -static void rcu_unregister(void *param) +static void rcu_unregister(__attribute__((unused)) void *param) { rcu_unregister_thread(); } @@ -689,7 +689,7 @@ static void cleanup_unlock(void *arg) pthread_mutex_unlock((pthread_mutex_t*) arg); } -static void cleanup_exited(void *arg) +static void cleanup_exited(__attribute__((unused)) void *arg) { uatomic_set(&io_err_thread_running, 0); } diff --git a/mpathpersist/main.c b/mpathpersist/main.c index 278b8d51..56761668 100644 --- a/mpathpersist/main.c +++ b/mpathpersist/main.c @@ -50,7 +50,7 @@ struct config *get_multipath_config(void) return multipath_conf; } -void put_multipath_config(void * arg) +void put_multipath_config(__attribute__((unused)) void * arg) { /* Noop for now */ } diff --git a/multipath/main.c b/multipath/main.c index 4f4d8e89..b3f8c99b 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -86,7 +86,7 @@ struct config *get_multipath_config(void) return multipath_conf; } -void put_multipath_config(void *arg) +void put_multipath_config(__attribute__((unused)) void *arg) { /* Noop for now */ } diff --git a/multipathd/dmevents.c b/multipathd/dmevents.c index 00348926..b22b47d2 100644 --- a/multipathd/dmevents.c +++ b/multipathd/dmevents.c @@ -370,12 +370,12 @@ static int dmevent_loop (void) return -1; /* never reach there */ } -static void rcu_unregister(void *param) +static void rcu_unregister(__attribute__((unused)) void *param) { rcu_unregister_thread(); } -void *wait_dmevents (void *unused) +void *wait_dmevents (__attribute__((unused)) void *unused) { int r; diff --git a/multipathd/main.c b/multipathd/main.c index 34a57689..ef128a32 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -215,7 +215,7 @@ static void do_sd_notify(enum daemon_status old_state, } #endif -static void config_cleanup(void *arg) +static void config_cleanup(__attribute__((unused)) void *arg) { pthread_mutex_unlock(&config_lock); } @@ -306,7 +306,7 @@ struct config *get_multipath_config(void) return rcu_dereference(multipath_conf); } -void put_multipath_config(void *arg) +void put_multipath_config(__attribute__((unused)) void *arg) { rcu_read_unlock(); } @@ -1503,7 +1503,7 @@ out: return r; } -static void rcu_unregister(void *param) +static void rcu_unregister(__attribute__((unused)) void *param) { rcu_unregister_thread(); } @@ -2685,25 +2685,25 @@ handle_signals(bool nonfatal) } static void -sighup (int sig) +sighup(__attribute__((unused)) int sig) { reconfig_sig = 1; } static void -sigend (int sig) +sigend(__attribute__((unused)) int sig) { exit_sig = 1; } static void -sigusr1 (int sig) +sigusr1(__attribute__((unused)) int sig) { log_reset_sig = 1; } static void -sigusr2 (int sig) +sigusr2(__attribute__((unused)) int sig) { condlog(3, "SIGUSR2 received"); } From patchwork Sat Oct 12 21:28:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187043 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 19E771668 for ; Sat, 12 Oct 2019 21:31:48 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA9E120700 for ; Sat, 12 Oct 2019 21:31:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA9E120700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1D6E03001FEB; Sat, 12 Oct 2019 21:31:47 +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 ED0135C549; Sat, 12 Oct 2019 21:31:46 +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 B5DA24E58C; Sat, 12 Oct 2019 21:31:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSmpL006190 for ; Sat, 12 Oct 2019 17:28:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 192405C22F; Sat, 12 Oct 2019 21:28:48 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx21.extmail.prod.ext.phx2.redhat.com [10.5.110.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CFEAB5C223; Sat, 12 Oct 2019 21:28:45 +0000 (UTC) Received: from m9a0002g.houston.softwaregrp.com (m9a0002g.houston.softwaregrp.com [15.124.64.67]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7B43918C4272; Sat, 12 Oct 2019 21:28:44 +0000 (UTC) Received: FROM m9a0002g.houston.softwaregrp.com (15.121.0.190) BY m9a0002g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:28:05 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:09 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U+UTqMbf/ckeUjydwrdOS4EknnSCtpJc6wXMPdWh+aIYYpfyrqLVdZbPg9MJZspxrQObbQ4evPl3JliWLNe/U57RQ45g/hyL/y4Db3sPsMmmwH1DHqK6jce5kSBQZpEe/qPOVrbGLqrJk8dL6PI8b18GZRfANr6wPJHZXdiNP6JRYpblS2Cy5buFNUGQbhog8XzdpjzNQ51hsAKsh4D7IreO0VbMMZHb3bh5AjjE4HhoICOq049sqIB+R5NJTgj1JNYNAhB75znr2li7+nx8KtGwj4GNx3NCLpZR8CAwyRwpMqfEgIU7cH7Ukcb68G6jRF7FFo+jYBTPrLEIU6at0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wkP9xFKilVS+dyVz3HpdU1mO6pA1kHXvTMoPUEEp3mM=; b=Vj9mKJ4R7Hlp+DjyLdPutxFKDxi6wxCraYYc+7h2lKbSTVI2YszfgkpDdumj7omwKFXtrVwzVNUtoHqFHwafT6OPAibzD61p993HhjSQdvDY7VBg7+iWeMMN/vSLo6NIeKji61SNdrhddFpGPeuJQRjIAlrHU6sUatTeVkn4qQr+UuK1YmcrKZVRhRSwpnr3EJ6yUN4nSO3HuBgI5HpSEbCgbFRPvDe8myoC4A+b5cUYb+VW97GnhyViN0QwePqZVbXwjw0gCwOTqmZYcoapecVtNJQ/tSYbFHJn9/gdH4pKE1X8wHcKwQGJERDiEYrbcBd94TA7Fl+0aE+uVeVPug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:08 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:08 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 25/72] libmultipath: get_ana_info(): remove unused parameter Thread-Index: AQHVgUPxOxj44m0mE0qtNv7d+42bVg== Date: Sat, 12 Oct 2019 21:28:08 +0000 Message-ID: <20191012212703.12989-26-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c7f54878-3712-4bdc-2f89-08d74f5b136e x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:346; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(1496009)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9KUKpqNX4rML1OPEz6WjZGe5XjuKc1m/UuC8vIgCF1zfnCQrWR5lVW2r8QLKs8xLTEzB/fhfM42hUxxJr72maD3VE5n69KZ9wp27dGVZcaCywqnBy1Z3xxph6dgpHZXsG5Rhx68izCHCN1qm8ioJHH3+g1GUdA2zC7KYM+CGyezdIEwVGJA1Y6pXR4ErpATPMLPnh2xTQmNmlrxuanAO27vWiM7uuDbyIk37QYQdfwBxfs138yavTT4cfJoTteO0UeoL9YwCpsCDUSDnJ99sXYKVE8tfW338sBYYP0gy/2Lbq0o7Ob61rOrDPJkJnHb8FTDz+XJFmko2WbaGf97bSCD4LTGB14pVdO/6fHQcVk2J3x/9Sg1GCtag/Pvugm+JIOvHMix9QIppxcM7+ga3ae80I+MFfzPL1QwalyGHcFU= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c7f54878-3712-4bdc-2f89-08d74f5b136e X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:08.5619 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qNy5FqSx5EnvepCXwzyniYKBtHcrzTsvT9tHrcJlcU5vbKPc98sDt2toP9LMBJm1+9OoMQeY+aj+ySl+Tx6UKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Sat, 12 Oct 2019 21:28:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Sat, 12 Oct 2019 21:28:45 +0000 (UTC) for IP:'15.124.64.67' DOMAIN:'m9a0002g.houston.softwaregrp.com' HELO:'m9a0002g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.67 m9a0002g.houston.softwaregrp.com 15.124.64.67 m9a0002g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.62 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSmpL006190 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 25/72] libmultipath: get_ana_info(): remove unused parameter 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Sat, 12 Oct 2019 21:31:47 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/prioritizers/ana.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/prioritizers/ana.c b/libmultipath/prioritizers/ana.c index 2673d9d9..bcb1dbf8 100644 --- a/libmultipath/prioritizers/ana.c +++ b/libmultipath/prioritizers/ana.c @@ -106,7 +106,7 @@ static int get_ana_state(__u32 nsid, __u32 anagrpid, void *ana_log, return -ANA_ERR_GETANAS_NOTFOUND; } -int get_ana_info(struct path * pp, unsigned int timeout) +static int get_ana_info(struct path * pp) { int rc; __u32 nsid; @@ -209,7 +209,7 @@ int getprio(struct path *pp, char *args, unsigned int timeout) if (pp->fd < 0) rc = -ANA_ERR_NO_INFORMATION; else - rc = get_ana_info(pp, timeout); + rc = get_ana_info(pp); switch (rc) { case NVME_ANA_OPTIMIZED: From patchwork Sat Oct 12 21:28:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187009 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 329EF1668 for ; Sat, 12 Oct 2019 21:30:03 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0E3E8206A1 for ; Sat, 12 Oct 2019 21:30:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E3E8206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DE106801664; Sat, 12 Oct 2019 21:30:01 +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 99ED726170; Sat, 12 Oct 2019 21:30:01 +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 627224E58B; Sat, 12 Oct 2019 21:30:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.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 x9CLSYfC006092 for ; Sat, 12 Oct 2019 17:28:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 08CB310013D9; Sat, 12 Oct 2019 21:28:34 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx29.extmail.prod.ext.phx2.redhat.com [10.5.110.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DA3EC1001B08; Sat, 12 Oct 2019 21:28:33 +0000 (UTC) Received: from m4a0041g.houston.softwaregrp.com (m4a0041g.houston.softwaregrp.com [15.124.2.87]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3BCBB18C8906; Sat, 12 Oct 2019 21:28:32 +0000 (UTC) Received: FROM m4a0041g.houston.softwaregrp.com (15.120.17.147) BY m4a0041g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:37 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:11 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.12) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZHfsYlKD75S3Accoa2IQ6STZH1qKwXKk5wRHV0DkyQw6KCc4BriOXfsGx9CC0GjxfCf2qdekkS95xRqoas50ScEAKu3mnYX7cyZbvOO2ZxDfdPyUymGwYV67xtUtY3TZeD2fGjhtqVU9yDBCuDV6b8EeMFUGw+HwKQLIlN7+TSB1TiPh7riCzru9KfhJ6bxuMPTeuX40ES+LhILsaN6itGTTKlsGyfECEwrUX4xTSMZN/MxoVhgbQtUESNvVaxusxKQI2CnAUpxeEyEI/Z+bWTBcI+LXGocA8HKme1wZaRjDqL9j/aP24MjgRzvITewto6p4jOeEEdt6qufRU4ELRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XJuN81YgPpgmxjV1++nGPz0ex2akbh1bktDr9lp8QvM=; b=dkAP+2Gkw8WSOZUHAimNnaJbWstFn0Ib5cl3s6UGI/fz/kvyGONOyjoF0yebKTgcHJLokjfZm0UZogbfStwy+Kn6Z+9A3g+rN0tKflghuXyf5BjDXwf1KrCqB0sU2hb9WKtRLaNALVklRmMmK9D8XHhGB6SmVUrfMi2MXYUlkzgj97oFQX4Ztpje2zI7I2gHnYtth9Vk0iFBPt+p7tfLDtvq7L8Flz3DJteuwnGkunIv8OomIFiFez+5KReanqfdz7QldPJfGh/TOz1b6+Z8ZtArTi9Fsz4krflL5PpcHfkaSAQ8jOzL6Ir467X++TIExORUxkZ6egXhR0C132FnVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:09 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:09 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 26/72] libmultipath: mark unused params in getprio() methods Thread-Index: AQHVgUPxTgFpS8Kf2UaecSgCqKwm7Q== Date: Sat, 12 Oct 2019 21:28:09 +0000 Message-ID: <20191012212703.12989-27-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 99443876-04c9-45b0-5a83-08d74f5b1435 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:46; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(1496009)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FboqXN5dDBZu+x/2O4B+QoM3CuQTxaEJsL+xqrAxh1THv5dHsI/e6Xm/MFPdi6ZfE8C5QN6riKxANkM5rlhpxvkP5FPc85FsF9RFlDuC7dG838IX9sC1RvdQvt27TTmBT+eAm6Eu1FWybHK1QlPIRHWs7JPG81xzg81hhVSFP6EAG8LmCdq5Srf+tazGyV+O4KCOYTTHdmtOjWZi/B+vHYwkgBAh+2hwAAlz3rhyjnbWkfQJmn8mKn8NlEvjy4rjYCy3AefCQE3JbqbVvFTUUbVWq6UbD5dumUzDWAorh3kqbE/Yu4bCwDNgxYeWquGCoNX5fe6+DEycjLYkmaiAYw1DpS0ZwZj3oyMNlHLoO76QD2egnl+tx6mDljvnnLedkScpHBJZQjgoqAIKPSFcQ2zd6mT1+Zz814MAH8ab75k= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 99443876-04c9-45b0-5a83-08d74f5b1435 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:09.8552 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: eyoqgGdABOHm5JkODbBRQb6ZT0/6NSn/q4mpSh4QH7dhKbwA7L+HrWna5ympUMKYlg5p9lCzDjrwXUzSuDpnQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Sat, 12 Oct 2019 21:28:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Sat, 12 Oct 2019 21:28:33 +0000 (UTC) for IP:'15.124.2.87' DOMAIN:'m4a0041g.houston.softwaregrp.com' HELO:'m4a0041g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.87 m4a0041g.houston.softwaregrp.com 15.124.2.87 m4a0041g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.70 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSYfC006092 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 26/72] libmultipath: mark unused params in getprio() methods 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Sat, 12 Oct 2019 21:30:02 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/prioritizers/ana.c | 3 ++- libmultipath/prioritizers/const.c | 4 +++- libmultipath/prioritizers/datacore.c | 3 ++- libmultipath/prioritizers/emc.c | 3 ++- libmultipath/prioritizers/hds.c | 3 ++- libmultipath/prioritizers/hp_sw.c | 3 ++- libmultipath/prioritizers/iet.c | 3 ++- libmultipath/prioritizers/ontap.c | 3 ++- libmultipath/prioritizers/random.c | 4 +++- libmultipath/prioritizers/rdac.c | 3 ++- libmultipath/prioritizers/sysfs.c | 3 ++- libmultipath/prioritizers/weightedpath.c | 3 ++- 12 files changed, 26 insertions(+), 12 deletions(-) diff --git a/libmultipath/prioritizers/ana.c b/libmultipath/prioritizers/ana.c index bcb1dbf8..9f7adfa5 100644 --- a/libmultipath/prioritizers/ana.c +++ b/libmultipath/prioritizers/ana.c @@ -202,7 +202,8 @@ static int get_ana_info(struct path * pp) * - ALUA's LBA-dependent state has no ANA equivalent. */ -int getprio(struct path *pp, char *args, unsigned int timeout) +int getprio(struct path *pp, __attribute__((unused)) char *args, + __attribute__((unused)) unsigned int timeout) { int rc; diff --git a/libmultipath/prioritizers/const.c b/libmultipath/prioritizers/const.c index aad69274..059d8593 100644 --- a/libmultipath/prioritizers/const.c +++ b/libmultipath/prioritizers/const.c @@ -2,7 +2,9 @@ #include "prio.h" -int getprio(struct path * pp, char * args, unsigned int timeout) +int getprio(__attribute__((unused)) struct path * pp, + __attribute__((unused)) char * args, + __attribute__((unused)) unsigned int timeout) { return 1; } diff --git a/libmultipath/prioritizers/datacore.c b/libmultipath/prioritizers/datacore.c index 59c98164..02dc2e27 100644 --- a/libmultipath/prioritizers/datacore.c +++ b/libmultipath/prioritizers/datacore.c @@ -98,7 +98,8 @@ int datacore_prio (const char *dev, int sg_fd, char * args) return 0; } -int getprio(struct path * pp, char * args, unsigned int timeout) +int getprio(struct path * pp, char * args, + __attribute__((unused)) unsigned int timeout) { return datacore_prio(pp->dev, pp->fd, args); } diff --git a/libmultipath/prioritizers/emc.c b/libmultipath/prioritizers/emc.c index a2f74875..3b63cca0 100644 --- a/libmultipath/prioritizers/emc.c +++ b/libmultipath/prioritizers/emc.c @@ -81,7 +81,8 @@ out: return(ret); } -int getprio (struct path * pp, char * args, unsigned int timeout) +int getprio (struct path *pp, __attribute__((unused)) char *args, + unsigned int timeout) { return emc_clariion_prio(pp->dev, pp->fd, timeout); } diff --git a/libmultipath/prioritizers/hds.c b/libmultipath/prioritizers/hds.c index 70fb5d19..88cac5f0 100644 --- a/libmultipath/prioritizers/hds.c +++ b/libmultipath/prioritizers/hds.c @@ -168,7 +168,8 @@ int hds_modular_prio (const char *dev, int fd, unsigned int timeout) return -1; } -int getprio (struct path * pp, char * args, unsigned int timeout) +int getprio (struct path * pp, __attribute__((unused)) char *args, + unsigned int timeout) { return hds_modular_prio(pp->dev, pp->fd, timeout); } diff --git a/libmultipath/prioritizers/hp_sw.c b/libmultipath/prioritizers/hp_sw.c index 6b0ed398..5b85ad2e 100644 --- a/libmultipath/prioritizers/hp_sw.c +++ b/libmultipath/prioritizers/hp_sw.c @@ -95,7 +95,8 @@ out: return(ret); } -int getprio (struct path * pp, char * args, unsigned int timeout) +int getprio (struct path *pp, __attribute__((unused)) char *args, + unsigned int timeout) { return hp_sw_prio(pp->dev, pp->fd, timeout); } diff --git a/libmultipath/prioritizers/iet.c b/libmultipath/prioritizers/iet.c index a4ea61ef..e98773cf 100644 --- a/libmultipath/prioritizers/iet.c +++ b/libmultipath/prioritizers/iet.c @@ -138,7 +138,8 @@ int iet_prio(const char *dev, char * args) return 10; } -int getprio(struct path * pp, char * args, unsigned int timeout) +int getprio(struct path * pp, char * args, + __attribute__((unused)) unsigned int timeout) { return iet_prio(pp->dev, args); } diff --git a/libmultipath/prioritizers/ontap.c b/libmultipath/prioritizers/ontap.c index 6505033f..262e69d2 100644 --- a/libmultipath/prioritizers/ontap.c +++ b/libmultipath/prioritizers/ontap.c @@ -241,7 +241,8 @@ prio_select: } } -int getprio (struct path * pp, char * args, unsigned int timeout) +int getprio (struct path *pp, __attribute__((unused)) char *args, + unsigned int timeout) { return ontap_prio(pp->dev, pp->fd, timeout); } diff --git a/libmultipath/prioritizers/random.c b/libmultipath/prioritizers/random.c index 4a27123b..b742ac23 100644 --- a/libmultipath/prioritizers/random.c +++ b/libmultipath/prioritizers/random.c @@ -5,7 +5,9 @@ #include "prio.h" -int getprio(struct path * pp, char * args, unsigned int timeout) +int getprio(__attribute__((unused)) struct path *pp, + __attribute__((unused)) char *args, + __attribute__((unused)) unsigned int timeout) { struct timeval tv; diff --git a/libmultipath/prioritizers/rdac.c b/libmultipath/prioritizers/rdac.c index f5df0321..92a2fb85 100644 --- a/libmultipath/prioritizers/rdac.c +++ b/libmultipath/prioritizers/rdac.c @@ -91,7 +91,8 @@ out: return(ret); } -int getprio (struct path * pp, char * args, unsigned int timeout) +int getprio (struct path *pp, __attribute__((unused)) char *args, + unsigned int timeout) { return rdac_prio(pp->dev, pp->fd, timeout); } diff --git a/libmultipath/prioritizers/sysfs.c b/libmultipath/prioritizers/sysfs.c index ff567df7..a6feb421 100644 --- a/libmultipath/prioritizers/sysfs.c +++ b/libmultipath/prioritizers/sysfs.c @@ -36,7 +36,8 @@ int get_exclusive_pref_arg(char *args) return 1; } -int getprio (struct path * pp, char * args, unsigned int timeout) +int getprio (struct path * pp, char *args, + __attribute__((unused)) unsigned int timeout) { int prio = 0, rc, i; char buff[512]; diff --git a/libmultipath/prioritizers/weightedpath.c b/libmultipath/prioritizers/weightedpath.c index e0f3efbb..916970df 100644 --- a/libmultipath/prioritizers/weightedpath.c +++ b/libmultipath/prioritizers/weightedpath.c @@ -143,7 +143,8 @@ int prio_path_weight(struct path *pp, char *prio_args) return priority; } -int getprio(struct path *pp, char *args, unsigned int timeout) +int getprio(struct path *pp, char *args, + __attribute__((unused)) unsigned int timeout) { return prio_path_weight(pp, args); } From patchwork Sat Oct 12 21:28:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187029 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 8284A1709 for ; Sat, 12 Oct 2019 21:31:06 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5F0BA2089C for ; Sat, 12 Oct 2019 21:31:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F0BA2089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9FADA46671; Sat, 12 Oct 2019 21:31:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77D9A5D721; Sat, 12 Oct 2019 21:31:05 +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 437DF180B536; Sat, 12 Oct 2019 21:31:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLSehh006152 for ; Sat, 12 Oct 2019 17:28:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 369C85DA5B; Sat, 12 Oct 2019 21:28:40 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx28.extmail.prod.ext.phx2.redhat.com [10.5.110.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B62AC5D9CC; Sat, 12 Oct 2019 21:28:37 +0000 (UTC) Received: from m4a0041g.houston.softwaregrp.com (m4a0041g.houston.softwaregrp.com [15.124.2.87]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 48BA688384E; Sat, 12 Oct 2019 21:28:36 +0000 (UTC) Received: FROM m4a0041g.houston.softwaregrp.com (15.120.17.147) BY m4a0041g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:27:41 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:12 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.12) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LUcKEsCnbFKyL+2vm5+qnRVl+c0dsrg1wA1ALDHMSOeOPLcw23/sNtgwyiMMD/Kw5MLe5xPh076KDr7eeurN3TWAMEQDbep648qej2PLtg3Df7m9FwKALT/SoMnhPhTys4G4ip0UeRAJQdRpOn4b7S65KAzNv6l/x+zrebR0kswmWirUbWpuA1pygYRO00IJwDQ5w/DJ0wMuBvQLuMmbjG30zQ7AnJjjbuZoprAfz7Wln8QBmwhLn9D1HdTCysi5dZqSleK98dIAWuRDQjv81kH+Y4sdVKUS/YGEmgOph9s4/oSUfQxPggXriZs35Kx6IpXPDjSSGHMfKa2q54AEvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pz7aEamMvHFUGmNBMmNOe/XaBz+jkIUD6GDUsdJwNL8=; b=Lwi6+FqQ1WqlrGNaN7/HmXtOgptua6mOQx05AAe/FVX9V0fgoMpDL2aYpFH/nzZzho20QH0KMTWYP5c5aa4h54fTm4oO/8q6vD2z34GivvDjPN6J62g/elMRfQVUbljWGCVUwKl4ZnoxDFzcq2tO1Y/3T2NSbqK3ttbeDP8tVmGa+sxCN/aKjZUFy7UmJB0aB00xyWgvwW9zv1bmWoG+HntW8XvdJvSou8rKSQuSJCXX6dQchApsjrWEcmhIhP9raiFZ1cVa5QPDDcjyhPYiaW4/T5SAl84W/ocneAWBXhAped1/AqScQtpOKefIPoHWhmXyIfbAOK045MFs7t1wgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:11 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:11 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 27/72] libmultipath: hp_sw: remove usused argument in do_inq() Thread-Index: AQHVgUPy+JtZzojyBkmKFMOxVkG2XA== Date: Sat, 12 Oct 2019 21:28:11 +0000 Message-ID: <20191012212703.12989-28-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a5d31223-cc51-4b0d-cb34-08d74f5b14f7 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:346; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(1496009)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MGdnACMOCDpjbuoOtWECin92XfC1sG4dtDKsdzTv1IcJ1rP8hwgGvrKHt8wSpOHFl0J0CTOaVHsmxk7ar+H63IlrPz7ZgV9ONF6hzeRYDDke6HNXWWFK5eTZOt3Ov8dm3hXq2xkKdyR0KN4i6DvG33LfRWTqHYIcg/1E08JnB3YOrtfh7f+ks1NZuqlOf9OKCfTIknewDDTT7adFEMgZbBz7ez9ppbaAOtvc5rDXxnszzN+Yvmw3RYYxzJgyyXVgCKK33ZcEfXO9J9EbcoREsa2cyFBFV8+cxi/qYDArNl1+1PQA49ccLMIIrJrWfyvfMVcGS70GOlNBJCLZVEOf/D8tczlo5GjeS491q77cNy+DF2MiCdaizSPopOoPSBFx895uJTUeVApM/zVWnOgRTLoqMsskFFqlRLvkG6P1PmI= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a5d31223-cc51-4b0d-cb34-08d74f5b14f7 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:11.1544 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oA5j6Mq5A0xKDJRoTAhw1yEi1dxafp0dIKs4RESgTNfN8W4fkwd9My72izEl6E3n++MPFSPEFaWCJut2fCknyQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Sat, 12 Oct 2019 21:28:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Sat, 12 Oct 2019 21:28:37 +0000 (UTC) for IP:'15.124.2.87' DOMAIN:'m4a0041g.houston.softwaregrp.com' HELO:'m4a0041g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.87 m4a0041g.houston.softwaregrp.com 15.124.2.87 m4a0041g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.69 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLSehh006152 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 27/72] libmultipath: hp_sw: remove usused argument in do_inq() 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 12 Oct 2019 21:31:06 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/checkers/hp_sw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/checkers/hp_sw.c b/libmultipath/checkers/hp_sw.c index 1a820223..eabfa93c 100644 --- a/libmultipath/checkers/hp_sw.c +++ b/libmultipath/checkers/hp_sw.c @@ -44,7 +44,7 @@ void libcheck_free (struct checker * c) static int do_inq(int sg_fd, int cmddt, int evpd, unsigned int pg_op, - void *resp, int mx_resp_len, int noisy, unsigned int timeout) + void *resp, int mx_resp_len, unsigned int timeout) { unsigned char inqCmdBlk[INQUIRY_CMDLEN] = { INQUIRY_CMD, 0, 0, 0, 0, 0 }; @@ -130,7 +130,7 @@ do_tur (int fd, unsigned int timeout) int libcheck_check(struct checker * c) { char buff[MX_ALLOC_LEN]; - int ret = do_inq(c->fd, 0, 1, 0x80, buff, MX_ALLOC_LEN, 0, c->timeout); + int ret = do_inq(c->fd, 0, 1, 0x80, buff, MX_ALLOC_LEN, c->timeout); if (ret == PATH_WILD) { c->msgid = CHECKER_MSGID_UNSUPPORTED; From patchwork Sat Oct 12 21:28:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187045 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 4843614ED for ; Sat, 12 Oct 2019 21:31:48 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2606220700 for ; Sat, 12 Oct 2019 21:31:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2606220700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 55D49308FEC6; Sat, 12 Oct 2019 21:31:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C5B65C226; Sat, 12 Oct 2019 21:31:47 +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 E0879180BA99; Sat, 12 Oct 2019 21:31:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUNJk006625 for ; Sat, 12 Oct 2019 17:30:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 81C925C299; Sat, 12 Oct 2019 21:30:23 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7718C5C22F; Sat, 12 Oct 2019 21:30:23 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DDE912CD811; Sat, 12 Oct 2019 21:30:21 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:43 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:13 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KZNkXZaTDdB4U1adAwZ4oDoasY0qEJF3HtwaWW9lp9NEchTcehmJJaFsCYLN/HP9QHrCqTZiqVHh+4SRL7H54uaMXRSaQSI9udcreADWSxIjp5TPvd9RKaN2L8Q2Z3FfinTQmWn33rsw376g3IwlrkWa2pC/3syXUIxZ0G942fx3hjcrPPZ8QhZv7Szz30K73AUxAp3mLXgq5+B9+xe9NYsosrx2UL34IRPiZnVCPtZeYBWUcNpr0fHCAlYnnzvwskDPMvOs4swUm10NQWV0MyIjSxUtyXikhwwAuGb7vHMU3ZSN+YylHT9IZGyonuBHaZ7qpnQeyo7Nm64B4YXjcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4ucXWcPsRX45PBqBTTzw49MNJ3cBg0QYmm/EMZPsOW0=; b=VzcdBGsQwTuuAM4cvlmym6sM/gXseF0AcDSieHyq5Mk/XV0Bhr/31nUkCJuPqG63YPnX5ieQ0Ttc5z6XnyrEehSSICAt2ea4HjYU2JM6GI7jCDHMtxQToUgWaQmPevumL9/2KOCObkU7apqsA8HZI8/P4E4OL/tlsODTft250KyNQSErhqeUIQRh71SZL2qx23x1u7fkAB4ON/xPZIMsMG4BiLOxH3+n8py3a2Vw90K9+bSL4Z4UR0uuSx6YXzM3PIRo52tbbS0N9fPeSayFeHAkr7RusAaiI92+UA7P1yeZCGPkRKFmWZ78vuimtr6UC26jHmkGFj0HepdPg6ZyRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:12 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:12 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 28/72] libmultipath: checkers: mark unused arguments in methods Thread-Index: AQHVgUPzsodi1DA3G0Kt64LVWyI5Fg== Date: Sat, 12 Oct 2019 21:28:12 +0000 Message-ID: <20191012212703.12989-29-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 95903583-4219-4d61-32ec-08d74f5b15be x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:296; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(1496009)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FySeALXUmk0GFDhFw4bLGdh6drTKvnJmegipvXUzW0/zZAY6qOIOupiOPFjV6snV4JVvUIvHoRpVirEY7pRjuAUUGEkK099ozcbosnMaxPrg2mDEGkAvIj1ITHuUFCpr3rb2cmcDdu+HLyIh1IqZoNGlpUGPmtYugk6Z4oG3HArdcWU2BVOsdw4K6uc3eLcGfGefsmB8MCAtXUc52Mh7gfUG2hUkn4J9YPi2nRbzV+3ovldKCSevnY5ZRFx/B10oilvlSgwdmVSx9Dl25yB2AccfS4rLJP8+cYudLHmSvvDlk5FpGAGPTDeH6npgOLafsTrRm0nrM32NZkiawAsR8WX/SyKeKbQHRHiSVkfC+NPJsBD6+3KsuqmfD3AVd+/NG3rBZSJCdAxZLKKpzy3sAG+dYuWYnR7R8SEHMpAmIx8= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 95903583-4219-4d61-32ec-08d74f5b15be X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:12.3308 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oGPFn63OFLNVGM8XVzXLCtlDI+UY0zMa1b8+38SacD7TyzEF6kqnI56VzBOASZNokHRfbkzcJ1/Ss8VtihQxMw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 12 Oct 2019 21:30:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 12 Oct 2019 21:30:22 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUNJk006625 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 28/72] libmultipath: checkers: mark unused arguments in methods 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:31:47 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/checkers/cciss_tur.c | 4 ++-- libmultipath/checkers/hp_sw.c | 4 ++-- libmultipath/checkers/rdac.c | 2 +- libmultipath/checkers/readsector0.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libmultipath/checkers/cciss_tur.c b/libmultipath/checkers/cciss_tur.c index ea843742..eaf67b35 100644 --- a/libmultipath/checkers/cciss_tur.c +++ b/libmultipath/checkers/cciss_tur.c @@ -46,12 +46,12 @@ struct cciss_tur_checker_context { void * dummy; }; -int libcheck_init (struct checker * c) +int libcheck_init (__attribute__((unused)) struct checker * c) { return 0; } -void libcheck_free (struct checker * c) +void libcheck_free (__attribute__((unused)) struct checker * c) { return; } diff --git a/libmultipath/checkers/hp_sw.c b/libmultipath/checkers/hp_sw.c index eabfa93c..915918c0 100644 --- a/libmultipath/checkers/hp_sw.c +++ b/libmultipath/checkers/hp_sw.c @@ -32,12 +32,12 @@ struct sw_checker_context { void * dummy; }; -int libcheck_init (struct checker * c) +int libcheck_init (__attribute__((unused)) struct checker * c) { return 0; } -void libcheck_free (struct checker * c) +void libcheck_free (__attribute__((unused)) struct checker * c) { return; } diff --git a/libmultipath/checkers/rdac.c b/libmultipath/checkers/rdac.c index 8a3b73ec..d924a9f7 100644 --- a/libmultipath/checkers/rdac.c +++ b/libmultipath/checkers/rdac.c @@ -133,7 +133,7 @@ out: return 0; } -void libcheck_free (struct checker * c) +void libcheck_free(__attribute__((unused)) struct checker *c) { return; } diff --git a/libmultipath/checkers/readsector0.c b/libmultipath/checkers/readsector0.c index cf79e067..b041f110 100644 --- a/libmultipath/checkers/readsector0.c +++ b/libmultipath/checkers/readsector0.c @@ -10,12 +10,12 @@ struct readsector0_checker_context { void * dummy; }; -int libcheck_init (struct checker * c) +int libcheck_init (__attribute__((unused)) struct checker * c) { return 0; } -void libcheck_free (struct checker * c) +void libcheck_free (__attribute__((unused)) struct checker * c) { return; } From patchwork Sat Oct 12 21:28:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187047 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 8409E18B7 for ; Sat, 12 Oct 2019 21:31:48 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 61B8E20700 for ; Sat, 12 Oct 2019 21:31:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 61B8E20700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A58030A922D; Sat, 12 Oct 2019 21:31:47 +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 6098E5C231; Sat, 12 Oct 2019 21:31:47 +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 CFB6C4EDA5; Sat, 12 Oct 2019 21:31:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.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 x9CLTGaV006281 for ; Sat, 12 Oct 2019 17:29:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id CB3951001B2D; Sat, 12 Oct 2019 21:29:16 +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 C8C431001B2C; Sat, 12 Oct 2019 21:29:14 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 97CDF356C9; Sat, 12 Oct 2019 21:29:13 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.146) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:28:20 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0334.microfocus.com (2002:f78:1192::f78:1192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:14 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kOEQmICTyptK7HMpiEIaIy/eg5K/YpPE5Ece4TDYnSAiUOKmVRI3gYiB2vbZn5QNghnQhgJsz2KJoiyePbbG1FI9hsUM9MOvOPVZyOprL7LuPFgtDWhMcT5g/gqfKZdSfyCnrhLmHF16zkFgBDzIysbiGx9gw0uI0+RkYrnRurDgvz5QrnAqDJfmb6aHdJnEukVsDFche49/66Ig53OHxxO9eBxnyKAyhG8EATzvkAmdefOMLepK+52mKXzkuPiuq1vbYTORNtkumLP3SYM51GS3AjtxiczRf7xQdF0Af19tHlVQkabQYcRHotqg9GfLVo60jcBVbz8eqH68p46Brw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WyteTNMTrfRlGIOgItw8njzcIbx6Q1qHaMtF+vAHVf4=; b=U5ep7S+grALHFoWrq03tTjgVD4gtJLwr0TVAu03t8t7JPzLQWHxIdSi4BQs6gDUpDHfHutjlBwcQZxkO/qDOm3Y6nplp/Jl90MRC6uY88Z24wuq12XN3LDYOYkgUZd012Zs/d3k3fRWCwy2d/aXLMmQY0aaChvkt0KAw4YtX27RjjKvvzNtcQ+0LDahdWfYqcEUCcVqVge2yl2EhGFGfX7ue4kiEs6drLGi7gLKolO0/VaYvhOa6V3P1/96lEmTqMoMckSVMuzuTA5YwQlWU0y74VsVvEOumSduGiQNWdpVe2LHgd5txsPovbEyHJJOrsxr+l7zlPzW1DY2dZKU/Cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:13 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:13 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 29/72] multipathd: stop_waiter_thread(): removed unused parameter Thread-Index: AQHVgUP0QQcCUZpKQUeLVTYd6T5pug== Date: Sat, 12 Oct 2019 21:28:13 +0000 Message-ID: <20191012212703.12989-30-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1d4fcacf-9da6-4ef3-74d9-08d74f5b1672 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:326; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(1496009)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: e7CPZpJnp5QBTMjOSjGSWpHuVf/7n0RWNloQJBQGy/XepE3yBIGZ/AKQHXnJuh+6eSzY931bc8PGARVxWvf2pk+3O3Z4/izzEmJk9NuubIZGMrQx8MPUvCodPd6uLNl9wpSPktT7UvfzPocY42SWR+zO0MJVfSrNWIxFOSonMBKqL2XJG2pN4FLpBuMWX1Cb8cTFG+dHIWrBpEmvh3DY/4Hvew1hAf8mFJhHZtn4wMULOiBUNa5rmsu72SuUXTmRYWn7HTWxkfQkSzuvLDbNaFP0GRZ77+zy6ec6aU/+Ay0pbPlngESWH7YN7AKhzlMEBjkJK48TXiVTf5pR1W6qtdrqKOld4NEyQE4Mhb2dYuDGnylZaMv51W4HG/RRWgWt8zSkDTqCJPqkYfJFrz24CLYP+UCA7mAWYj2k19BdweM= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 1d4fcacf-9da6-4ef3-74d9-08d74f5b1672 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:13.5151 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 4L5lCwTWwplPpZEph41IGWiVlnN4bQSxt9Hqb6GILZhPPG4eaeWEenBCUFDdmY0+uPMXyac9NaHlWKfu1XTHzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 12 Oct 2019 21:29:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 12 Oct 2019 21:29:14 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLTGaV006281 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 29/72] multipathd: stop_waiter_thread(): removed unused parameter 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sat, 12 Oct 2019 21:31:47 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- multipathd/main.c | 4 ++-- multipathd/waiter.c | 2 +- multipathd/waiter.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index ef128a32..43ae42d4 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -377,7 +377,7 @@ remove_map_and_stop_waiter(struct multipath *mpp, struct vectors *vecs) * so they don't need to be manually removed here */ condlog(3, "%s: removing map from internal tables", mpp->alias); if (!poll_dmevents) - stop_waiter_thread(mpp, vecs); + stop_waiter_thread(mpp); remove_map(mpp, vecs, PURGE_VEC); } @@ -392,7 +392,7 @@ remove_maps_and_stop_waiters(struct vectors *vecs) if (!poll_dmevents) { vector_foreach_slot(vecs->mpvec, mpp, i) - stop_waiter_thread(mpp, vecs); + stop_waiter_thread(mpp); } else unwatch_all_dmevents(); diff --git a/multipathd/waiter.c b/multipathd/waiter.c index eb8d6996..e6457663 100644 --- a/multipathd/waiter.c +++ b/multipathd/waiter.c @@ -49,7 +49,7 @@ static void free_waiter (void *data) FREE(wp); } -void stop_waiter_thread (struct multipath *mpp, struct vectors *vecs) +void stop_waiter_thread (struct multipath *mpp) { pthread_t thread; diff --git a/multipathd/waiter.h b/multipathd/waiter.h index 0cfae46f..28e0f6d5 100644 --- a/multipathd/waiter.h +++ b/multipathd/waiter.h @@ -11,7 +11,7 @@ struct event_thread { struct vectors *vecs; }; -void stop_waiter_thread (struct multipath *mpp, struct vectors *vecs); +void stop_waiter_thread (struct multipath *mpp); int start_waiter_thread (struct multipath *mpp, struct vectors *vecs); #endif /* _WAITER_H */ From patchwork Sat Oct 12 21:28:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187133 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 C7A5C112B for ; Sat, 12 Oct 2019 21:47:51 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A52D820673 for ; Sat, 12 Oct 2019 21:47:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A52D820673 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 02A4E30860D5; Sat, 12 Oct 2019 21:47:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D01CC5C226; Sat, 12 Oct 2019 21:47:50 +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 9D65D1803B49; Sat, 12 Oct 2019 21:47:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLXcRa007442 for ; Sat, 12 Oct 2019 17:33:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id C9B525DA5B; Sat, 12 Oct 2019 21:33:38 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3DDA15D9CC; Sat, 12 Oct 2019 21:33:36 +0000 (UTC) Received: from m4a0040g.houston.softwaregrp.com (m4a0040g.houston.softwaregrp.com [15.124.2.86]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 30B83307D971; Sat, 12 Oct 2019 21:30:51 +0000 (UTC) Received: FROM m4a0040g.houston.softwaregrp.com (15.120.17.147) BY m4a0040g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:39 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:50 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rx95sTwF+fJV0LttyHcZDha7gvvRzXOpM7/pqKtjpJz0bGPCXAiM6zcfUlwhhWaM49V3qsm/FxXhcC8Mm0KpF4ogpUh0QrwuYwET3lOGkiueOVUo1UW+XTKtNOGNj1K9C0+nWpZhLfubpmI/QmiuKA4zbAluKiQWKvHCJiHmfupwfN5N0fw/sAhoE31AnPW0vpS+T49+/mSjz+DIatuTNBKR+0JAou9MEOROz2xjJlZnaNu+95XoOMoxmQCfZh2eHX7fiUlkxjawFvCoxTGgG7qD7LpaMN6Ucjf5PGstQLQGFKZ1TANULoX9Fb6z2EUc7sPaAQQtxsr5NvCDlZiMgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tOi/4PAiMt+mJYfz/m3vEu9yBjG9RueNR4k7Y5o3HQw=; b=IQSBjPX+Vs8fIMWWaXYCk4MZgTr9NJOx9IxuBbSuHLzC2zgkd/jvA8pvndEmX+gCL6Nt8nB1aGijDsvvXJoW73yNx2gzThLTpAisw3zXlO+7aHmamZF4EKGIQ8G8un+wwfjZvvNh2oKKtohjcRNyLzuBLiY1fsx9ShIM5KG2yAzA18NitPpJ6xThHbN8+VZwtkVu72lK6pGa5xI7zIYD1Q1DMbOrwt5or9ERfoXgZRejeVnE1G9ILJF5076/S5XUqFadHmmNZy+ICQ+bFeDogxzz0Z0Q2rtAjhf5MZxR9XHUWE5o99jW2u6oCOiihKl10+gc/QH3AqNX2J6ehmWTqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:44 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:44 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 30/72] multipath tools: mark unused arguments in thread routines Thread-Index: AQHVgUP0lYf2ugpUc0Gy/w9QXKcjIg== Date: Sat, 12 Oct 2019 21:28:14 +0000 Message-ID: <20191012212703.12989-31-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 80c8b0aa-806b-47e0-79fa-08d74f5b1727 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:147; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: c2v1JcZZmHndd1CbMBVFTspmk1680ZEf6HWIxlXLaplzw00+Nn57WCvTlYFMPsIXqSfd1Wiw4p672Im8XOJqFn6Sc7wOC2X5y/hZDbFmQIGNkHuBsTDxx4nB1OQzZKQA7YD2JN/07AHeez8J23AtVpRL3QVtlPp6S8yldqoyYdyihIUFj9MB5QpZYxEPka5NGIwMGV1vB79yz28fLH7qWdfEcqm6Z0hQV61zwps7244ytUWa00FOH3ha6eKS6PyXj0Do5Ff3+Y63cjKThxreURBBfsYFB9Fkn32WZ5rNy2kSubZC5XoMlANZRy2BST5kgNyY4bv8QoywrEiue6AaSFnEDXLbtJPbfT85x93KZksW65XCKacEj0lalTyeqJ+HikKREeiffsUT/A+BCYIjo8l22xYT4WNhCUqCSzSmQYw= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 80c8b0aa-806b-47e0-79fa-08d74f5b1727 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:14.8134 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: E3uPd/tbSDbFcj+G8jSGbRi/qlrtv1SMCSwpMYdY1Q218h9aVvhtB28R8v+DUPIdNfskTS9AS/KNcQHPZq6HaQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sat, 12 Oct 2019 21:33:35 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sat, 12 Oct 2019 21:33:35 +0000 (UTC) for IP:'15.124.2.86' DOMAIN:'m4a0040g.houston.softwaregrp.com' HELO:'m4a0040g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.86 m4a0040g.houston.softwaregrp.com 15.124.2.86 m4a0040g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLXcRa007442 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 30/72] multipath tools: mark unused arguments in thread routines 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sat, 12 Oct 2019 21:47:51 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/log_pthread.c | 2 +- multipathd/main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/log_pthread.c b/libmultipath/log_pthread.c index be57bb1a..15baef88 100644 --- a/libmultipath/log_pthread.c +++ b/libmultipath/log_pthread.c @@ -56,7 +56,7 @@ static void flush_logqueue (void) } while (empty == 0); } -static void * log_thread (void * et) +static void * log_thread (__attribute__((unused)) void * et) { int running; diff --git a/multipathd/main.c b/multipathd/main.c index 43ae42d4..e55f2795 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -2792,7 +2792,7 @@ set_oom_adj (void) } static int -child (void * param) +child (__attribute__((unused)) void *param) { pthread_t check_thr, uevent_thr, uxlsnr_thr, uevq_thr, dmevent_thr; pthread_attr_t log_attr, misc_attr, uevent_attr; From patchwork Sat Oct 12 21:28:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187115 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 F3116112B for ; Sat, 12 Oct 2019 21:36:41 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CEC8520700 for ; Sat, 12 Oct 2019 21:36:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CEC8520700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 109B1300501F; Sat, 12 Oct 2019 21:36:41 +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 E6A1F601B3; Sat, 12 Oct 2019 21:36:40 +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 B24984EE68; Sat, 12 Oct 2019 21:36:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLVhne007046 for ; Sat, 12 Oct 2019 17:31:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id A45D1608C2; Sat, 12 Oct 2019 21:31:43 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D799608A5; Sat, 12 Oct 2019 21:31:41 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EA07A308FEC6; Sat, 12 Oct 2019 21:31:39 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:30:46 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:50 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U7nvL4hioFmfQqS2kMDJ+mSK5xFlUP73s/EI/dKS2pzqYrvfpc2KAKcLiFkZ/fbW9vNQZw7lF1MhSg9kC7feNK38B6ubP1PcvvdZV3ZVc3bu4iRtm32deS7xuZu6rBfe4keqbqq8bSAT/HiW1NnmVZu1h+dOoAa+2tg0EUBTJk0SRCI4pQiJZUYojOc+CiUUngMw2a/PK50RiekXw/DXlKAk38q4Cs2pvSiZhoFe+cRZVR4kJfLRTL+zzIKsFGLX2C9wUzPT0RCt3kLvS20jTEYleCBsRMNRspVy5R32FXF2clRp8Rsx5rVhLnFiFJUMFw3KMjOhodPUUCeoAshS6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6gYkjmtgnJBzV6dWwQJdgxftjDXPy4zoEoRKaCf1oSg=; b=kEo4OvMo1meITdWtnNyMHtUfXecnyaw1772lXvMDHP60iYa3bZ3v7no0DhlnfxOvI7mj5sZMZDWRWuU06CAq5RLnOn4KWNt0IQ4siD/dbkNQeAJI7j+004S3EvsTEBPdaWQOYpNFKvSKlm7DiwOVDZ944eKAp849z2WSEIASbCsGxNimzFEGC0tro1P1AukM7dgFkVbQhXNI99vLXD4OkOTlcTlyV+W0qcZNgR0fk7HQaBdqF8Dj0HRl8ULxJ2ofaiQKdNPm7o8OrxIbn37PIAivmvg4XP0ffiIJe95FL7weUa0P12mn6Wkx6nbSmhtYybgsQLwumAKwGEQI0u35OA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:45 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:45 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 31/72] kpartx: gpt: remove unused arg in read_lastoddsector() Thread-Index: AQHVgUP12j6IfLasDU+ADZgrDeNLEA== Date: Sat, 12 Oct 2019 21:28:16 +0000 Message-ID: <20191012212703.12989-32-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 999f35ca-bfe6-4df5-c77c-08d74f5b17f0 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:626; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1IM68Lb8wGQhzJaoKOLJluhSzfDMfZDqJCXCqmfpjp8rUJBE9t72idWOwpgl2dNLf5PkIXY2lKpDVxFmjWL8maa1kZZyQ58zEAdrMgM4tHaa9odluDC77y7WkMVgGN5+pll/D04b7TujWDplxdkJpGID60ko0TYHpPfBopfpPsm3mZ34munyz9D+XFo0cmnWYuYIkhsDOCbJD/v1vu9fRX45//FbSoBhTLMGaLYEe4x1nddOlAiUG9MqBseBModOxCMuO8ZkDAp+7l411DVwG7aNHKsLd9FOL8sfD+/xNHPGCcSAjhlX/IS+jEjtjVSmVjUM6fC+TLf4SBT2GHal/HGRNQhY7zFlemYbymlHzsjw5AfpcNl1/2qkyrmzXctytOBxyFyz3bCGS5skMkYbKEoS4HJ8nY+miXF1d2b9214= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 999f35ca-bfe6-4df5-c77c-08d74f5b17f0 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:16.1096 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: OUM3GxkWJHQzca0K8Wg6EQPXno/PdF2MjE4PooFwaLjpMIubr+TQ1H/SInfmj3KwlxCwlgB8ovt62uqO3NpvVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:31:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:31:40 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLVhne007046 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 31/72] kpartx: gpt: remove unused arg in read_lastoddsector() 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sat, 12 Oct 2019 21:36:41 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- kpartx/gpt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kpartx/gpt.c b/kpartx/gpt.c index e31611a3..f3216ba2 100644 --- a/kpartx/gpt.c +++ b/kpartx/gpt.c @@ -182,7 +182,7 @@ last_lba(int filedes) static ssize_t -read_lastoddsector(int fd, uint64_t lba, void *buffer, size_t count) +read_lastoddsector(int fd, void *buffer, size_t count) { int rc; struct blkdev_ioctl_param ioctl_param; @@ -221,7 +221,7 @@ read_lba(int fd, uint64_t lba, void *buffer, size_t bytes) one sector, so we don't have to be fancy. */ if (!bytesread && !(lastlba & 1) && lba == lastlba) { - bytesread = read_lastoddsector(fd, lba, buffer, bytes); + bytesread = read_lastoddsector(fd, buffer, bytes); } return bytesread; } From patchwork Sat Oct 12 21:28:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187059 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 0B3CB1709 for ; Sat, 12 Oct 2019 21:32:30 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DCC6A2089C for ; Sat, 12 Oct 2019 21:32:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCC6A2089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1FFB27BDA2; Sat, 12 Oct 2019 21:32:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F267D5B681; Sat, 12 Oct 2019 21:32:28 +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 BFC291803B48; Sat, 12 Oct 2019 21:32:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.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 x9CLTfH1006395 for ; Sat, 12 Oct 2019 17:29:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id B5B411001B07; Sat, 12 Oct 2019 21:29:41 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1A96810013D9; Sat, 12 Oct 2019 21:29:39 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CFFC8C01DDF8; Sat, 12 Oct 2019 21:29:37 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.190) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:28:59 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:51 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UvkUonlpFLrPe+1syZNLdtvpTQR2lQ0ZV08dmVe034Tg2i+nJ4HbDfqU6UWs0M8grmp7e5am1HMyVY/t/fbI4VDxiS+6Y7ZngPPOIVB/j+G7HLIosPsT5ojizY99ATvKC1MdMeEsNEMYKT86PP7stdQUjVONHu+s/UhZE7WIDogvfM8PYqnZ43/JiCtV9sBcib09j5ndHzpOoxvP7F6NB1fDXLu4+L4+j/Uhtj3VVlKUcVDE7LoUTDlLhDn3mpoJ4lLzbuXrxyDm8JNzMi5m6MwXLabfxjA+iw7MP6GiQK2gTcQZsjnpOc/k6Gvm5u4SuIPwFlrvR9XfY3837UtosQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7tW6SP2diNiiGz9C/ZEom0cfzLgKdk4gf6xY88JUY00=; b=BqnNkCd0l/HeY03ojdl/bKTtxXoLcY12RZKNrAsT8WnIQhesNyr5q5dr3RwggwRXtDTXZ/LAEio9NzQbZkRwdzJ3n80xmyFV0IplCzObAW9uAJWobfORkLnGq9VK3VoQXQddVgBI8+0DS1DK2DNF9wVKVzJg57tLAQGKrcwrFJa+yysuAv+Wvz5hzA2G6K/qascYHOvaa6XfMX0gA/FsG1sV+jZt+UKemYJUOa8/qG6VV/VLIBRzCj7qshRsfFRpxfz9kdaUHBH8ZxvyLBVaOAf7rbguwOSB8jTdkif27yfRo4zkYHxqpXsy+TrMuGpOtPjf6H1q+wULEymwBMA7ZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:46 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:46 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 32/72] kpartx: mark unused arguments in ptreader methods Thread-Index: AQHVgUP2WAasUL8yGUqSIiVCvR+sEA== Date: Sat, 12 Oct 2019 21:28:17 +0000 Message-ID: <20191012212703.12989-33-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e8cda4a0-c39b-40c6-5f37-08d74f5b18b3 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:243; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: s6IF3MOaC74YPHUAiyJzOkmRjpm2ilfRhjabGUyye2hpTDo3Z4+85sMxl93uFOL+R8arE9BnR7y25YIDAd2nu95NorPCA9gooxpzicfPBbA3HVa/sGqy9GS4raBlJzlrmQny9NvrIpghUepTxH9OQyM/DtOqsRXD/esch1Z+hdvu08Cp3GUFduthNoyq8VRJBOBZKxoUzNG7FaWpTp/eaZPadgcCOyC25fCfqGbq9AZSS2d9MN8wv6HelVObCO6uGjcSds0gaq9KrLdnOL3hgxMkbOFL83cFdXa4Dy8Srot+pkCiJO0um9rK79eirgY3jjm31vNsXcP/Yme7txsUW1O5AfqBfMi8e73Ze3DNV66ojvdhWzifiMCbS7e0lvaYqeP6YrUwjBqtQ96EWb1q79G5VDxiJRYDmTvlw27kwco= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e8cda4a0-c39b-40c6-5f37-08d74f5b18b3 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:17.2760 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: R1Gv81A92v5zSncynCRzXBmmrIHtlJQU385BOdLuY41tk17L6GU3u0Uu2Pt9E3LGQKEyJJhTgh4Ge6WtUX2zwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:29:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:29:38 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLTfH1006395 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 32/72] kpartx: mark unused arguments in ptreader methods 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 12 Oct 2019 21:32:29 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- kpartx/dasd.c | 3 ++- kpartx/gpt.c | 3 ++- kpartx/mac.c | 3 ++- kpartx/ps3.c | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/kpartx/dasd.c b/kpartx/dasd.c index 4e7e4743..4f3f744e 100644 --- a/kpartx/dasd.c +++ b/kpartx/dasd.c @@ -65,7 +65,8 @@ typedef unsigned int __attribute__((__may_alias__)) label_ints_t; /* */ int -read_dasd_pt(int fd, struct slice all, struct slice *sp, int ns) +read_dasd_pt(int fd, __attribute__((unused)) struct slice all, + struct slice *sp, __attribute__((unused)) int ns) { int retval = -1; int blocksize; diff --git a/kpartx/gpt.c b/kpartx/gpt.c index f3216ba2..4f88d486 100644 --- a/kpartx/gpt.c +++ b/kpartx/gpt.c @@ -601,7 +601,8 @@ fail: * */ int -read_gpt_pt (int fd, struct slice all, struct slice *sp, int ns) +read_gpt_pt (int fd, __attribute__((unused)) struct slice all, + struct slice *sp, int ns) { gpt_header *gpt = NULL; gpt_entry *ptes = NULL; diff --git a/kpartx/mac.c b/kpartx/mac.c index 6e82c95e..6aeac4e9 100644 --- a/kpartx/mac.c +++ b/kpartx/mac.c @@ -5,7 +5,8 @@ #include "mac.h" int -read_mac_pt(int fd, struct slice all, struct slice *sp, int ns) { +read_mac_pt(int fd, __attribute__((unused)) struct slice all, + struct slice *sp, int ns) { struct mac_driver_desc *md; struct mac_partition *part; unsigned secsize; diff --git a/kpartx/ps3.c b/kpartx/ps3.c index 84550978..2cf4ffa2 100644 --- a/kpartx/ps3.c +++ b/kpartx/ps3.c @@ -48,7 +48,8 @@ read_disklabel(int fd, struct disklabel *label) { } int -read_ps3_pt(int fd, struct slice all, struct slice *sp, int ns) { +read_ps3_pt(int fd, __attribute__((unused)) struct slice all, + struct slice *sp, __attribute__((unused)) int ns) { struct disklabel label; int n = 0; int i; From patchwork Sat Oct 12 21:28:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187069 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 2EBD61668 for ; Sat, 12 Oct 2019 21:33:11 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0BA6620700 for ; Sat, 12 Oct 2019 21:33:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0BA6620700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5B3AB302C076; Sat, 12 Oct 2019 21:33:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3672F601B3; Sat, 12 Oct 2019 21:33:10 +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 0345C180B76F; Sat, 12 Oct 2019 21:33:10 +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 x9CLU2Q5006474 for ; Sat, 12 Oct 2019 17:30:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 78BD860C5D; Sat, 12 Oct 2019 21:30:02 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D767960BF1; Sat, 12 Oct 2019 21:29:59 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 382F4308424C; Sat, 12 Oct 2019 21:29:57 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.190) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:13 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:51 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a+NdwTuOFcGvTHG/lUM3nw/mbSuqLV7UjEtHUV6wBJR+txLUD/kRvoHXMgg+WB2TfUN5KyrXe8tw5F5qx878DDSIHA7Fxk6BiZgnpfTx+dr99x5DdQoFkRDpWdHnaMPpG1rgQk21AYWpdpbbr1hBfltV4l0nX42lnZ5A3+pzL8ITjDb6gf1BpG1gLFXGRifpFydKqf7MwIKUozuqlgpanEiEAmJpQqHYknFyNvlIB86URF62Y7Ck1uLqzPJAcAz7gHs8smryZwS4bIztEyGkrHQOBPhNVG2F0MdCyYZ9rkEY91yXcjCvDiJJXkAwY9CKPyoKAPoJUof1oy/AYwfxhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SAqF1Lz5H7iht9gjZFeovo27x8XJH4QA6eog20U+TOU=; b=UavpDhydq+SBFBWbO2TdBDw5WhVe4oomdUw0PhK7D+mLlDiYqBLFG8zPMIZDigs1+tLYLi4WkCvjrDVqbBrWtKqZd5hix4EM/PBMBS+75NeO+lE/PzaFSJ+c710poQZsLz/vm7VBVTzV6/oFgj97l2xfXbNDttWkTg99pLe5vEBnG9zMCSGZKderX3Lerr/cbQ0BXrqdv3X34U2CiYWGVkBeAH2r2cq3kYdGtDM62arHZbedU9lRHOvvImS4Atg1YGF4GoSvJw9SCXaqpFoPR61J4MlhJf9WV1B5ZZXMqkeVXkHTVx6MiFKfpLeqytGtzgE/PwOJ0BpH8wM/RVfDGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:46 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:46 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 33/72] libmultipath: mark missing arguments in functions matching prototypes Thread-Index: AQHVgUP3Z8xnh7/KSU2b7x3Mw9hlew== Date: Sat, 12 Oct 2019 21:28:18 +0000 Message-ID: <20191012212703.12989-34-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 145c5888-d2a4-4541-2c04-08d74f5b1967 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:214; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: am95TV2PQF4XHTNG7iY40KHneTejxh8GS4KhguN/X1O4w4ERB38JkDeIDtHEquyHLdsoHVH+bD5XmoAekbNUQBDHJpJJgnFOO3PBe0mU3cfMoUvNt2UyptN/Ui4ueDVG7bxMawpgUc6GIAdZfXyHIFbOijly/Q9ULfRjvrZtTb0KX05gFIwyW2e7bAD9BopEcAb75kkVk10zcbEUpBr+GpRvWCOqkPfgHJAGH2AH9+3DbnTuHFHxNhxHIGnrmEJDq9MnpopN2Iu5ho0fvRhG1FyWAFoCOQJjggiHmdlYIsQKbxBxJMBisWjBq4RGAgSFBXjV6PwLXWWPhm7/zQ/AYoZX9WDaJy5lpRjVkEWxtt5+7SINPN0mtTkSM0gEGPrzEzRNZeZVTyw1faRSh7bGypxDwmD2s4fchZkKl0mhpdY= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 145c5888-d2a4-4541-2c04-08d74f5b1967 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:18.4563 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TCHY4abEMwMPhy2ue54I0G2CXikPusr0REgYnlmuzVH2HE9UcPSIMJWlrBQWOb6gDnUtJaMhYicGuSxS4Fo7jg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Sat, 12 Oct 2019 21:29:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Sat, 12 Oct 2019 21:29:58 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.40 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLU2Q5006474 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 33/72] libmultipath: mark missing arguments in functions matching prototypes 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sat, 12 Oct 2019 21:33:10 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/dm-generic.c | 6 ++++-- libmultipath/foreign/nvme.c | 20 +++++++++++++------- libmultipath/generic.c | 2 +- libmultipath/print.c | 6 ++++-- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/libmultipath/dm-generic.c b/libmultipath/dm-generic.c index d7529919..1b42fa0b 100644 --- a/libmultipath/dm-generic.c +++ b/libmultipath/dm-generic.c @@ -31,7 +31,8 @@ dm_mp_get_pgs(const struct gen_multipath *gmp) struct pathgroup, dm_pathgroup_to_gen); } -static void dm_mp_rel_pgs(const struct gen_multipath *gmp, +static void dm_mp_rel_pgs(__attribute__((unused)) + const struct gen_multipath *gmp, const struct _vector* v) { vector_free_const(v); @@ -44,7 +45,8 @@ dm_pg_get_paths(const struct gen_pathgroup *gpg) struct path, dm_path_to_gen); } -static void dm_mp_rel_paths(const struct gen_pathgroup *gpg, +static void dm_mp_rel_paths(__attribute__((unused)) + const struct gen_pathgroup *gpg, const struct _vector* v) { vector_free_const(v); diff --git a/libmultipath/foreign/nvme.c b/libmultipath/foreign/nvme.c index 7e654ec5..e8ca516c 100644 --- a/libmultipath/foreign/nvme.c +++ b/libmultipath/foreign/nvme.c @@ -123,7 +123,8 @@ nvme_mp_get_pgs(const struct gen_multipath *gmp) { } static void -nvme_mp_rel_pgs(const struct gen_multipath *gmp, const struct _vector *v) +nvme_mp_rel_pgs(__attribute__((unused)) const struct gen_multipath *gmp, + __attribute__((unused)) const struct _vector *v) { /* empty */ } @@ -207,7 +208,8 @@ nvme_pg_get_paths(const struct gen_pathgroup *gpg) { } static void -nvme_pg_rel_paths(const struct gen_pathgroup *gpg, const struct _vector *v) +nvme_pg_rel_paths(__attribute__((unused)) const struct gen_pathgroup *gpg, + __attribute__((unused)) const struct _vector *v) { /* empty */ } @@ -331,8 +333,9 @@ static int snprint_nvme_pg(const struct gen_pathgroup *gmp, } } -static int nvme_style(const struct gen_multipath* gm, - char *buf, int len, int verbosity) +static int nvme_style(__attribute__((unused)) const struct gen_multipath* gm, + char *buf, int len, + __attribute__((unused)) int verbosity) { int n = snprintf(buf, len, "%%w [%%G]:%%d %%s"); @@ -821,7 +824,8 @@ int add(struct context *ctx, struct udev_device *ud) return rc; } -int change(struct context *ctx, struct udev_device *ud) +int change(__attribute__((unused)) struct context *ctx, + __attribute__((unused)) struct udev_device *ud) { condlog(5, "%s called for \"%s\"", __func__, THIS); return FOREIGN_IGNORED; @@ -903,7 +907,8 @@ const struct _vector *get_multipaths(const struct context *ctx) return ctx->mpvec; } -void release_multipaths(const struct context *ctx, const struct _vector *mpvec) +void release_multipaths(__attribute__((unused)) const struct context *ctx, + __attribute__((unused)) const struct _vector *mpvec) { condlog(5, "%s called for \"%s\"", __func__, THIS); /* NOP */ @@ -927,7 +932,8 @@ const struct _vector * get_paths(const struct context *ctx) return paths; } -void release_paths(const struct context *ctx, const struct _vector *mpvec) +void release_paths(__attribute__((unused)) const struct context *ctx, + const struct _vector *mpvec) { condlog(5, "%s called for \"%s\"", __func__, THIS); vector_free_const(mpvec); diff --git a/libmultipath/generic.c b/libmultipath/generic.c index 0d1e632a..5f03b9e0 100644 --- a/libmultipath/generic.c +++ b/libmultipath/generic.c @@ -21,7 +21,7 @@ #include "structs.h" int generic_style(const struct gen_multipath* gm, - char *buf, int len, int verbosity) + char *buf, int len, __attribute__((unused)) int verbosity) { char alias_buf[WWID_SIZE]; char wwid_buf[WWID_SIZE]; diff --git a/libmultipath/print.c b/libmultipath/print.c index 907469ad..74c0d62d 100644 --- a/libmultipath/print.c +++ b/libmultipath/print.c @@ -334,7 +334,8 @@ snprint_multipath_rev (char * buff, size_t len, const struct multipath * mpp) } static int -snprint_multipath_foreign (char * buff, size_t len, const struct multipath * pp) +snprint_multipath_foreign (char * buff, size_t len, + __attribute__((unused)) const struct multipath * pp) { return snprintf(buff, len, "%s", "--"); } @@ -627,7 +628,8 @@ snprint_path_checker (char * buff, size_t len, const struct path * pp) } static int -snprint_path_foreign (char * buff, size_t len, const struct path * pp) +snprint_path_foreign (char * buff, size_t len, + __attribute__((unused)) const struct path * pp) { return snprintf(buff, len, "%s", "--"); } From patchwork Sat Oct 12 21:28:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187083 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 AE01D1709 for ; Sat, 12 Oct 2019 21:33:55 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8BD8D20700 for ; Sat, 12 Oct 2019 21:33:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BD8D20700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C7393821C6; Sat, 12 Oct 2019 21:33:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7C7B608C2; Sat, 12 Oct 2019 21:33:54 +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 7AB86180BA9C; Sat, 12 Oct 2019 21:33:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUA08006519 for ; Sat, 12 Oct 2019 17:30:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 39EB36061E; Sat, 12 Oct 2019 21:30:10 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx28.extmail.prod.ext.phx2.redhat.com [10.5.110.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E90460A97; Sat, 12 Oct 2019 21:30:08 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D4012883850; Sat, 12 Oct 2019 21:30:06 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.190) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:23 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:52 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bQQAOqGp9t/Yvpndk+j4+WM2wTGha4OlxVK38Lc0Jly0Gg8CcClA+wFyOx3BA+ec7v6cKMN7pEqfyTpLMfLKt7a9Bjz8DibHInN2t5Ias4fvV0c/MqQsevzvERaJg0jqarLOBDW/KlDinRnlobvuiRQ8deXQlvLTrdGsPJaGI9boTzWfu3hhlMPoCONzgXSI9wH+/ruraD/FWIMRsYIu7FUVXbPNcgPt0Dka1wAthwE7sixh6sMw7qIeA92YNQ6BWki2Q1zFpE0drDFIi6X5+0E+/XRW3iJPg41090dVt9S6wlb5BCGBCfELhsVqDlH4nAQTiIH4r6v24euGv4Xj7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jgcNMwGUfw1N6iBqBVt6SGL1XIIkeZD9z1XmRPgImpM=; b=bA7N5e13Qgn0hGd+YRZ4VMbcPnnLtXzaq486tb7wjNgM57a5bNHBac0UzRqh39M6MtNzYhwez1/uwrIvyfEe1AixZPEDyL0ktDBAvM6AXDjZ+153wnZul8kTSv8jzamtJFRMGCDj0aXr5F5ifHyAaByvRysGtn4GOEj8jod4T1WNJa9py7XhZNV3vn8Pfod9h5yzTN9OUao1d4bY6q7jvH02WGbiLB4gspoiY2QCGu7p6Vu8/td+KQQif1PGzUPC3v0Z0WW21jYyV/x4Ht6EKNBKHA0mIP/58UzCYaJ6OGc1eLESSFgnlQ7jOJ+A+Vt8E9FnACE4ZhRqYFfyFpw6tw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:47 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:47 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 34/72] libmultipath: get_pgpolicy_name(): use "len" parameter Thread-Index: AQHVgUP3z3ckOY7l7k6aLIl2wWzQ+A== Date: Sat, 12 Oct 2019 21:28:19 +0000 Message-ID: <20191012212703.12989-35-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: db7c34db-2c9e-43ba-5c9f-08d74f5b1a1a x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:65; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TvM4QpoEsQbg9m0CEd66aK89ByySqPNThPNkzlpBthKKRxPw4w88468zaKCIrEPsE0v+mi5ht8XvKNL3VQQXmh5+zoVJi/y4sseKH+Ie5uc761jhZvLq2CgGDH+gDhWaEr/XzIZonWa/ignWTzTfEMpqj5RLWcDlPAP5N4jfkZjw5um3I2LSgU8i5BpV6PPXSJreqj4TcexELDxK8ubsTXYbIzGX4XTnYZVOfNIVfHp2BZy81FS8hIUPlg8gjzmJa/qWLoizVS8ZNOXNA3ewW/KKhPxyUz+9Kr8A9SfcA9kDuTVkd13hWnjogzzqAeVnsaiat88h+AncfHVKcJy00xWgLO0MEPyN9Ix9krcnb8Xk9d6Oi3Z/MGeoE+ha3xXV89KUWBC9epOURvsjvROMHWTcDWanW2r/9atmdaTsFeo= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: db7c34db-2c9e-43ba-5c9f-08d74f5b1a1a X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:19.7456 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: a4PrjGyeHpDGxZlkOJhA8JMKbmtvWC3s5ivCKjLpYxIdAdmrKEOomHBy/R9hBb2hzrnJipuBWnZkXoExhE0m3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Sat, 12 Oct 2019 21:30:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Sat, 12 Oct 2019 21:30:07 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.69 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUA08006519 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 34/72] libmultipath: get_pgpolicy_name(): use "len" parameter 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 12 Oct 2019 21:33:55 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/pgpolicies.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/pgpolicies.c b/libmultipath/pgpolicies.c index 8f7c6b13..02cafdc7 100644 --- a/libmultipath/pgpolicies.c +++ b/libmultipath/pgpolicies.c @@ -54,7 +54,7 @@ int get_pgpolicy_name(char * buff, int len, int id) s = "undefined"; break; } - return snprintf(buff, POLICY_NAME_SIZE, "%s", s); + return snprintf(buff, len, "%s", s); } From patchwork Sat Oct 12 21:28:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187117 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 9D5C1112B for ; Sat, 12 Oct 2019 21:37:02 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7A4DB20700 for ; Sat, 12 Oct 2019 21:37:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A4DB20700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C18330BBE82; Sat, 12 Oct 2019 21:37:01 +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 7BDF3608C2; Sat, 12 Oct 2019 21:37:01 +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 4C1014EE6A; Sat, 12 Oct 2019 21:37:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLVl48007061 for ; Sat, 12 Oct 2019 17:31:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4C8F65D71C; Sat, 12 Oct 2019 21:31:47 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E148F5D717; Sat, 12 Oct 2019 21:31:44 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF0D83082E90; Sat, 12 Oct 2019 21:31:43 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:30:50 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:52 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.11) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CNbsN/bQyYdE5GcdzETJucoDbebec7575QDq0WyCighr57fA13aM+61enHX0qmtEA15Toz0+jnXnWcLzbP8AtpBiDRViii5nJlUs6DnnF21NjIllrQlo3erLMpG5mF8p5iRnbnvoF6tSbwAI9sHdfX//y/Q8F8Uj8FHAHFJGRaAxMFyjfgOa1jZ1TA69JAfU4hvDLMgAoyVCZ7Won8YRHjtkqy5LCkqTii7Wqdj/WrxomEZfHdqpplxyrPXNzQWk6KhYBisGHO2KoPszUXX9MTwZpZeQR5Dv63nJOYHa04TL3JZwgl4N3XeGUz4dzts+/7JlTE1PZXJ7WWD2WentLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EIMS7pDT/kp0zRV83NwUsGh/+j1v4fTQma34O1osyXw=; b=ZPbuLW7kyOvwWC0exCbVue2K45/u8OlyEv474p73RGKCcrcmZhToFtyveHd0f6yphS6y4y06Eo8NeGPKxkMTL1v///qQ/U6p2IC/NH2Cnxm8yu86/8xvWEIMigx9fkaPfAFSGUbnMO9sDCKKcO+jSgq9O5+defVg2WIZMS4G90f36mhZrAFqG1D2HQRIdEb1wUjOP0qBoFOAJ+45phVaMO9wFHMRrN+mJoU09VLMcFF7rnceMgAzO/3cX5UJaPvx/wUfw8RuAoavQNTOim7VL0R52pRtbAPfbcEud8NCAUXlRlEX7plB7ZuoAKY8nk11e2OnU2B0vYLojcb2AFWFHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:48 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:48 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 35/72] libmultipath: snprint_multipath_map_json(): remove unused argument Thread-Index: AQHVgUP4TvjbDFMrqEGZXALjE6HnWg== Date: Sat, 12 Oct 2019 21:28:20 +0000 Message-ID: <20191012212703.12989-36-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3c2d8cc9-d508-4cf8-4270-08d74f5b1add x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:296; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ufGVUsc4+3D8KcrBOtKxr7ujlWWpln2A7HrljOiduGSt7VOctyWz6GDmAi6LOYn7RRilwy6HwEgaUsHZYQn+v80fdp0oeWl5GSXK2zAsANJMGu3yLsIsuqbpzbQPQiAkIm+MPP+7ymEgfnX6oiy06BCziDQoFbaSzLr0PEGQ2+YfalBlmbG+PoJCsr5tWf/JVK/oiRxntldqKfqiKMdVmqvdQW3cLzRPyLJ7+bSgfrAszbgyohjzXIgservRTTcC+f5xPxVpXW0Cz2X8eFmP2swqg3VuVkUGVlR/6bCKweVkeZOeEJCqQ3F3u8DnfuvPnwfAdxjYMGgJ5cLkcmrKZ0cwgR+amm1w3WG1y4GTG7x4AmRRf0zLb0IXZEQC5kQioaeH8EOeDCBCBa2w6lpZQXIqislIDG3ZK0xINOGTU1o= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 3c2d8cc9-d508-4cf8-4270-08d74f5b1add X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:20.9000 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CVgx0CBBVsPHxXnhD6G/Aqum1NopOBTLqeMJI4jRuuMcJWl5QqTsjTZ+gJQn7Q/pt9ac9mbB0wULjXGMMNZIGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sat, 12 Oct 2019 21:31:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sat, 12 Oct 2019 21:31:44 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLVl48007061 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 35/72] libmultipath: snprint_multipath_map_json(): remove unused argument 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:37:02 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/print.c | 4 ++-- libmultipath/print.h | 2 +- multipathd/cli_handlers.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libmultipath/print.c b/libmultipath/print.c index 74c0d62d..8fa86267 100644 --- a/libmultipath/print.c +++ b/libmultipath/print.c @@ -1339,8 +1339,8 @@ snprint_multipath_fields_json (char * buff, int len, } int -snprint_multipath_map_json (char * buff, int len, - const struct multipath * mpp, int last){ +snprint_multipath_map_json (char * buff, int len, const struct multipath * mpp) +{ int fwd = 0; fwd += snprint_json_header(buff, len); diff --git a/libmultipath/print.h b/libmultipath/print.h index 7e36ec63..0c909e75 100644 --- a/libmultipath/print.h +++ b/libmultipath/print.h @@ -125,7 +125,7 @@ char *snprint_config(const struct config *conf, int *len, const struct _vector *hwtable, const struct _vector *mpvec); int snprint_multipath_map_json (char * buff, int len, - const struct multipath * mpp, int last); + const struct multipath * mpp); int snprint_blacklist_report (struct config *, char *, int); int snprint_wildcards (char *, int); int snprint_status (char *, int, const struct vectors *); diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c index 8a899049..371b0a79 100644 --- a/multipathd/cli_handlers.c +++ b/multipathd/cli_handlers.c @@ -237,7 +237,7 @@ show_map_json (char ** r, int * len, struct multipath * mpp, c = reply; - c += snprint_multipath_map_json(c, maxlen, mpp, 1); + c += snprint_multipath_map_json(c, maxlen, mpp); again = ((c - reply) == maxlen); REALLOC_REPLY(reply, again, maxlen); From patchwork Sat Oct 12 21:28:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187119 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 4E0A976 for ; Sat, 12 Oct 2019 21:46:24 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15F5020673 for ; Sat, 12 Oct 2019 21:46:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15F5020673 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DAF9C8125C; Sat, 12 Oct 2019 21:46:22 +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 A3180608A5; Sat, 12 Oct 2019 21:46:22 +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 0AC004EE69; Sat, 12 Oct 2019 21:46:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.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 x9CLVpxx007082 for ; Sat, 12 Oct 2019 17:31:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 56C161001B39; Sat, 12 Oct 2019 21:31:51 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB8AF10027A3; Sat, 12 Oct 2019 21:31:48 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 538C03082E90; Sat, 12 Oct 2019 21:31:47 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:30:53 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:53 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wk2+LiQS0uO4FxqIbk0I8mdzwMxTinuol4SJL500vuvFJRBAFvzFgKYPpMpiVHoKnlb+4mciMy3P5cQrqQX5/7rw+BLUkMjblk2Dnhj1rqaLg19qA5XU0+fGp7t6OYSVlh25P9AQQKHHgF1DUGSiZY0QPWyugIAQM0ziNd+7Km4qu3F243dwtFEEEOtAERoN5klAw8bzC7XjMM8FnLbTgPK6rafhEhO3E9c4PzQIsFZQRZrPa7Zb+nxYXXp4kSix9wSGS2Vzx0rDGOLIrXH8sIpQ/bnt7OzSgN3Su4RRLcjkeafStH5PpTnZtvSL0U/uNfa+9kgdrvpexGSy+t1lLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U159rrfpjzk3e6MbKjYXRRLqi55c9WDvSXI51DnrUGM=; b=UuwIpgLTjcm8JSn2geB5606xfFMX3FOIcVWhl2EQ98tYQNp5zM7stm8aLyzTyUEkz2wAdTeDip0oMuCKPtF/OqQjCFY/kA4W/aRFQoT0MLqfnaiuKhVperrSHZ7aBL5U3jvHqS25ccBke9TFsLLGKpnjC+JR6FtHi2nqQAMPWtgNosKs391+G+yMhwxGXS5Qp8lMvUT7pcr4VyMttYkT+K55Cs09eM0vCiqdVXvmxH8ke6a1XLCE/wynrPIgyPeVdMr/LvSZrtV4pNaM6kHAhN+K5MYyvcQ/AQQ7nVpYWfgCDCZF5s6khhB7lXpa9OZwvYBVPseKrsCOQUCr+TjIew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:49 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:49 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 36/72] multipath: delegate_to_multipathd: mark unused arguments Thread-Index: AQHVgUP5NHhJzsJ8XUGxlXQbOJ8Zlw== Date: Sat, 12 Oct 2019 21:28:22 +0000 Message-ID: <20191012212703.12989-37-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fba3898e-d338-47a6-7789-08d74f5b1b8e x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1850; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cEQPAPTprpZFo8rCcbVW9LNmQSh8IZqAxNudCJv9Ea44BNQq6/U2aBSkaNNouMsgQr3LGf4dBzQYgjW4NCR7RnjmqxYtGxFo/68NeLNGUgEnjGQ2GEsZm/e1/PhxM/FgI+rjhr+Zor2o6num04NtGl0sgiWIzciIAZCPTpvMBTRI+EosBoUvqN19FUmNKx5rEuzzFaF28nPbeXFsKtPm1X4vxe5lsmIGPtkbSGaFvXD0Qz3BH5nK1zuj44tFpWn4e7IXRJvcm8DR+NaqbjNyno7SBUB2KW35nvoEHZGwqOFpnkhULg6xDS65tILA3Lx81xeX9buBd2QcgHaVwnlMyfV6mFWAZIB0vl+TlYAiGcwWH9pigOJEaPUwgu6le23SIrCh0Ob83NBfHoUmTQ5BQLFniFDT81yNnk3aH6t+ap8= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: fba3898e-d338-47a6-7789-08d74f5b1b8e X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:22.1862 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GAUwcLp1t3LKs6Fko+WazkwInfWvCz4I/CcC6IbgApjEl4KutbYyw5QeGA0ov7NJCsuKMc5wFm4pCHJABobmSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sat, 12 Oct 2019 21:31:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sat, 12 Oct 2019 21:31:48 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLVpxx007082 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 36/72] multipath: delegate_to_multipathd: mark unused arguments 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sat, 12 Oct 2019 21:46:23 +0000 (UTC) From: Martin Wilck ... for now. Signed-off-by: Martin Wilck --- multipath/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/multipath/main.c b/multipath/main.c index b3f8c99b..c2ef8c7b 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -811,8 +811,10 @@ enum { NOT_DELEGATED = 1, }; -int delegate_to_multipathd(enum mpath_cmds cmd, const char *dev, - enum devtypes dev_type, const struct config *conf) +int delegate_to_multipathd(enum mpath_cmds cmd, + __attribute__((unused)) const char *dev, + __attribute__((unused)) enum devtypes dev_type, + const struct config *conf) { int fd; char command[1024], *p, *reply = NULL; From patchwork Sat Oct 12 21:28:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187089 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 84C091709 for ; Sat, 12 Oct 2019 21:34:16 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6261C20700 for ; Sat, 12 Oct 2019 21:34:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6261C20700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A87F018C4290; Sat, 12 Oct 2019 21:34:15 +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 857B960A97; Sat, 12 Oct 2019 21:34:15 +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 0D5E64EE6E; Sat, 12 Oct 2019 21:34:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUFL9006558 for ; Sat, 12 Oct 2019 17:30:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0F920F6E1; Sat, 12 Oct 2019 21:30:15 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 36D9126170; Sat, 12 Oct 2019 21:30:12 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F35A6C075BD2; Sat, 12 Oct 2019 21:30:10 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.190) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:27 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:53 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WLNotUf31yQ1rzJi14yfuVsLVbBlmMEZloysyCpPJ05G3xmLt/2FC0hzntZ63un4mcRfMLtljdsjpBjxo98YBc75W8GFzC42UjNLw5kHdZmKbkTI70yXaOvfvjeQ9r7OtPQuQGltrFsUgytR6FdSbviwBjsXXIeZbZz629AWusP2g3QF/ZATqShF/U9AeQMZDGszmC9SzC2zZMaMixG6RXZIYF8Gn1OXgHacrYZTmkyfHYzICUrWR4vLRUr7/LUivx/JkszhMb4pzCvHqwiNwEUZqMxaCP7qEgiwpvjZMHo1X6Tjdpk1dZcR9zexF9xPoxdUSwISqKor53lgW9vvIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jPyBS+pFQDHUDF9QcSsWVCZ1Y+QTOr1L32nmBAC7W0U=; b=CyDKhAc0i159A2C1Q76RfVkRLn4Fr4ERiiwNuaq75ZSCKlc6zEoTXMWmejbgEG1x8c9GgmDBWXBbpS1MfrpPDyL+4cV4Momxs/d0gwAn8mTfES2stgbtO+oN3W06IJ+dGXlOhgD2Bf1+swGXOwqtq9FQkgLfR7wu3/wCDR2m9QcLO1P+3jQR1CMsoOC82SsqEjm/SUYvKOmAofNcbvUJhmxrm0yX3KhOADKmg8h9vMzNUh7ln0Zm4Zt+t4mqhznHZnB/QJsopsWL8rWbl7t55u+R8BZ7JjJ/iGaGAhmewVm3Krr2u9bPuPyWGfKu1FIjfaloz+rRWeK1tFk1VOQWGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:49 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:49 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 37/72] libmultipath: use -Wno-unused-parameter for dict.c Thread-Index: AQHVgUP6cIQRrElOGUyaGlp5jNRM2Q== Date: Sat, 12 Oct 2019 21:28:23 +0000 Message-ID: <20191012212703.12989-38-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6ac9d71a-c45f-4661-0650-08d74f5b1c55 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1417; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HnYOMwaL4str9qOpdt1cKUpCVn9oz2yzky+ZeHwExm6NDEHw8QV6mn2PokmOothfe3ttnJfw7tfCxmE3NQqT9R/06I1Dw0DPJy1j/CDzSpxgseVCDA8ck9BT4JBUc7SMcMHoLf/tEg1+Ogmoo3MZnddXa8FvdV+6UkikCM+dAx+oC/Be7cA/UNsa4czqSMRF3w6bF5Q9SaYwrpaCUaIS9JCynjywo4BdifkufSgPj1m08zeKdq94nyvnso3sW3EjeK/3407mA8MgwySMw3r3Vbrv5T42ti4A0i1DZ7hZVAmvo+1tfQDbiKcBlItpNXPZsrzZ/ZxiI8Vr1Of2nAVNbyPhJAvvXbKPaP5HUINwTBArcvmq6w2YLQjeqd7JjcaCsl3ztYwdG8TkUcKauoHb8bzyYmdeG3ihhir9nd+hkXg= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 6ac9d71a-c45f-4661-0650-08d74f5b1c55 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:23.4785 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5IliLhjlgdz40HtcEJlI8/4UbPNA2JYidp8Klm0aGWjRYXMijE+RhC+licBAEQ5Iy5g+MBDwZHrb97WAaOBeAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:30:11 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:30:11 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUFL9006558 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 37/72] libmultipath: use -Wno-unused-parameter for dict.c 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Sat, 12 Oct 2019 21:34:16 +0000 (UTC) From: Martin Wilck This file contains just too many "handler" and "snprintf" methods which don't use every argument. Signed-off-by: Martin Wilck --- libmultipath/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libmultipath/Makefile b/libmultipath/Makefile index a2be42ea..e5651e49 100644 --- a/libmultipath/Makefile +++ b/libmultipath/Makefile @@ -50,6 +50,11 @@ all: $(LIBS) nvme-lib.o: nvme-lib.c nvme-ioctl.c nvme-ioctl.h $(CC) $(CFLAGS) -Wno-unused-function -c -o $@ $< +# there are lots of "unused parameters" in dict.c +# because not all handler / snprint methods nees all parameters +dict.o: dict.c + $(CC) $(CFLAGS) -Wno-unused-parameter -c -o $@ $< + make_static = $(shell sed '/^static/!s/^\([a-z]\{1,\} \)/static \1/' <$1 >$2) nvme-ioctl.c: nvme/nvme-ioctl.c From patchwork Sat Oct 12 21:28:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187123 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 9FDF4112B for ; Sat, 12 Oct 2019 21:46:48 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7BF2920673 for ; Sat, 12 Oct 2019 21:46:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BF2920673 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6919D3090FC5; Sat, 12 Oct 2019 21:46:47 +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 44BA75D717; Sat, 12 Oct 2019 21:46:47 +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 0D34A4EE6D; Sat, 12 Oct 2019 21:46:47 +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 x9CLVtR3007105 for ; Sat, 12 Oct 2019 17:31:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 129E060BFB; Sat, 12 Oct 2019 21:31:55 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A789360C18; Sat, 12 Oct 2019 21:31:52 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 49D9F69095; Sat, 12 Oct 2019 21:31:51 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:30:57 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:54 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U03L1OlYMi42N8Vgfw2kN4/IYUL6n6CUbrYoDtIy/5+OCqtpT/Ak9ckT0BCoos7ktO2Le0jT5SPHnNQMHWmAAwOgjNgUAj/DqIs82uoqFzRszDGYB+++rV04zS/TKDwjIb/hwpq0gPMecuFl16iDaLdyiA9LIU8UBPOTUeqToMjCnPet9Fs8o9eA1yKimLTjR4pvBN+VdW7ZSlxfpXn+ThKZWtP+17zu+yQbY5VaPv0f4eCubJiHCJL46aTVjIjNl1mH1HnsGspZPoS9uDAOT2kpNoal2S3/7Luce1RaZtHHFt98ZinNjzroplK2NQklE3wDRkX0P+ysPo1Rx+IB5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4AMozWMa/oyCOTOnoM3mE7y5yydA+XR0SF0g601C8e4=; b=K3dNrTTqqraAF4KDshsus1Twgz0B1+ZLCcB12dj8e1Ybpe6UgF/OePiZxRG5XgUgxp6sgljPYJ/TMEdtFqCj4LQ+kSCVVeNS7C/QEhIYNjl6MveQabVvvn+pRiKnXilTOf/mCgeiiTXFoX5UD8SF5yaBJ5e+jFlMDQ2SvfPDXN5xTEkpI9J002ppZYelUvkG0WMDfDDggWGKD01LWMIo++zAdDzT9JYz9bNIHoDXOueTgcANIg2SAPB3v2JwoI2wIOFIqEr6cY/CWPTYisR/z0P071X+z1uiucYfTOJn8a/3EGvKqCYeZ1cmpIQ9GAzGpK1+6KGuwxdCv14gN4osdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:50 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:50 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 38/72] multipathd: use -Wno-unused-parameter for cli_handlers.c Thread-Index: AQHVgUP6Jvab8WUjc0KZ3oIyzXKM5w== Date: Sat, 12 Oct 2019 21:28:24 +0000 Message-ID: <20191012212703.12989-39-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 61272b0f-1a87-46c8-4ff6-08d74f5b1d17 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:326; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3TCCOIYH5/3/bCwAwq8HoB/Y96/+WaB1RY3cM5Njk1Hmjooc/y0C4/Wk07xkxkUWjWjnFhXYr2f/Xfxthq1l0X/7ARTYzyyCpMENX753wQNlmyGmLntjRTXJoBqYZ1Z1tLpxgMW0/q4eymIyz6PvIHKkDYj1l0vN16HInWdDWP6eaMNPR+bnxEx+SckvIs9IEptDwzwMGRVAr8mrWvP6P263ON6cW/wVzJDIrue8JUdYMTRjGFKB8cBibSmKyw4yrIBNPzWsufZsesKRwtmGM5yEin16fGvQYi/g6rGejaLoq4Fk/1AoWUXWj3vNak2cSqekYfUNYAgao4chTxw9OjiIwisl5Zv1Yb+qar72ZSRVudZKkq0LCYnRJRzSpsKIDpvjVfQLv/72oBGmB4J/e8PIl2rsBWYoz1GY6TplEec= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 61272b0f-1a87-46c8-4ff6-08d74f5b1d17 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:24.7588 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZRVd6mzrMoYDnTonTY/kWKet0wYNUbuTDRp4PahuzcWrpfHYwamnKjvLX+EtjDSk00TJNuhtJRKqFYwmXweRpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 12 Oct 2019 21:31:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 12 Oct 2019 21:31:52 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLVtR3007105 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 38/72] multipathd: use -Wno-unused-parameter for cli_handlers.c 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sat, 12 Oct 2019 21:46:47 +0000 (UTC) From: Martin Wilck This file contains many handlers that don't use all their arguments. Signed-off-by: Martin Wilck --- multipathd/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/multipathd/Makefile b/multipathd/Makefile index d1a98637..8d901178 100644 --- a/multipathd/Makefile +++ b/multipathd/Makefile @@ -36,6 +36,9 @@ $(EXEC): $(OBJS) $(multipathdir)/libmultipath.so $(mpathcmddir)/libmpathcmd.so $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(EXEC) $(LIBDEPS) $(GZIP) $(EXEC).8 > $(EXEC).8.gz +cli_handlers.o: cli_handlers.c + $(CC) $(CFLAGS) -Wno-unused-parameter -c -o $@ $< + install: $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir) $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir) From patchwork Sat Oct 12 21:28:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187075 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 61F7614ED for ; Sat, 12 Oct 2019 21:33:32 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2EFF520700 for ; Sat, 12 Oct 2019 21:33:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2EFF520700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5D1C8883C2; Sat, 12 Oct 2019 21:33:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29BC51001DC0; Sat, 12 Oct 2019 21:33:31 +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 E902C180B76F; Sat, 12 Oct 2019 21:33:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLVuwj007121 for ; Sat, 12 Oct 2019 17:31:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id A3ECD5D721; Sat, 12 Oct 2019 21:31:56 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A2D25D717; Sat, 12 Oct 2019 21:31:56 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 193E1302C084; Sat, 12 Oct 2019 21:31:55 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:31:01 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:54 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KvZKm9nJvOi6k34HcZFRSnU1hYnDF9xIOwVp0eJsEN0FGYY+lrfgRcWyTlVilxcp/V+sLDvrd5tMChd/9j+NCJelfROxotPu6zU1XAuD97zFZ7lJgbutdLbP4Xi3FEEFzdVqpfuSzatjP92pl33R/NPXbcfhRtOYLHGFvmWh582rr2/XBSS+9r09xo6H6YjWbLhx0DuKHmuT5Zjn1ZCXKnphPNEBMOa7QPrNl5eWJDKjf5B/Uja93X28bvrkt7MXCthMacfpecho7bzPkvYRka5UJc8ekbKOigXAm/8sZFmDvZ4WSqnHL4yPPIw/N0N1GnVSk3C4Zs8syI9ahVniDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PHlkp08IDc+t0vZ2CZ2oY4Ci9UrURO0OgyEVg5vF86c=; b=nKPdSIGrNbV/kX0RK2axdb4IYrQ1zfPkSCycOuHc5A0HKErogf6+qqeSNw6PRFK3DRbNKjOkhgKQ2xNsiYRBUNSdfAIIAU5valkhAJHj8AdAIBglxA59zqT+QAIvYK2K3N7TeI0u5iiFW7Puy+cqbRldjCYdIsiTSP8L12evGYTBgbSFufeNJJFH7loC6z8hogivZ/WBU52iPoUWDxN9RYLrNOQy2kJ6UR2713aj997CJwyEI5Xwfwf1EwakDt1aJbzs5CEuOWDvMcZ9VwTLJs63kOrSm9W0Y5POhWFgIlKDLoUJNHZJdWbCyQgOR91Qk9smNttnp9R3XgUgj36kTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:50 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:50 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 39/72] libmpathpersist: remove unused "noisy" argument in various functions Thread-Index: AQHVgUP7n9TkEVHQO0mf4HwzSjUFFg== Date: Sat, 12 Oct 2019 21:28:25 +0000 Message-ID: <20191012212703.12989-40-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c3a7820f-fe6f-4b99-0a36-08d74f5b1ddc x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:104; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0iBUThhDialEFSBZw/zRTLMKK+madzOQ1smTcuzzdYcngtvZP3oWpA0jUCWU0U28y9rRR/pz7uEwHnlPWIy4kmNFEyrAnCO/hxwjXhTX6pe1cZZuLxoIWef+GApvn/loSfn0f4Ig0DjZ+vXUIlk+TCibUVG5hx2Ig+4d9SknS4JX0hRQ/6igkJCQ8Jbx3wwebpAMW/0sJjet103HuwqvnRV3lZbjfQ+FsVQyCfEfgLzbpcoqh9k7YmTF/tSD35Ml9Reel4LjZA8MHVG1079rD74Z06B0RjIswPk/GN/NV64H+kNrhwFer5Zb0fvXWz2B8Lx4mLredkrRzF/trEYAOlnNUjoNuvstoPM/1kZKvRKYN/aJ8xZ0S4EoJLuZhMbU/nOahcDbjOR/dkE66A2JovlZK2NnfbxP9a25d2IULEw= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c3a7820f-fe6f-4b99-0a36-08d74f5b1ddc X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:25.9461 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: i40xT61eMiXIJjWBW+WOguTPnJRK72FXUK1nzRF5YDaCbPk0JQqiiXpS/dfDHkf2+q14kwzdzPqV0s0zqnigKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sat, 12 Oct 2019 21:31:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sat, 12 Oct 2019 21:31:56 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLVuwj007121 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 39/72] libmpathpersist: remove unused "noisy" argument in various functions 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 12 Oct 2019 21:33:31 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmpathpersist/mpath_pr_ioctl.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/libmpathpersist/mpath_pr_ioctl.c b/libmpathpersist/mpath_pr_ioctl.c index cf528feb..209892f6 100644 --- a/libmpathpersist/mpath_pr_ioctl.c +++ b/libmpathpersist/mpath_pr_ioctl.c @@ -23,10 +23,8 @@ #define MAXRETRY 5 int prin_do_scsi_ioctl(char * dev, int rq_servact, struct prin_resp *resp, int noisy); -void mpath_format_readkeys(struct prin_resp *pr_buff, int len , int noisy); -void mpath_format_readfullstatus(struct prin_resp *pr_buff, int len, int noisy); int mpath_translate_response (char * dev, struct sg_io_hdr io_hdr, - SenseData_t *Sensedata, int noisy); + SenseData_t *Sensedata); void dumpHex(const char* str, int len, int no_ascii); int prout_do_scsi_ioctl( char * dev, int rq_servact, int rq_scope, unsigned int rq_type, struct prout_param_descriptor *paramp, int noisy); @@ -115,7 +113,7 @@ retry : condlog(4, "%s: Duration=%u (ms)", dev, io_hdr.duration); - status = mpath_translate_response(dev, io_hdr, &Sensedata, noisy); + status = mpath_translate_response(dev, io_hdr, &Sensedata); condlog(3, "%s: status = %d", dev, status); if (status == MPATH_PR_SENSE_UNIT_ATTENTION && (retry > 0)) @@ -181,13 +179,13 @@ uint32_t format_transportids(struct prout_param_descriptor *paramp) return buff_offset; } -void mpath_format_readkeys( struct prin_resp *pr_buff, int len, int noisy) +static void mpath_format_readkeys(struct prin_resp *pr_buff) { convert_be32_to_cpu(&pr_buff->prin_descriptor.prin_readkeys.prgeneration); convert_be32_to_cpu(&pr_buff->prin_descriptor.prin_readkeys.additional_length); } -void mpath_format_readresv(struct prin_resp *pr_buff, int len, int noisy) +static void mpath_format_readresv(struct prin_resp *pr_buff) { convert_be32_to_cpu(&pr_buff->prin_descriptor.prin_readkeys.prgeneration); @@ -196,7 +194,7 @@ void mpath_format_readresv(struct prin_resp *pr_buff, int len, int noisy) return; } -void mpath_format_reportcapabilities(struct prin_resp *pr_buff, int len, int noisy) +static void mpath_format_reportcapabilities(struct prin_resp *pr_buff) { convert_be16_to_cpu(&pr_buff->prin_descriptor.prin_readcap.length); convert_be16_to_cpu(&pr_buff->prin_descriptor.prin_readcap.pr_type_mask); @@ -204,7 +202,7 @@ void mpath_format_reportcapabilities(struct prin_resp *pr_buff, int len, int noi return; } -void mpath_format_readfullstatus(struct prin_resp *pr_buff, int len, int noisy) +static void mpath_format_readfullstatus(struct prin_resp *pr_buff) { int num, k, tid_len_len=0; uint32_t fdesc_count=0; @@ -361,7 +359,7 @@ retry : condlog(3, "%s: duration = %u (ms)", dev, io_hdr.duration); condlog(4, "%s: persistent reservation in: requested %d bytes but got %d bytes)", dev, mx_resp_len, got); - status = mpath_translate_response(dev, io_hdr, &Sensedata, noisy); + status = mpath_translate_response(dev, io_hdr, &Sensedata); if (status == MPATH_PR_SENSE_UNIT_ATTENTION && (retry > 0)) { @@ -389,16 +387,16 @@ retry : switch (rq_servact) { case MPATH_PRIN_RKEY_SA : - mpath_format_readkeys(resp, got, noisy); + mpath_format_readkeys(resp); break; case MPATH_PRIN_RRES_SA : - mpath_format_readresv(resp, got, noisy); + mpath_format_readresv(resp); break; case MPATH_PRIN_RCAP_SA : - mpath_format_reportcapabilities(resp, got, noisy); + mpath_format_reportcapabilities(resp); break; case MPATH_PRIN_RFSTAT_SA : - mpath_format_readfullstatus(resp, got, noisy); + mpath_format_readfullstatus(resp); } out: @@ -407,7 +405,7 @@ out: } int mpath_translate_response (char * dev, struct sg_io_hdr io_hdr, - SenseData_t *Sensedata, int noisy) + SenseData_t *Sensedata) { condlog(3, "%s: status driver:%02x host:%02x scsi:%02x", dev, io_hdr.driver_status, io_hdr.host_status ,io_hdr.status); From patchwork Sat Oct 12 21:28:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187127 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 5907076 for ; Sat, 12 Oct 2019 21:47:26 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3680B20673 for ; Sat, 12 Oct 2019 21:47:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3680B20673 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1CA7410CC1E4; Sat, 12 Oct 2019 21:47:25 +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 EEDC2608A5; Sat, 12 Oct 2019 21:47:24 +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 B55454EE69; Sat, 12 Oct 2019 21:47:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLW2Df007141 for ; Sat, 12 Oct 2019 17:32:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id D231660468; Sat, 12 Oct 2019 21:32:02 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx23.extmail.prod.ext.phx2.redhat.com [10.5.110.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7D5316017E; Sat, 12 Oct 2019 21:32:00 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0BBBC1056F8F; Sat, 12 Oct 2019 21:31:59 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:31:05 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:55 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GYEIBbhi1LVuJl/H75G9xXv4E5EBFRYpdj5y+zqU3SBPl3HkcyMNsJf+LBepos7Jj3cAmtt+MAwWUQizwbvxfmAE5DdnkWyxpfPaWsw6SH9ohBb+3z4DEXrAdSDjzgxCbvfTIu2gscv4ilKln7RUVCn2DamhpRyEhxTw7qVEsshlvEucvP6MVQgpNoAvepbuZ9oqHyBzdVhFPheeTnW7salM5mSnZRsed0x5WlYaKO1ubyX94RYyI+RgLwRsa0f1xRLT88Blnh6BgKpX8K3cp7XgIwLmIi+oxjPBiTADfacqQZUHwvSCXgxIiU9JSyEZKJHTeIjQ6bCO87+vIRMyYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PzehQcr6XhR59XkuZ8b28tHqiMu+68QegYqOU7vxmu0=; b=BulV1RQ7NVi7yPOzkwEsgeqVynInvir6nfDtuOS0iX7900ZWUJydlwscgmncQmYhuaNVmPuh6tJieW5PHwir4pT79tEWx3oWN74kfdiN8S3zkOHTdTp59Xg2abV+8zMgqUZxyGnVsCgeJTepteIPR+8T6zEGt6Y8V7Um9dqtD1wekSkABocEMKvG9yVBZUuY85Rkc9O/+f5mfoB8OgfTzSHD5+u+MswS0klMoA35iEvl5aALAqsfCOh28STyFXntgpnEYT31cUtrD8v4svPKwTpUCcT1a38LVyNstdq+I94gPWCYvQpJFaA/xB2JZYPp0MalZtGz9zFgNoxXOXuPRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:51 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:51 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 40/72] libmpathpersist: fix copy-paste error in mpath_format_readresv() Thread-Index: AQHVgUP81wjpo5ZFmU2s8Y3Vv6JHpA== Date: Sat, 12 Oct 2019 21:28:27 +0000 Message-ID: <20191012212703.12989-41-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8989bbca-f9b8-4d87-88f0-08d74f5b1e8f x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wfvYzh6ax3NDj/Yvnh2ihJ/1GWHoFWpTRB/k3iVqmh1oNKVOWdRIMqdFq2GVaEBjR7Om4yU62OMGXGQAycQGT60cKWyJc4X2+RQFL2ruP6+SNQVVnIaBmWtvARvUtOh0JTceRxuHjSR9sGrfCdaJsWmM6jyyaBI7pC9MlZX0wgunnIgZ+/H2DQApJgdnR7LDD6Wiui+WiWGB9EdYlx8nezXu3bJOQqBogjPgZVIj1A9Bfs82a2OadsOZlknkmBq1UItXzQ122/rf7YUhnB2bQJe+8eZIdfuRuI7WkDHd53xGOMCKFWmxH+xSSwYkG3lZnTripkMhZLzJCIbY3HFuVUeKX9C6CYD+xH5ZRmKgn3yXIqjNJFfCmqjF1/pIteE18J9EpPEKfBqzut06zUcGYpR0KPQV07fMwsHRgByoS/g= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 8989bbca-f9b8-4d87-88f0-08d74f5b1e8f X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:27.2144 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dvy3Y8h7sbbjtJ+t7xISXou4Axu/eM9lmp/ilfa3OO0GhvylfXGfoZoS8H9VkGvR1flqRv6iwtgSBbIXrj6OEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Sat, 12 Oct 2019 21:31:59 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Sat, 12 Oct 2019 21:31:59 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.64 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLW2Df007141 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 40/72] libmpathpersist: fix copy-paste error in mpath_format_readresv() 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Sat, 12 Oct 2019 21:47:25 +0000 (UTC) From: Martin Wilck This would swap bytes for the wrong field. Signed-off-by: Martin Wilck --- libmpathpersist/mpath_pr_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpathpersist/mpath_pr_ioctl.c b/libmpathpersist/mpath_pr_ioctl.c index 209892f6..05b30b56 100644 --- a/libmpathpersist/mpath_pr_ioctl.c +++ b/libmpathpersist/mpath_pr_ioctl.c @@ -188,8 +188,8 @@ static void mpath_format_readkeys(struct prin_resp *pr_buff) static void mpath_format_readresv(struct prin_resp *pr_buff) { - convert_be32_to_cpu(&pr_buff->prin_descriptor.prin_readkeys.prgeneration); - convert_be32_to_cpu(&pr_buff->prin_descriptor.prin_readkeys.additional_length); + convert_be32_to_cpu(&pr_buff->prin_descriptor.prin_readresv.prgeneration); + convert_be32_to_cpu(&pr_buff->prin_descriptor.prin_readresv.additional_length); return; } From patchwork Sat Oct 12 21:28:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187131 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 CAADF112B for ; Sat, 12 Oct 2019 21:47:45 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A759D20673 for ; Sat, 12 Oct 2019 21:47:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A759D20673 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 928E73066EB9; Sat, 12 Oct 2019 21:47:44 +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 7349C5D6A3; Sat, 12 Oct 2019 21:47:44 +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 3AD674EE6A; Sat, 12 Oct 2019 21:47:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLW452007148 for ; Sat, 12 Oct 2019 17:32:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 59B01601B3; Sat, 12 Oct 2019 21:32:04 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx24.extmail.prod.ext.phx2.redhat.com [10.5.110.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 50C4D6017E; Sat, 12 Oct 2019 21:32:04 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D949B10CC1E0; Sat, 12 Oct 2019 21:32:02 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:31:09 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:55 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KmRnAr3erZi2usTpKgCI5us798lgydJYGJof58VMLSXORCXHTACNzJrNnKmpRFHJxil6U6UtP7FdJJngqIGRzjGzvBTnRI9TVDIgig6FiOpR0rm5v09qStS3sRhk3MvhXY7dLGwHp7bQLS+7yc95uIZvj+Bo/iDH61JbDsJxRCQvqScnLJIxWU798UeTO+jyFpaFU6jdLms9gGdpXrraAHVTLBX/wr92VY4CsfC7XU+rh+/rMDGwebsxX6jQm0PM7jlpIPXg0h9KkkadW2lut3a1KsCo0AKnIA0Yer00Mt3GcKuNIV9KrjyGv0tuHwRTSBpZjuGRsB6jY66u4dvNAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CAodbElx5YoySF2fPj1YFFWXE796u6IwWZjvWLOgKUw=; b=ogu1PNcPGJig7nwiyxpx3LMS8k6E38vv2lrXYcxCxzIlRWgXaTLUMTMhZOYk4Z9C3f88DYFoiCgEVdCdbyEv+u9yJU9GtlI7wBInx4mkjaxE8A4wUFeDXSWbZtRuPsvP5rvGiXJB2KXUniZN9561tf1Rdo2YroOvF+r5Q3MFiGrHmNIpH10n4R3ri9vU5Sicqvap02Ccs3zMaCtuVEaJPaDGJPmT5+0BdPa1WksIJqf1w2rqeM3kgQNHNZ5pYCgQyomc9qTvSfQiLoJxPZ56nuzUyxaItROVJYJl3AjIHS+0yO86tpsOKOYqOTubzr4aH2jhKVkj0+CDDc+o7JOPcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:51 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:51 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 41/72] multipath-tools tests: add -Wno-unused-parameter Thread-Index: AQHVgUP8opJncuXnX0OxbqXphvLM1Q== Date: Sat, 12 Oct 2019 21:28:28 +0000 Message-ID: <20191012212703.12989-42-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9fb7c8bd-f20d-46e1-0f5b-08d74f5b1f51 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:107; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3ivr45owSM2ANWpSdSox/wAtrsNP8il8qMPJwcVS4UJjqz60XOZDQTba6UfYifFZ27KzMvFh5I5zSwMlMX4DxlxbZkcIn48tHjq5dyP6FVhyzQa4E7b9I9rkHcacqGMtYez4Ly6ndGeM7YKi/dxUW1WOjrtmYPBzhZtvaQnVhaGRs5VvD7cOsOphEwOkyVj3b0QDr9wyFZ1MdxGtE148HqkiafqlP36m7IxukQVgEXiWzY9TwYsB/keDM6WLwQuO08P//yzh4L143rSAbnRFUmIfWF+ntNlr2+w2q/MHr0u5WSwpli4/0OMWc0X3Doop1sFsxnm3ur8hO1CEacyy79gS3i+MUWRQx7fRD5FFOG6H1UvHTLJ5VJp5LeMADA6+pjot0AjOpnqM3Kdo6Ski2vEasfxhBy4aLWE+eHBLXFQ= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 9fb7c8bd-f20d-46e1-0f5b-08d74f5b1f51 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:28.4887 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +8bZ+p761YhGJI/V+wYpF2BW9FmhnoUUIgxDIugMAvflMy85rkNpQhSZ4S9a6DI4kanUlai0BkIidGN8NS9JRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Sat, 12 Oct 2019 21:32:03 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Sat, 12 Oct 2019 21:32:03 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.65 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLW452007148 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 41/72] multipath-tools tests: add -Wno-unused-parameter 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 12 Oct 2019 21:47:44 +0000 (UTC) From: Martin Wilck Too many unused "void **state" parameters unders tests. Signed-off-by: Martin Wilck --- tests/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index 0dce8571..60338f14 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,6 +1,6 @@ include ../Makefile.inc -CFLAGS += $(BIN_CFLAGS) -I$(multipathdir) -I$(mpathcmddir) +CFLAGS += $(BIN_CFLAGS) -I$(multipathdir) -I$(mpathcmddir) -Wno-unused-parameter LIBDEPS += -L$(multipathdir) -lmultipath -lcmocka TESTS := uevent parser util dmevents hwtable blacklist unaligned vpd pgpolicy alias @@ -56,6 +56,7 @@ dep_clean: @sed -n 's/^.*__wrap_\([a-zA-Z0-9_]*\).*$$/-Wl,--wrap=\1/p' $< | \ sort -u | tr '\n' ' ' >$@ + # COLON will get expanded during second expansion below COLON:=: .SECONDEXPANSION: From patchwork Sat Oct 12 21:28:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187121 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 9661076 for ; Sat, 12 Oct 2019 21:46:35 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 703BC20673 for ; Sat, 12 Oct 2019 21:46:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 703BC20673 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5AB2E10DCC8B; Sat, 12 Oct 2019 21:46:34 +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 2F54E5D717; Sat, 12 Oct 2019 21:46:34 +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 F03E94EE69; Sat, 12 Oct 2019 21:46:33 +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 x9CLW7V7007170 for ; Sat, 12 Oct 2019 17:32:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id EB5CA60BFB; Sat, 12 Oct 2019 21:32:07 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx26.extmail.prod.ext.phx2.redhat.com [10.5.110.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E18CA60BF4; Sat, 12 Oct 2019 21:32:07 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B2FEE80166A; Sat, 12 Oct 2019 21:32:06 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:31:13 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:56 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SQtmxio6MnDkhuxuKMN1lukk0BZ0Ev6X9pZWgZ47mMgQlnP78d9Mja7/ajbKNqs1ny5nCrFrBXLUQOKmQC25bgti53/LBIS4snYItYGeK7RZh1IevuSt4zm9AMg/tglQUwZnWun6Ajfw0YpW7Sop6bPNpoaIRrW6cMhTx1AFb+t/ds88896YNrP06Q4umQ4MWMye/RyhJ2eKFPNrqpPc6j+u5CqOdsQs8bnos+qsoyluMRZMQRgE3tKIBZgyaisPR+X2Zb7gv4RIg70Jsoe/Met69nwVKMOeKtzJIMZsgbABlXthKgVwycvf5rUt6+PLxZTbJzJvnORCclTz++TJoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+/Ghb7PMm83wXHSb5YNDgtR+QCrCJLhPLGcKqC4bigI=; b=jMRAdNgXtuFy86xSAOxvw3ocXVv+48E54o3wfBzPbqUWcencHhlRDVKjyJGqrIZRSLeBJ6nVzc5vXjk+YUzxpmb9EvD7w939ZLfYx4PSyb/Z9PMIxACUsw4JPVu8fMOoGQW+yws/RvabUK7jWdZ14UI6ZE0HghxS5771Uug5nanpAz6QPyx2ZaCnm8KydFSq5rkjS7plTRw9YyCXs5AjCyCe+tK6dvFdB1vAFZmlIQBdYgWDpePQZcBrplNjJ8D3KC7AM5fLC3UoFRUNkCR0KM6Yoe1t3e4QYkyQvoQINrYTlYUkhzMPq72rSxtLIK9vD2ID5cs5otrPyH40bw5EbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:52 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:52 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 42/72] multipath-tools: Makefile.inc: remove -Wno-unused-parameter Thread-Index: AQHVgUP9k2SzaOFSRUuJzlkTumqk9g== Date: Sat, 12 Oct 2019 21:28:29 +0000 Message-ID: <20191012212703.12989-43-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2d288715-e06f-46c3-47b0-08d74f5b2012 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:256; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /7dy/ThMfqDtbY8eYte8F3jIuDBZ2HYFiIH+DyM92geLbSPC9YsBvsV0LmTumVzRhjXpN+2W0FRZob2DAB8q5v8qiPCblR4tGi3AcDymhzQeexno7TGXUX891xwrCIoerwIMX/A5gp1X43WGPsTYESgzsBHvo+scYnJ48OmZm7VEUAsAYiXeyly2wr0Mtmqpfl5HA2IMuMzsmzHVa1wdsa2LXydIxm0ymuiL0P67P2e7DQYEiB1fCqFS5rgwfbiyCu/Fh8DcSdSzXm1CaGOIeEdnurt+Zz6sLP+n31Rh8Rn9HY4dTI2vfyx6MmdFxfrsd4Hoswmbp/o9H/IwrdalNcWR2zRbqW9UTbAY5Z28Zj5AQQe71KiB2RAnRdrkxxcDnO8i5ZktDwzqR20QRCDxkyQqqegOqzoFO1M0vEkoUFU= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 2d288715-e06f-46c3-47b0-08d74f5b2012 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:29.7440 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8hsiY/0eIAOdBOgnAo7Q7jMGBYWahWrccOUwMDk0tLhamWKz8lFpx2f7ZEJi9iN2zgDCSc78Ieg7TERE9X2LAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Sat, 12 Oct 2019 21:32:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Sat, 12 Oct 2019 21:32:07 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.67 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLW7V7007170 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 42/72] multipath-tools: Makefile.inc: remove -Wno-unused-parameter 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Sat, 12 Oct 2019 21:46:34 +0000 (UTC) From: Martin Wilck All warnings have been eliminated now. Signed-off-by: Martin Wilck --- Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc index 56c3eda0..da9a3d7d 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -93,7 +93,7 @@ ERROR_DISCARDED_QUALIFIERS := $(call TEST_CC_OPTION,-Werror=discarded-qualifiers OPTFLAGS = -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \ -Werror=implicit-function-declaration -Werror=format-security \ - -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered \ + -Wno-sign-compare -Wno-clobbered \ -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ -Wp,-D_FORTIFY_SOURCE=2 $(STACKPROT) \ --param=ssp-buffer-size=4 From patchwork Sat Oct 12 21:28:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187085 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 C09F318B7 for ; Sat, 12 Oct 2019 21:33:55 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9DACD2089C for ; Sat, 12 Oct 2019 21:33:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DACD2089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF6E718CB91A; Sat, 12 Oct 2019 21:33:54 +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 BBD14F6E1; Sat, 12 Oct 2019 21:33:54 +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 8F6A14EE6A; Sat, 12 Oct 2019 21:33:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLWEIu007201 for ; Sat, 12 Oct 2019 17:32:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9C64B608A5; Sat, 12 Oct 2019 21:32:14 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51280614C1; Sat, 12 Oct 2019 21:32:12 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A017300D219; Sat, 12 Oct 2019 21:32:10 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:31:16 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:56 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FiCLQminW5r22k13IN/jjr7oCl7dzCymuZIv7eDgajF7boYwn+ea37+ZlLYqD2JiOsNuindXtshvNITbnoDj3a/GrjO9HgedNe2/yYmJxK0ueBkIk+yoFq3ZM3qNGzLdueFDOab4h2wWh7DFUYYUHueW3eZV6DsPA0tCRrKZsnyJlYE9k9bjittI9z6pBBj1/OszECEIGcIHXgOTbDtggdTmr62UZlkvQ3Vuo6JHUIbg12jRw4AIsQ7oLVyz633/G4Bm9YwLVm8GZvyZth3cDpYaYrzQGq2hLM7Gof3jffY0c9fildiz+uVnhro0wKTLmR/9nqfp2B1QWOEcMKpD0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=faKryIjIPQ8OlmFrR/l6HS3S+5Z2dcxqIZE8RNBizEk=; b=HTMdeyh4DF42paaeQ/PuNvZQ+/vtAvd8nuqYXXuBbQ736nYCtPid5nt7d7tfkbt5D40SRA5d5YMBxr1ON39eZfFeeaMjGZFhb9OR7j8bZNwTdcr9FRlxTKfgnwz03g+Kv/BUujUijEgMjSGYmZGJqAP41ox7/x5nFyZMWRfKGahxdVvLJWITqq0ICH5/6MdUxtsnLha/wS2Fy4TgPTmUDyAZWIaj3p6yRODiiMLb+EYr0VnUp0c4kF23WJTZgZBbNZs1eUkZf72U2NfIKXWu0L3i/SEJTWdaZQD7mbtis8UWWijrkzrUQJqNag8GHMUmh6QBVHcJzQgagX75gX9kjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:52 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:52 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 43/72] libmultipath: dev_loss_tmo is unsigned Thread-Index: AQHVgUP+4Qw4ZbbjPUyr3guZtEcXsQ== Date: Sat, 12 Oct 2019 21:28:31 +0000 Message-ID: <20191012212703.12989-44-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 31797ed3-00c4-47c3-e2a9-08d74f5b20e4 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:639; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(979002)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IsElujCpPsLo6IHJV9FzBI9ECQ/1TrloEcCp9Bfei5KDYqmrSSj+K3LJFIorDGOI8odcMnTmVn2dCilfup6/BMzXeqjy/cOziRK8+QxuaXGtjdcvdpUeFQbD7TUnOn2oBIcID8VT/n00NpB/s/3STQ+FuIRk80e1cVDbMCiy/RN64Xc6R0FMZQsmW0a7MZxZq2MxnoB/oT5zITYOo4AYLer/561dq1RdtynGfPOpwZWJCTw1zYw5pGMEkFq1uQHKafh+/SJmioO5ENJEB252Jb72eT7ZKNt5DTxA5kUkNZfIUc0FFfkUvb8ULwH9Cet3cD19NtjJrsh4KLbzvBN6ryProboV+sYRDQ2I8BXftOGckM2RHy1oTjafMjk7iXZ+YpM7uUl9rWzfgD+J3YugPtiBSXzxgM/OhJfia3Y07aY= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 31797ed3-00c4-47c3-e2a9-08d74f5b20e4 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:31.0083 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: HKGZinnEWAttXKxjaj9pZtmmUoq69AQehVS1Aq+H3bfnkNLfsaJ/V14OyeW8as65BgWFtPTYQTTpYddmX8HVtA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Sat, 12 Oct 2019 21:32:11 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Sat, 12 Oct 2019 21:32:11 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.40 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLWEIu007201 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 43/72] libmultipath: dev_loss_tmo is unsigned 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Sat, 12 Oct 2019 21:33:55 +0000 (UTC) From: Martin Wilck Make MAX_DEV_LOSS_TMO reflect the fact that the kernel supports timeouts up to UINT_MAX, and fix comparisons in discovery.c. Cc: Hannes Reinecke Signed-off-by: Martin Wilck --- libmultipath/defaults.h | 4 +++- libmultipath/discovery.c | 13 ++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h index 4dfe007c..d7034655 100644 --- a/libmultipath/defaults.h +++ b/libmultipath/defaults.h @@ -1,5 +1,7 @@ #ifndef _DEFAULTS_H #define _DEFAULTS_H +#include + /* * If you add or modify a value also update multipath/multipath.conf.5 * and the TEMPLATE in libmultipath/hwtable.c @@ -55,7 +57,7 @@ #define DEFAULT_CHECKINT 5 #define MAX_CHECKINT(a) (a << 2) -#define MAX_DEV_LOSS_TMO 0x7FFFFFFF +#define MAX_DEV_LOSS_TMO UINT_MAX #define DEFAULT_PIDFILE "/" RUN_DIR "/multipathd.pid" #define DEFAULT_SOCKET "/org/kernel/linux/storage/multipathd" #define DEFAULT_CONFIGFILE "/etc/multipath.conf" diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 4d93c91b..5fbc2ac7 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -624,9 +624,10 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp) mpp->fast_io_fail != MP_FAST_IO_FAIL_ZERO && mpp->fast_io_fail != MP_FAST_IO_FAIL_OFF) { /* Check if we need to temporarily increase dev_loss_tmo */ - if (mpp->fast_io_fail >= tmo) { + if ((unsigned int)mpp->fast_io_fail >= tmo) { /* Increase dev_loss_tmo temporarily */ - snprintf(value, 16, "%u", mpp->fast_io_fail + 1); + snprintf(value, sizeof(value), "%u", + (unsigned int)mpp->fast_io_fail + 1); ret = sysfs_attr_set_value(rport_dev, "dev_loss_tmo", value, strlen(value)); if (ret <= 0) { @@ -757,10 +758,11 @@ sysfs_set_scsi_tmo (struct multipath *mpp, int checkint) { struct path *pp; int i; - int dev_loss_tmo = mpp->dev_loss; + unsigned int dev_loss_tmo = mpp->dev_loss; if (mpp->no_path_retry > 0) { - uint64_t no_path_retry_tmo = (uint64_t)mpp->no_path_retry * checkint; + uint64_t no_path_retry_tmo = + (uint64_t)mpp->no_path_retry * checkint; if (no_path_retry_tmo > MAX_DEV_LOSS_TMO) no_path_retry_tmo = MAX_DEV_LOSS_TMO; @@ -774,7 +776,8 @@ sysfs_set_scsi_tmo (struct multipath *mpp, int checkint) mpp->alias, dev_loss_tmo); } mpp->dev_loss = dev_loss_tmo; - if (mpp->dev_loss && mpp->fast_io_fail >= (int)mpp->dev_loss) { + if (mpp->dev_loss && mpp->fast_io_fail > 0 && + (unsigned int)mpp->fast_io_fail >= mpp->dev_loss) { condlog(3, "%s: turning off fast_io_fail (%d is not smaller than dev_loss_tmo)", mpp->alias, mpp->fast_io_fail); mpp->fast_io_fail = MP_FAST_IO_FAIL_OFF; From patchwork Sat Oct 12 21:28:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187091 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 939A718B7 for ; Sat, 12 Oct 2019 21:34:16 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 71CEE2089C for ; Sat, 12 Oct 2019 21:34:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 71CEE2089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7D7B718C8927; Sat, 12 Oct 2019 21:34:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5C9605C223; Sat, 12 Oct 2019 21:34:15 +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 2CBFA180B76F; Sat, 12 Oct 2019 21:34:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLWJxI007225 for ; Sat, 12 Oct 2019 17:32:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0F04E5C22F; Sat, 12 Oct 2019 21:32:19 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx21.extmail.prod.ext.phx2.redhat.com [10.5.110.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C14E66374D; Sat, 12 Oct 2019 21:32:16 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AEB6F18C4273; Sat, 12 Oct 2019 21:32:14 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:31:21 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:57 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EvP3EFNnAiWf2KMDvgLyB/iAgNwsaJq63XQ24JIJ2alTEJ91thGiGmkprcRWi16ZOaiXl4PUpjEEJTSBtA+5Uafe8KPgk9LTlUSuSosvbQpZ4ZDb7rcWW+/I2VOFh2UJ21m8ehQuowr9WPpEA1cuNJ6nj3GEwpTEr3iENPxvl3lARvxNffd358ONwKHeckRmGDEY0wCtpLNLA3RtXObhJO3P6npE6X2h8uK5ANW60qZsjf2/Jvhb+7s3zsbVttOX5Tk94cqIJqJi8bVzWP/IgNpdAqS+G1TByjrKCxjpOTPGrKueE2RXbpXmgLTIA1Rb1YlsKZhNml15/U0SOz/eTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1MHXUjGUZe++3W/0RPurVrzwL4qONYLoKtR5NasOYg0=; b=nrPjk4Zx8HbMb4mo7k4sRhHB2kdYfCvyDB3SGibNoCOUnvlWXR1qtGVzN9F/QNwIxnhlCmZV6s4hnj+/4bIhOPcKebWKeqzfdCvtUBBlOFCd4ts42C0OFk3wlvsotluHY4mTDWsJBEpqZsCGmVRpjGggLLWYOifMDRjy3iX7knqdJJR6nxj6btey7AM8DwBYNVTueiYmZ6WuS2m0vAzGAn1PQeHKiJBPka9YR3nbogTEV/PZP50akoArVTVb5uCieapEXx+F7RdYRPY7bhZJy9dQ3atMWqeDXvbUYLMJeU+2/gnqH5FgUnCiYPnjN9cjIMRPLcSlVMPycEtn1g1QSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:53 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:53 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 44/72] libmultipath: trivial changes for -Wsign-compare Thread-Index: AQHVgUP/BS2mDlu0RkGg7zeJY8igJg== Date: Sat, 12 Oct 2019 21:28:32 +0000 Message-ID: <20191012212703.12989-45-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 306c43f9-cceb-45f1-20b3-08d74f5b2192 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1079; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(30864003)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: W6I5xvVoEqnoSt3BH/K/4L22kirs60aG0pkZyogvD+Mj7nUMTalxPO2tPfJqF9xr7KvKZUy9vKBdFlk8LGywszpoisu2kToczQj+whcKCqL20cOw5s0ofjGLTpBg9YUmArC0eC713MmKWUts87O7LPCkY/4VrEO2Y12Jm63Qea362e4ZmRDrBbiSawzzlF1q2ahfLfOi7J2Cla1Wp3Qww5HKMKwEY1diuQKwLmYyCqTiorQ6veiwRuSy5YXbMwf0LbWu1uUkwKvK0b/L8mCsy0wjsOplKJd4jm3eq0aEIp4WB8Vpx2P+RLOrqM+5a65pUlkWDFp1hryVQAl2onWqPVpC9Y8uYzSF6NOdmf6nFLHRX+kQIkQKBXefHyYOLgOskukLaevKj7I3f4zUqdto+4r4A/M5Y4y8lrACLYxNvV8= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 306c43f9-cceb-45f1-20b3-08d74f5b2192 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:32.1746 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WBrr5oGtc3cW322CMOTwTWXc1R1F6XCp4XQ+iB0VvZ3hx+XKGK4Y+75GIVp6zO2lHqD80594qxLOUVyDivjNJg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Sat, 12 Oct 2019 21:32:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Sat, 12 Oct 2019 21:32:15 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.62 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLWJxI007225 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 44/72] libmultipath: trivial changes for -Wsign-compare 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Sat, 12 Oct 2019 21:34:15 +0000 (UTC) From: Martin Wilck All these are obious fixes. Signed-off-by: Martin Wilck --- libmultipath/alias.c | 2 +- libmultipath/devmapper.c | 3 ++- libmultipath/discovery.c | 17 ++++++++++------- libmultipath/file.c | 3 ++- libmultipath/foreign.c | 2 +- libmultipath/parser.c | 2 +- libmultipath/prioritizers/alua_rtpg.c | 2 +- libmultipath/prioritizers/ana.c | 7 ++++--- libmultipath/structs.c | 4 ++-- libmultipath/structs.h | 3 ++- libmultipath/sysfs.c | 6 +++--- libmultipath/time-util.c | 6 +++--- libmultipath/uevent.c | 3 ++- libmultipath/util.c | 4 ++-- libmultipath/util.h | 4 +++- libmultipath/uxsock.c | 3 ++- libmultipath/wwids.c | 4 ++-- multipathd/main.c | 6 ++++-- multipathd/pidfile.c | 2 +- 19 files changed, 48 insertions(+), 35 deletions(-) diff --git a/libmultipath/alias.c b/libmultipath/alias.c index 0fc9e542..14401cae 100644 --- a/libmultipath/alias.c +++ b/libmultipath/alias.c @@ -256,7 +256,7 @@ allocate_binding(int fd, const char *wwid, int id, const char *prefix) strerror(errno)); return NULL; } - if (write(fd, buf, strlen(buf)) != strlen(buf)){ + if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)){ condlog(0, "Cannot write binding to bindings file : %s", strerror(errno)); /* clear partial write */ diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index f478ac2d..4bff37d0 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -1561,7 +1561,8 @@ int dm_reassign(const char *mapname) struct dm_task *dmt; struct dm_info info; char dev_t[32], dm_dep[32]; - int r = 0, i; + int r = 0; + unsigned int i; if (dm_dev_t(mapname, &dev_t[0], 32)) { condlog(3, "%s: failed to get device number", mapname); diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 5fbc2ac7..c6c57430 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -224,7 +224,7 @@ out: ssize_t \ sysfs_get_##fname (struct udev_device * udev, char * buff, size_t len) \ { \ - int l; \ + size_t l; \ const char * attr; \ const char * devname; \ \ @@ -945,7 +945,10 @@ get_geometry(struct path *pp) static int parse_vpd_pg80(const unsigned char *in, char *out, size_t out_len) { - int len = get_unaligned_be16(&in[2]); + size_t len = get_unaligned_be16(&in[2]); + + if (out_len == 0) + return 0; /* * Strip leading and trailing whitespace @@ -958,8 +961,8 @@ parse_vpd_pg80(const unsigned char *in, char *out, size_t out_len) } if (len >= out_len) { - condlog(2, "vpd pg80 overflow, %d/%d bytes required", - len + 1, (int)out_len); + condlog(2, "vpd pg80 overflow, %lu/%lu bytes required", + len + 1, out_len); len = out_len - 1; } if (len > 0) { @@ -1725,7 +1728,7 @@ get_prio (struct path * pp) * Returns a pointer to the position where "end" was moved to. */ static char -*skip_zeroes_backward(char* start, int *len, char *end) +*skip_zeroes_backward(char* start, size_t *len, char *end) { char *p = end; @@ -1751,10 +1754,10 @@ static char * Otherwise, returns 0. */ static int -fix_broken_nvme_wwid(struct path *pp, const char *value, int size) +fix_broken_nvme_wwid(struct path *pp, const char *value, size_t size) { static const char _nvme[] = "nvme."; - int len, i; + size_t len, i; char mangled[256]; char *p; diff --git a/libmultipath/file.c b/libmultipath/file.c index 5cb06e1f..72f1d246 100644 --- a/libmultipath/file.c +++ b/libmultipath/file.c @@ -157,7 +157,8 @@ open_file(const char *file, int *can_write, const char *header) if (*can_write == 0) goto fail; /* If file is empty, write the header */ - size_t len = strlen(header); + int len = strlen(header); + if (write(fd, header, len) != len) { condlog(0, "Cannot write header to file %s : %s", file, diff --git a/libmultipath/foreign.c b/libmultipath/foreign.c index f05db162..0159a83a 100644 --- a/libmultipath/foreign.c +++ b/libmultipath/foreign.c @@ -172,7 +172,7 @@ static int _init_foreign(const char *multipath_dir, const char *enable) for (i = 0; i < r; i++) { const char *msg, *fn, *c; struct foreign *fgn; - int len, namesz; + size_t len, namesz; fn = di[i]->d_name; diff --git a/libmultipath/parser.c b/libmultipath/parser.c index e00c5fff..d478b177 100644 --- a/libmultipath/parser.c +++ b/libmultipath/parser.c @@ -124,7 +124,7 @@ find_keyword(vector keywords, vector v, char * name) { struct keyword *keyword; int i; - int len; + size_t len; if (!name || !keywords) return NULL; diff --git a/libmultipath/prioritizers/alua_rtpg.c b/libmultipath/prioritizers/alua_rtpg.c index 271a019d..bbf5aac0 100644 --- a/libmultipath/prioritizers/alua_rtpg.c +++ b/libmultipath/prioritizers/alua_rtpg.c @@ -371,7 +371,7 @@ get_asymmetric_access_state(const struct path *pp, unsigned int tpg, struct rtpg_data * tpgd; struct rtpg_tpg_dscr * dscr; int rc; - int buflen; + unsigned int buflen; uint64_t scsi_buflen; int fd = pp->fd; diff --git a/libmultipath/prioritizers/ana.c b/libmultipath/prioritizers/ana.c index 9f7adfa5..b5c7873d 100644 --- a/libmultipath/prioritizers/ana.c +++ b/libmultipath/prioritizers/ana.c @@ -62,7 +62,7 @@ static const char *anas_string[] = { static const char *aas_print_string(int rc) { rc &= 0xff; - if (rc >= 0 && rc < ARRAY_SIZE(anas_string) && + if (rc >= 0 && rc < (int)ARRAY_SIZE(anas_string) && anas_string[rc] != NULL) return anas_string[rc]; @@ -78,7 +78,8 @@ static int get_ana_state(__u32 nsid, __u32 anagrpid, void *ana_log, size_t offset = sizeof(struct nvme_ana_rsp_hdr); __u32 nr_nsids; size_t nsid_buf_size; - int i, j; + int i; + unsigned int j; for (i = 0; i < le16_to_cpu(hdr->ngrps); i++) { ana_desc = base + offset; @@ -225,7 +226,7 @@ int getprio(struct path *pp, __attribute__((unused)) char *args, default: break; } - if (rc < 0 && -rc < ARRAY_SIZE(ana_errmsg)) + if (rc < 0 && -rc < (int)ARRAY_SIZE(ana_errmsg)) condlog(2, "%s: ANA error: %s", pp->dev, ana_errmsg[-rc]); else condlog(1, "%s: invalid ANA rc code %d", pp->dev, rc); diff --git a/libmultipath/structs.c b/libmultipath/structs.c index bf7fdd73..f420ee5c 100644 --- a/libmultipath/structs.c +++ b/libmultipath/structs.c @@ -350,7 +350,7 @@ store_adaptergroup(vector adapters, struct adapter_group * agp) } struct multipath * -find_mp_by_minor (const struct _vector *mpvec, int minor) +find_mp_by_minor (const struct _vector *mpvec, unsigned int minor) { int i; struct multipath * mpp; @@ -388,7 +388,7 @@ struct multipath * find_mp_by_alias (const struct _vector *mpvec, const char * alias) { int i; - int len; + size_t len; struct multipath * mpp; if (!mpvec) diff --git a/libmultipath/structs.h b/libmultipath/structs.h index a3adf906..3665b89a 100644 --- a/libmultipath/structs.h +++ b/libmultipath/structs.h @@ -440,7 +440,8 @@ int add_pathgroup(struct multipath*, struct pathgroup *); struct multipath * find_mp_by_alias (const struct _vector *mp, const char *alias); struct multipath * find_mp_by_wwid (const struct _vector *mp, const char *wwid); struct multipath * find_mp_by_str (const struct _vector *mp, const char *wwid); -struct multipath * find_mp_by_minor (const struct _vector *mp, int minor); +struct multipath * find_mp_by_minor (const struct _vector *mp, + unsigned int minor); struct path * find_path_by_devt (const struct _vector *pathvec, const char *devt); struct path * find_path_by_dev (const struct _vector *pathvec, const char *dev); diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c index 65904d7b..923b529b 100644 --- a/libmultipath/sysfs.c +++ b/libmultipath/sysfs.c @@ -88,7 +88,7 @@ ssize_t sysfs_attr_get_value(struct udev_device *dev, const char *attr_name, condlog(4, "read from %s failed: %s", devpath, strerror(errno)); size = -errno; value[0] = '\0'; - } else if (size == value_len) { + } else if (size == (ssize_t)value_len) { value[size - 1] = '\0'; condlog(4, "overflow while reading from %s", devpath); size = 0; @@ -146,7 +146,7 @@ ssize_t sysfs_bin_attr_get_value(struct udev_device *dev, const char *attr_name, if (size < 0) { condlog(4, "read from %s failed: %s", devpath, strerror(errno)); size = -errno; - } else if (size == value_len) { + } else if (size == (ssize_t)value_len) { condlog(4, "overflow while reading from %s", devpath); size = 0; } @@ -200,7 +200,7 @@ ssize_t sysfs_attr_set_value(struct udev_device *dev, const char *attr_name, if (size < 0) { condlog(4, "write to %s failed: %s", devpath, strerror(errno)); size = -errno; - } else if (size < value_len) { + } else if (size < (ssize_t)value_len) { condlog(4, "tried to write %ld to %s. Wrote %ld", (long)value_len, devpath, (long)size); size = 0; diff --git a/libmultipath/time-util.c b/libmultipath/time-util.c index a3739a2d..55f366cc 100644 --- a/libmultipath/time-util.c +++ b/libmultipath/time-util.c @@ -32,11 +32,11 @@ void pthread_cond_init_mono(pthread_cond_t *cond) void normalize_timespec(struct timespec *ts) { while (ts->tv_nsec < 0) { - ts->tv_nsec += 1000UL * 1000 * 1000; + ts->tv_nsec += 1000L * 1000 * 1000; ts->tv_sec--; } - while (ts->tv_nsec >= 1000UL * 1000 * 1000) { - ts->tv_nsec -= 1000UL * 1000 * 1000; + while (ts->tv_nsec >= 1000L * 1000 * 1000) { + ts->tv_nsec -= 1000L * 1000 * 1000; ts->tv_sec++; } } diff --git a/libmultipath/uevent.c b/libmultipath/uevent.c index f128ced2..d38e8a7f 100644 --- a/libmultipath/uevent.c +++ b/libmultipath/uevent.c @@ -108,7 +108,8 @@ uevq_cleanup(struct list_head *tmpq) static const char* uevent_get_env_var(const struct uevent *uev, const char *attr) { - int i, len; + int i; + size_t len; const char *p = NULL; if (attr == NULL) diff --git a/libmultipath/util.c b/libmultipath/util.c index 28cbf4b9..ccc0de29 100644 --- a/libmultipath/util.c +++ b/libmultipath/util.c @@ -44,7 +44,7 @@ basenamecpy (const char *src, char *dst, size_t size) p = basename(src); for (e = p + strlen(p) - 1; e >= p && isspace(*e); --e) ; - if (e < p || e - p > size - 2) + if (e < p || (size_t)(e - p) > size - 2) return 0; strlcpy(dst, p, e - p + 2); @@ -428,7 +428,7 @@ int safe_write(int fd, const void *buf, size_t count) return 0; } -void set_max_fds(int max_fds) +void set_max_fds(rlim_t max_fds) { struct rlimit fd_limit; diff --git a/libmultipath/util.h b/libmultipath/util.h index 693991c1..913ab7c2 100644 --- a/libmultipath/util.h +++ b/libmultipath/util.h @@ -2,6 +2,8 @@ #define _UTIL_H #include +/* for rlim_t */ +#include #include #include @@ -21,7 +23,7 @@ int get_linux_version_code(void); int parse_prkey(char *ptr, uint64_t *prkey); int parse_prkey_flags(char *ptr, uint64_t *prkey, uint8_t *flags); int safe_write(int fd, const void *buf, size_t count); -void set_max_fds(int max_fds); +void set_max_fds(rlim_t max_fds); #define KERNEL_VERSION(maj, min, ptc) ((((maj) * 256) + (min)) * 256 + (ptc)) #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0])) diff --git a/libmultipath/uxsock.c b/libmultipath/uxsock.c index 9b4e9784..6adeedfc 100644 --- a/libmultipath/uxsock.c +++ b/libmultipath/uxsock.c @@ -40,7 +40,8 @@ static int _recv_packet(int fd, char **buf, unsigned int timeout, */ int ux_socket_listen(const char *name) { - int fd, len; + int fd; + size_t len; #ifdef USE_SYSTEMD int num; #endif diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c index d02a7072..291db8f5 100644 --- a/libmultipath/wwids.c +++ b/libmultipath/wwids.c @@ -74,7 +74,7 @@ write_out_wwid(int fd, char *wwid) { strerror(errno)); return -1; } - if (write(fd, buf, strlen(buf)) != strlen(buf)) { + if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) { condlog(0, "cannot write wwid to wwids file : %s", strerror(errno)); if (ftruncate(fd, offset)) @@ -117,7 +117,7 @@ replace_wwids(vector mp) goto out_file; } len = strlen(WWIDS_FILE_HEADER); - if (write(fd, WWIDS_FILE_HEADER, len) != len) { + if (write(fd, WWIDS_FILE_HEADER, len) != (ssize_t)len) { condlog(0, "Can't write wwid file header : %s", strerror(errno)); /* cleanup partially written header */ diff --git a/multipathd/main.c b/multipathd/main.c index e55f2795..26d5aa9c 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -1949,8 +1949,9 @@ static int check_path_reinstate_state(struct path * pp) { * so that the cutomer can rectify the issue within this time. After * the completion of san_path_err_recovery_time it should * automatically reinstate the path + * (note: we know that san_path_err_threshold > 0 here). */ - if (pp->path_failures > pp->mpp->san_path_err_threshold) { + if (pp->path_failures > (unsigned int)pp->mpp->san_path_err_threshold) { condlog(2, "%s : hit error threshold. Delaying path reinstatement", pp->dev); pp->dis_reinstate_time = curr_time.tv_sec; pp->disable_reinstate = 1; @@ -3247,7 +3248,8 @@ main (int argc, char *argv[]) void * mpath_pr_event_handler_fn (void * pathp ) { struct multipath * mpp; - int i, ret, isFound; + unsigned int i; + int ret, isFound; struct path * pp = (struct path *)pathp; struct prout_param_descriptor *param; struct prin_resp *resp; diff --git a/multipathd/pidfile.c b/multipathd/pidfile.c index 47d18e2c..cc0fbec1 100644 --- a/multipathd/pidfile.c +++ b/multipathd/pidfile.c @@ -42,7 +42,7 @@ int pidfile_create(const char *pidFile, pid_t pid) } memset(buf, 0, sizeof(buf)); snprintf(buf, sizeof(buf)-1, "%u", pid); - if (write(fd, buf, strlen(buf)) != strlen(buf)) { + if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) { condlog(0, "Cannot write pid to pidfile [%s], error was [%s]", pidFile, strerror(errno)); goto fail; From patchwork Sat Oct 12 21:28:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187125 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 D841376 for ; Sat, 12 Oct 2019 21:47:13 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3B8720673 for ; Sat, 12 Oct 2019 21:47:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3B8720673 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EF414A3CD73; Sat, 12 Oct 2019 21:47:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CEB15608A5; Sat, 12 Oct 2019 21:47:12 +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 81B8C1803517; Sat, 12 Oct 2019 21:47:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLWM3R007238 for ; Sat, 12 Oct 2019 17:32:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id BD6986017E; Sat, 12 Oct 2019 21:32:22 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8469C6031D; Sat, 12 Oct 2019 21:32:20 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2FB687BDAB; Sat, 12 Oct 2019 21:32:19 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:31:25 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:57 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O+xT5YXXXSpOwOu/tM357SMwa9Sr2OWFoscGSd+m/yPpGyJJVpR1SRvuT6W3tR9wAhirIARk/MwetgdSdwpYIDzRon4tAe4m3/T9EJVuQU2zc7kXdLTUHYN/4jl+fyHJQus5N46CKnwzPVtGSeI5R/jW3FwR0FRBApmOWKVM2kCElcP37K6wQ5otU7mCjea2vXJu/egeDBmfNabk+r21lK+InYuW69KDLZOMe9TZzRO99980PiOhK9U4oq1h06z8L3/YzcJI56mY7NgFUWHFBPlZjW3/EqBrA/+/K0U7MiibyawNkbANGgJZ4X+d50cPdvZvjN01OXokuSOrDsV1Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OkBN9pa8UJl2Lm2PYO1zcJoNPQSDlqHSmfhqA5odV1k=; b=ZkNFVxabZW+F2VTF9Y6jE5fUhfC0H2pLOdbmQjARMSXxDDv85x9Ldweyl/VhBy8V8QbXq1qwDa3ssg9ItRi/ByFQCR7EJNKLgHwErQIww6Q6CvnrDSIrTbCirvdkuH4KkMLbEfhKi9ym2KyeUn9QSbsBITuSDoxUG7ji5jLMxmPIuRBAZXj9lObjMe1qtjdQB30hfld9/SXigP993iHckzjov7fsxkzjl4W5wU7e8ZmzHYZz8GM6sZdnaAX7j0AvG6lt8PGykPw0l1bk2ELpVtqcWaBFCUneZNXGFQBOWRxezh9x7PULSdBoSr92bULCV2/nxnrwUipq5px7FH6xdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:53 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:53 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 45/72] libmultipath: fix -Wsign-compare warnings with snprintf() Thread-Index: AQHVgUP/vRjgspJFLEGusG/rLD5KFg== Date: Sat, 12 Oct 2019 21:28:33 +0000 Message-ID: <20191012212703.12989-46-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b0ae2eb8-58b8-45a9-e863-08d74f5b2250 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:76; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3UxGt/aPyva+Vjt85amskRcV+0Z/4mSAb/+kOshEmEdLwPjESHg1Q+F4JsNMEFO2x4s7c9RuRN2VQFQlKpUZd2jcL3Din7qdx2EojARSVwlZTUaovEyJtru6CT+C+hOdgwaN60f1WjaeaypPIvfAACOmLFwvo5WVanIZuf4tTsFZK+NXACcInp6fLewbWdCRHaN44QgqgZCiMlAxvz334RVMFFyf7YErF4wAeIU2DotzZw9JTaVv5idFdS5X3Ltd65KlcnwXfZ9mVV/BqwAnH8q7xXMceJSxyiB7uO0APOgW7T0JouFSygrf3QN/8bR6BgFU0M7f7sz0lNy91H4Md/KY7mdhRYcuqp8y94/Dt/cAq6qu1/mzk51lzNKAey5+Wy6mDIdwaVRqG0wFdDYMC/sjX9Y/VKwpFv+I3tvsm4o= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b0ae2eb8-58b8-45a9-e863-08d74f5b2250 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:33.4299 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mSdv9AqqpuH+oHPksL5aEyPut+oWFYKtMmdJcmvNdHT2UyBObpIiD+neyBsnsxbZznQO3VkrPc7CR0+Hvn2GJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 12 Oct 2019 21:32:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 12 Oct 2019 21:32:19 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLWM3R007238 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 45/72] libmultipath: fix -Wsign-compare warnings with snprintf() 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Sat, 12 Oct 2019 21:47:13 +0000 (UTC) From: Martin Wilck snprintf() returns int, and thus its result needs to be compared with a signed int. In theory, snprintf can return -1 with errno EOVERFLOW if the "size" argument exceeds INT_MAX, but this can be quite safely ignored for now. Signed-off-by: Martin Wilck --- kpartx/devmapper.c | 3 ++- kpartx/kpartx.h | 2 +- libmultipath/foreign/nvme.c | 4 ++-- libmultipath/sysfs.c | 4 ++-- libmultipath/util.c | 3 ++- libmultipath/util.h | 4 ++-- libmultipath/wwids.c | 2 +- multipath/main.c | 2 +- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c index 3aa4988d..7e599e07 100644 --- a/kpartx/devmapper.c +++ b/kpartx/devmapper.c @@ -107,7 +107,8 @@ strip_slash (char * device) static int format_partname(char *buf, size_t bufsiz, const char *mapname, const char *delim, int part) { - if (snprintf(buf, bufsiz, "%s%s%d", mapname, delim, part) >= bufsiz) + if (snprintf(buf, bufsiz, "%s%s%d", mapname, delim, part) + >= (int)bufsiz) return 0; strip_slash(buf); return 1; diff --git a/kpartx/kpartx.h b/kpartx/kpartx.h index 52920e43..3ec13dbc 100644 --- a/kpartx/kpartx.h +++ b/kpartx/kpartx.h @@ -17,7 +17,7 @@ #define unlikely(x) __builtin_expect(!!(x), 0) #define safe_sprintf(var, format, args...) \ - snprintf(var, sizeof(var), format, ##args) >= sizeof(var) + snprintf(var, sizeof(var), format, ##args) >= (int)sizeof(var) #ifndef BLKSSZGET #define BLKSSZGET _IO(0x12,104) /* get block device sector size */ diff --git a/libmultipath/foreign/nvme.c b/libmultipath/foreign/nvme.c index e8ca516c..17569b36 100644 --- a/libmultipath/foreign/nvme.c +++ b/libmultipath/foreign/nvme.c @@ -592,7 +592,7 @@ static void test_ana_support(struct nvme_map *map, struct udev_device *ctl) dev_t = udev_device_get_sysattr_value(ctl, "dev"); if (snprintf(sys_path, sizeof(sys_path), "/dev/char/%s", dev_t) - >= sizeof(sys_path)) + >= (int)sizeof(sys_path)) return; fd = open(sys_path, O_RDONLY); @@ -664,7 +664,7 @@ static void _find_controllers(struct context *ctx, struct nvme_map *map) struct udev_device *ctrl, *udev; if (snprintf(pathbuf + n, sizeof(pathbuf) - n, "/%s", fn) - >= sizeof(pathbuf) - n) + >= (int)(sizeof(pathbuf) - n)) continue; if (realpath(pathbuf, realbuf) == NULL) { condlog(3, "%s: %s: realpath: %s", __func__, THIS, diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c index 923b529b..eb1f03e1 100644 --- a/libmultipath/sysfs.c +++ b/libmultipath/sysfs.c @@ -306,7 +306,7 @@ bool sysfs_is_multipathed(const struct path *pp) n = snprintf(pathbuf, sizeof(pathbuf), "/sys/block/%s/holders", pp->dev); - if (n >= sizeof(pathbuf)) { + if (n >= (int)sizeof(pathbuf)) { condlog(1, "%s: pathname overflow", __func__); return false; } @@ -329,7 +329,7 @@ bool sysfs_is_multipathed(const struct path *pp) if (snprintf(pathbuf + n, sizeof(pathbuf) - n, "/%s/dm/uuid", di[i]->d_name) - >= sizeof(pathbuf) - n) + >= (int)(sizeof(pathbuf) - n)) continue; fd = open(pathbuf, O_RDONLY); diff --git a/libmultipath/util.c b/libmultipath/util.c index ccc0de29..4657e7db 100644 --- a/libmultipath/util.c +++ b/libmultipath/util.c @@ -213,7 +213,8 @@ int devt2devname(char *devname, int devname_len, char *devt) if ((major == tmpmaj) && (minor == tmpmin)) { if (snprintf(block_path, sizeof(block_path), - "/sys/block/%s", dev) >= sizeof(block_path)) { + "/sys/block/%s", dev) + >= (int)sizeof(block_path)) { condlog(0, "device name %s is too long", dev); fclose(fd); return 1; diff --git a/libmultipath/util.h b/libmultipath/util.h index 913ab7c2..cfc3b7a9 100644 --- a/libmultipath/util.h +++ b/libmultipath/util.h @@ -29,9 +29,9 @@ void set_max_fds(rlim_t max_fds); #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0])) #define safe_sprintf(var, format, args...) \ - snprintf(var, sizeof(var), format, ##args) >= sizeof(var) + snprintf((var), sizeof(var), (format), ##args) >= (int)sizeof(var) #define safe_snprintf(var, size, format, args...) \ - snprintf(var, size, format, ##args) >= size + snprintf(var, size, format, ##args) >= (int)size #define pthread_cleanup_push_cast(f, arg) \ pthread_cleanup_push(((void (*)(void *))&f), (arg)) diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c index 291db8f5..57c2707b 100644 --- a/libmultipath/wwids.c +++ b/libmultipath/wwids.c @@ -394,7 +394,7 @@ static int _failed_wwid_op(const char *wwid, bool rw, int r = -1; if (snprintf(path, sizeof(path), "%s/%s", shm_dir, wwid) - >= sizeof(path)) { + >= (int)sizeof(path)) { condlog(1, "%s: path name overflow", __func__); return -1; } diff --git a/multipath/main.c b/multipath/main.c index c2ef8c7b..8d518585 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -424,7 +424,7 @@ static int find_multipaths_check_timeout(const struct path *pp, long tmo, clock_gettime(CLOCK_REALTIME, &now); if (snprintf(path, sizeof(path), "%s/%s", shm_find_mp_dir, pp->dev_t) - >= sizeof(path)) { + >= (int)sizeof(path)) { condlog(1, "%s: path name overflow", __func__); return FIND_MULTIPATHS_ERROR; } From patchwork Sat Oct 12 21:28:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187129 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 562E276 for ; Sat, 12 Oct 2019 21:47:33 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3285820673 for ; Sat, 12 Oct 2019 21:47:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3285820673 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7609B30860B9; Sat, 12 Oct 2019 21:47:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5373B5D717; Sat, 12 Oct 2019 21:47:32 +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 13821180B536; Sat, 12 Oct 2019 21:47:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLWOjV007250 for ; Sat, 12 Oct 2019 17:32:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7EB195C22F; Sat, 12 Oct 2019 21:32:24 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74F225C223; Sat, 12 Oct 2019 21:32:24 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2C162D6A04; Sat, 12 Oct 2019 21:32:22 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:31:29 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:58 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CTM5EiE8FOv/PO12XUv8kzejMh9edmGciDcDwUKWxzDMMWcOBXMuIqQuSbA2MD+W7AMm0VPOR8Sot+77jIUrjbbQGtWPNIuRtlAd5kH3ckhIx2lD6GWr1SkRGpn9jQbSxS2U02+5NKzL2B202xeJrfai681+Oh5jx6aRucXU+5X+lH9OYiuLT9z1G8Hgc1lIIx21sTWYPS4FJweIJPrXMGVl0inyrNy7SCdFPn+Zotg2kkRvQzaJw/HcSj9wD6D8/ryroYfUHPZzYZWr9Ltrqi1gQo/xqxOFoKXRWuWc8mhcXuDUZzTZAy2iuxTMQ/L5liEGsDTvz1HP4OoJitQmkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bHd7J6xzuB0P71tdUhNtYRsZjljEW+IQk4tWB8fkEeA=; b=CXJpxRM7HOm/9LHl1pjl3RXbhoQPDeqW1Wqya2cx1XYUJJRSXw9PGxUZ0Y3Y/QD5C18WRT8ezUXnFxNfel3lH3QowjJtrsjGCl1Djch8mntu9gNRImDU4b1p+TgRGbHzaGKktM+yVz6agkkx/Zwj9eqLj8aon/OgCx5xUqySD2cweN+twb/uWxMxIaD4nnRguGfjL0oxMzuz+ZG0HzERiANdAcrqQvR3CtD07wcRAIETY+YbJ0pMWxKCTfget68H/wpOLe4tDjLpkP+KFDJ/0yv4tpfTpNac9uYJf9JUUH8n2Pgwgi8P/7AZx183bdrKlc2qLLXIP4dKNzzZ7CSbgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:54 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:53 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 46/72] libmultipath: parse_vpd_pg83(): sanitize indentation Thread-Index: AQHVgUQAxPZc0uR+c0GlMfrF+vmCbg== Date: Sat, 12 Oct 2019 21:28:34 +0000 Message-ID: <20191012212703.12989-47-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6226555e-c4d9-4df9-8e1d-08d74f5b2304 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:595; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 97wSCNsVg0YbrYhMNjMyAh14jHXR2xr4j3kv8bQy79eKx9Jj1S738zQ0rDDFyrrDCgz57mgiEb/0h9J1E3nxf8OBbrW+7hc/+scfmAiolN24F+/UTUlIB4SqASpWMO33uNOZJK1C5ucd65NCax5MA97uojljtp9JmYVuM4EInJkM3GdBa7ECTLYDp6UUId2mvk1HReKqPiC3YM63WxQjF4XIrCsyUiWBbSXM/XwHVKt0DtADLtOn/nKbInN1W1U3bpOXd8IhjVp/DPrHFM/zj0+RMFNHZ46febepAvjgOPOiyQZHHLoJX5b7Yfg5jPKcP77gYGCDZIBGiEXwpV1+zXLR8loN3F6R7gt7nzALHk+1YnK4T9KD3rRbVxSblmnMptVaPjsmpDyi46faFtXmY1VYzyYXnziZ39NMXigWKWc= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 6226555e-c4d9-4df9-8e1d-08d74f5b2304 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:34.5713 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: BfPdB/1r30R9Nt0gQJZZ1jK7mPrrhFe7KCQ6W6F7pCIIGFBN7MNsw1AJQbDJem0NG+hf1t0PsW4yVFVs692IcA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 12 Oct 2019 21:32:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 12 Oct 2019 21:32:23 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLWOjV007250 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 46/72] libmultipath: parse_vpd_pg83(): sanitize indentation 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sat, 12 Oct 2019 21:47:32 +0000 (UTC) From: Martin Wilck This just moves a lot of code to the left. No functional change. Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 174 ++++++++++++++++++++------------------- 1 file changed, 88 insertions(+), 86 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index c6c57430..0d0a6bc1 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -1045,100 +1045,102 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, } d += d[3] + 4; } - if (prio > 0) { - vpd_type = vpd[1] & 0xf; - vpd_len = vpd[3]; + + if (prio <= 0) + return -ENODATA; + + vpd_type = vpd[1] & 0xf; + vpd_len = vpd[3]; + vpd += 4; + if (vpd_type == 0x2 || vpd_type == 0x3) { + int i; + + assert(out_len >= 2); + len = sprintf(out, "%d", vpd_type); + if (2 * vpd_len >= out_len - len) { + condlog(1, "%s: WWID overflow, type %d, %d/%lu bytes required", + __func__, vpd_type, + 2 * vpd_len + len + 1, out_len); + vpd_len = (out_len - len - 1) / 2; + } + for (i = 0; i < vpd_len; i++) + len += sprintf(out + len, + "%02x", vpd[i]); + } else if (vpd_type == 0x8) { + if (!memcmp("eui.", vpd, 4)) + out[0] = '2'; + else if (!memcmp("naa.", vpd, 4)) + out[0] = '3'; + else + out[0] = '8'; + vpd += 4; - if (vpd_type == 0x2 || vpd_type == 0x3) { - int i; - - assert(out_len >= 2); - len = sprintf(out, "%d", vpd_type); - if (2 * vpd_len >= out_len - len) { - condlog(1, "%s: WWID overflow, type %d, %d/%lu bytes required", - __func__, vpd_type, - 2 * vpd_len + len + 1, out_len); - vpd_len = (out_len - len - 1) / 2; - } - for (i = 0; i < vpd_len; i++) - len += sprintf(out + len, - "%02x", vpd[i]); - } else if (vpd_type == 0x8) { - if (!memcmp("eui.", vpd, 4)) - out[0] = '2'; - else if (!memcmp("naa.", vpd, 4)) - out[0] = '3'; - else - out[0] = '8'; - - vpd += 4; - len = vpd_len - 4; - while (len > 2 && vpd[len - 2] == '\0') - --len; - if (len > out_len - 1) { - condlog(1, "%s: WWID overflow, type 8/%c, %d/%lu bytes required", - __func__, out[0], len + 1, out_len); - len = out_len - 1; - } + len = vpd_len - 4; + while (len > 2 && vpd[len - 2] == '\0') + --len; + if (len > out_len - 1) { + condlog(1, "%s: WWID overflow, type 8/%c, %d/%lu bytes required", + __func__, out[0], len + 1, out_len); + len = out_len - 1; + } - if (out[0] == '8') - for (i = 0; i < len; ++i) - out[1 + i] = vpd[i]; - else - for (i = 0; i < len; ++i) - out[1 + i] = tolower(vpd[i]); + if (out[0] == '8') + for (i = 0; i < len; ++i) + out[1 + i] = vpd[i]; + else + for (i = 0; i < len; ++i) + out[1 + i] = tolower(vpd[i]); - /* designator should be 0-terminated, but let's make sure */ - out[len] = '\0'; + /* designator should be 0-terminated, but let's make sure */ + out[len] = '\0'; - } else if (vpd_type == 0x1) { - const unsigned char *p; - int p_len; - - out[0] = '1'; - len = 1; - p = vpd; - while ((p = memchr(vpd, ' ', vpd_len))) { - p_len = p - vpd; - if (len + p_len > out_len - 1) { - condlog(1, "%s: WWID overflow, type 1, %d/%lu bytes required", - __func__, len + p_len, out_len); - p_len = out_len - len - 1; - } - memcpy(out + len, vpd, p_len); - len += p_len; - if (len >= out_len - 1) { - out[len] = '\0'; - break; - } - out[len] = '_'; - len ++; - if (len >= out_len - 1) { - out[len] = '\0'; - break; - } - vpd = p; - vpd_len -= p_len; - while (vpd && *vpd == ' ') { - vpd++; - vpd_len --; - } + } else if (vpd_type == 0x1) { + const unsigned char *p; + int p_len; + + out[0] = '1'; + len = 1; + p = vpd; + while ((p = memchr(vpd, ' ', vpd_len))) { + p_len = p - vpd; + if (len + p_len > out_len - 1) { + condlog(1, "%s: WWID overflow, type 1, %d/%lu bytes required", + __func__, len + p_len, out_len); + p_len = out_len - len - 1; } - p_len = vpd_len; - if (p_len > 0 && len < out_len - 1) { - if (len + p_len > out_len - 1) { - condlog(1, "%s: WWID overflow, type 1, %d/%lu bytes required", - __func__, len + p_len + 1, out_len); - p_len = out_len - len - 1; - } - memcpy(out + len, vpd, p_len); - len += p_len; + memcpy(out + len, vpd, p_len); + len += p_len; + if (len >= out_len - 1) { out[len] = '\0'; + break; } - if (len > 1 && out[len - 1] == '_') { - out[len - 1] = '\0'; - len--; + out[len] = '_'; + len ++; + if (len >= out_len - 1) { + out[len] = '\0'; + break; } + vpd = p; + vpd_len -= p_len; + while (vpd && *vpd == ' ') { + vpd++; + vpd_len --; + } + } + p_len = vpd_len; + if (p_len > 0 && len < out_len - 1) { + if (len + p_len > out_len - 1) { + condlog(1, "%s: WWID overflow, type 1, %d/%lu bytes required", + __func__, len + p_len + 1, out_len); + p_len = out_len - len - 1; + } + memcpy(out + len, vpd, p_len); + len += p_len; + out[len] = '\0'; + } + if (len > 1 && out[len - 1] == '_') { + out[len - 1] = '\0'; + len--; } } return len; From patchwork Sat Oct 12 21:28:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187137 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 933CA76 for ; Sat, 12 Oct 2019 21:48:23 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B36F2067B for ; Sat, 12 Oct 2019 21:48:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B36F2067B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 mx1.redhat.com (Postfix) with ESMTPS id ABC5AE8B1A; Sat, 12 Oct 2019 21:48:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B4B45D9CC; Sat, 12 Oct 2019 21:48:22 +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 50FED1803517; Sat, 12 Oct 2019 21:48:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLWUfh007273 for ; Sat, 12 Oct 2019 17:32:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id E68815D6A3; Sat, 12 Oct 2019 21:32:30 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95B855D717; Sat, 12 Oct 2019 21:32:28 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D816430BBE82; Sat, 12 Oct 2019 21:32:26 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.147) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:31:33 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M4W0335.microfocus.com (2002:f78:1193::f78:1193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:58 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fNfCsloW2R9p5oduOTm6efQYYIMDgce5d4cb5Fs0RJkPBmTUZHTlhYIgg4sfzsKj6dLTYNT3X11Jxl1yU6T9Kl5zHGMi8nJD/u/KmxfPMyDe0DwfNyEUkA84i0ht9fJ1hWjq8xAhn/LTxoch/yt5gDkpiU9a0Xm2Yd++4Xsvs7FBkjEI44dATn/RiakXr0e2RUYeB6PDdRaFdBNJJdXvTJa4j+r20dtzS2e8qaMC3sBXTGbLVehTxMb/DWpdAfLwqL8V1lRLc8rpVHwt3niwkwytDyuowIQ0zOy9RAm/byFvdpZKxpRLghcD+pJ3IcOaZLsbffkFv7290Is8TuETzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z0ZExMvOBKvaFCx+vCS8jTbzNOXoXvu4R72k6qca0gE=; b=bLdrlb/hWGxzC82YT3TjXcRLRluXf8lOP8sXKnb6HG7iyRuUjrCGw82uZNKzRzOXuTdYvCX03tZLUqlAtDc5ISkVDu+pEM+63auORlV5hWFzUOaoPhpHXh4qnU902mhexjQ3gx5qibOfS++OcVRmphfG0Qcrg3zpEoowbwjs7wjmVLJHFyX9OKGioZPkb6QxYGn1nggGIl4vA26864U8PrnurTbjXmXV8TdhR0h0+42vIahI/K60x7pGxS8cwpCU6XWj2gQWA1BqD8B29j5CIhdiWWc0HcVEtMFSejFJ563QwgEkDAmnIHB25ljZb1iuOstc5EYb/Ojz9Eo3dLXG/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:54 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:54 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 47/72] libmultipath: parse_vpd_pg83(): fix -Wsign-compare warnings Thread-Index: AQHVgUQBqURMKB2oBEK9l3RRYGpZtA== Date: Sat, 12 Oct 2019 21:28:35 +0000 Message-ID: <20191012212703.12989-48-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9f7d4181-df7b-4c12-4143-08d74f5b23b2 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:489; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QDkIOKCiF8jVw3nF+d/oTmczWziBUMlJpHLLHfUJW1uYHqtCY4IsMFwGM16QcR5YFtPvLVBhDGvps7Hs76NSMUnRM3WKzPi4avRycg4oOGwUnZ/mn7pQQNXTUP2kqWna0teKUMFCkoa/wFWtn2MMNfN4sdy9esA3vrmoePIu4AajSpskWkIpZnBq/q/CHlWh6eFz23L/B1xLkH7wae8elI2YkNH3+pfOuw14pbnWjA02BPW0XySlCMGBu7Pm6gzm2Wn9wJbUjOeVrY+7RczwuPmzCoDZL4jWqTn4Vw/0/vE7RKQ40d1/pUhwg59+4J/6f0iw9aRADEWd8ex+EQa+lWkIQNjdLIxGxs3qudYAXkB0A48zlhhobKA/lwjCnWJ+BT85bPjFNXoaB7oNEWf5IaeLE1z/3DwgvCG5DMej7P4= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 9f7d4181-df7b-4c12-4143-08d74f5b23b2 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:35.7146 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xx3hHeVh93YEFXv4DJ0VRezCnnwJdO+aVf8hpuR67WEUE0Ict/ThD0Phea7Egn2AGjwQ0Tx8L+YNX7RuZeA8TA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:32:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:32:27 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLWUfh007273 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 47/72] libmultipath: parse_vpd_pg83(): fix -Wsign-compare warnings 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sat, 12 Oct 2019 21:48:23 +0000 (UTC) From: Martin Wilck Most of this is trivial. Changes are: return early if there is obviously not enough space. Check vpd_len for designator type 8. Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 0d0a6bc1..6288c3e0 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -978,7 +978,8 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, { const unsigned char *d; const unsigned char *vpd = NULL; - int len = -ENODATA, vpd_type, vpd_len, prio = -1, i, naa_prio; + size_t len, vpd_len, i; + int vpd_type, prio = -1, naa_prio; d = in + 4; while (d < in + in_len) { @@ -1048,17 +1049,20 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, if (prio <= 0) return -ENODATA; + /* Need space at least for one digit */ + else if (out_len <= 1) + return 0; + len = 0; vpd_type = vpd[1] & 0xf; vpd_len = vpd[3]; vpd += 4; if (vpd_type == 0x2 || vpd_type == 0x3) { - int i; + size_t i; - assert(out_len >= 2); len = sprintf(out, "%d", vpd_type); if (2 * vpd_len >= out_len - len) { - condlog(1, "%s: WWID overflow, type %d, %d/%lu bytes required", + condlog(1, "%s: WWID overflow, type %d, %lu/%lu bytes required", __func__, vpd_type, 2 * vpd_len + len + 1, out_len); vpd_len = (out_len - len - 1) / 2; @@ -1066,6 +1070,10 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, for (i = 0; i < vpd_len; i++) len += sprintf(out + len, "%02x", vpd[i]); + } else if (vpd_type == 0x8 && vpd_len < 4) { + condlog(1, "%s: VPD length %lu too small for designator type 8", + __func__, vpd_len); + return -EINVAL; } else if (vpd_type == 0x8) { if (!memcmp("eui.", vpd, 4)) out[0] = '2'; @@ -1079,7 +1087,7 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, while (len > 2 && vpd[len - 2] == '\0') --len; if (len > out_len - 1) { - condlog(1, "%s: WWID overflow, type 8/%c, %d/%lu bytes required", + condlog(1, "%s: WWID overflow, type 8/%c, %lu/%lu bytes required", __func__, out[0], len + 1, out_len); len = out_len - 1; } @@ -1096,15 +1104,14 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, } else if (vpd_type == 0x1) { const unsigned char *p; - int p_len; + size_t p_len; out[0] = '1'; len = 1; - p = vpd; while ((p = memchr(vpd, ' ', vpd_len))) { p_len = p - vpd; if (len + p_len > out_len - 1) { - condlog(1, "%s: WWID overflow, type 1, %d/%lu bytes required", + condlog(1, "%s: WWID overflow, type 1, %lu/%lu bytes required", __func__, len + p_len, out_len); p_len = out_len - len - 1; } @@ -1130,7 +1137,7 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, p_len = vpd_len; if (p_len > 0 && len < out_len - 1) { if (len + p_len > out_len - 1) { - condlog(1, "%s: WWID overflow, type 1, %d/%lu bytes required", + condlog(1, "%s: WWID overflow, type 1, %lu/%lu bytes required", __func__, len + p_len + 1, out_len); p_len = out_len - len - 1; } From patchwork Sat Oct 12 21:28:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187079 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 7468C1709 for ; Sat, 12 Oct 2019 21:33:32 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 514122089C for ; Sat, 12 Oct 2019 21:33:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 514122089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7EB77883859; Sat, 12 Oct 2019 21:33:31 +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 1F5E260470; Sat, 12 Oct 2019 21:33:31 +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 AD4484EE69; Sat, 12 Oct 2019 21:33:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUJeU006579 for ; Sat, 12 Oct 2019 17:30:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 78AFC5C22F; Sat, 12 Oct 2019 21:30:19 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 23CC45C223; Sat, 12 Oct 2019 21:30:15 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 85A29811A9; Sat, 12 Oct 2019 21:30:14 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.190) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:30 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:58 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y4CS+QcuIlNF0NjOnnkId+3BSDwDPXQQYE+hgqOehBM2fGzATIe19XDhKcIIND1WPrYAFPOpZ63lmaSLIpVr1oqfaoDf8wbow6gZdfBvISJyO9F7kCWnv8CIvAh87r0Tdi9Nv5nTXx8fPIyk+iZ7gYZ+JQIXgtO45hofwZcD3y14RwhdUf9bVEliDekCGXw+JLALP8aVeK8rveWhKoxNPSyD3zNKPCXvp82dNXj4b/qie+ifP7hsBWRk9Xklzt7DVHNw/9IF9Yt5xRybIIp8ex+oR3rYzJWOsfvye9DANmTKpyIgMiCMwCNrGDaIczDivSBAaTw1W3n5O5/Yb2f3dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m7bs2frssqUMypoMC0eAdns51EAW5xSr4EwPR2ZSD9k=; b=VpDR0il1YVIVnMY0Vq8cbBdnbF1n9maTEtYONrGA0BMQsASscHMkpVsmDrVNW/iALbgD1Uknb9L4QBOhpt5iZDyZ9FHbew3razojgmfLsZU1T+YPuVomxQz15aCKvwbZEp8ZASTZn2GDhJuR4SeSKsIdZezCZTte5Gs5u9E8xBer/XVoV8U2a0JRaG9TP1tPzhz3zRwPySjdmLBrZ9tzABzyxPFOVqCdexgoJr0QoHCU5EMrtCMwJLqDGDSx7IuB4fPtKFZXPwm1yQYA3MxiYhvzTRQe464LpOkGl/uINxAjNQiVzrbz5Cje9hKxKiqoGlZzxzds4K8oojtMYBgpdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:54 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:54 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 48/72] libmultipath: print: use unsigned int for "width" field Thread-Index: AQHVgUQBEPhL94XsxUyVpzoERlnXGw== Date: Sat, 12 Oct 2019 21:28:36 +0000 Message-ID: <20191012212703.12989-49-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 23544f08-19e6-4238-1b77-08d74f5b2460 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:65; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5B8yarXF8XJjG9ovDdZPy5/0v4B9bRp/sfDiTQSmJsDkO6WoLr6axvf2HR/Te1OVF7tmsWHt6HFI18NtrwiO/o/qdMDhT5AHVwthwrieYrC0IWlGzHmYyhUM5K6NLjTUEFF3gxKzNR3r/rqOU4NV4IwipMu/jdJW99pLUztskTLkSIs3KarvhLSWTD4MA3yqlBwOHWQVNopgEPfwv3ulvLMjO0RfOAfXdHMS/KlOoexrYY10s3XoCqTDSqVfXrlzKYLmwjvKJTLWX6fJpv/jEraHSIDm2zNm97Vul92keKhPWiLLoaYaTSR/Orj6HPyofz1i3tfqAnu2VqD332x/6sM1I0DnF9FCrxVT+ecepdpY87fJ7riPJChFz/2jd094kkoZYM8X0k5w4G5cIGBNoydkG8ErgE6/wn/62ED3U4A= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 23544f08-19e6-4238-1b77-08d74f5b2460 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:36.8670 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: hLiGQWw71YcFGXIISp5WQVz95ekEbeA05xyCB28JXB3cB6tC7sgI9+yt26UDkWMBpF0bJakc9EZ+GxvAYig9tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sat, 12 Oct 2019 21:30:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sat, 12 Oct 2019 21:30:15 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUJeU006579 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 48/72] libmultipath: print: use unsigned int for "width" field 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Sat, 12 Oct 2019 21:33:31 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/print.c | 4 ++-- libmultipath/print.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libmultipath/print.c b/libmultipath/print.c index 8fa86267..b98e9bda 100644 --- a/libmultipath/print.c +++ b/libmultipath/print.c @@ -36,7 +36,7 @@ #define NOPAD s = c #define PAD(x) \ do { \ - while ((int)(c - s) < (x) && (c < (line + len - 1))) \ + while (c < (s + x) && (c < (line + len - 1))) \ *c++ = ' '; \ s = c; \ } while (0) @@ -783,7 +783,7 @@ get_path_layout(vector pathvec, int header) } static void -reset_width(int *width, enum layout_reset reset, const char *header) +reset_width(unsigned int *width, enum layout_reset reset, const char *header) { switch (reset) { case LAYOUT_RESET_HEADER: diff --git a/libmultipath/print.h b/libmultipath/print.h index 0c909e75..e8260d03 100644 --- a/libmultipath/print.h +++ b/libmultipath/print.h @@ -78,21 +78,21 @@ struct path_data { char wildcard; char * header; - int width; + unsigned int width; int (*snprint)(char * buff, size_t len, const struct path * pp); }; struct multipath_data { char wildcard; char * header; - int width; + unsigned int width; int (*snprint)(char * buff, size_t len, const struct multipath * mpp); }; struct pathgroup_data { char wildcard; char * header; - int width; + unsigned int width; int (*snprint)(char * buff, size_t len, const struct pathgroup * pgp); }; From patchwork Sat Oct 12 21:28:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187039 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 D43E818B7 for ; Sat, 12 Oct 2019 21:31:27 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B0F8720700 for ; Sat, 12 Oct 2019 21:31:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0F8720700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C5ADC04B2FF; Sat, 12 Oct 2019 21:31:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74A8E5D6A3; Sat, 12 Oct 2019 21:31:26 +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 3A3261803518; Sat, 12 Oct 2019 21:31:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLTCiw006255 for ; Sat, 12 Oct 2019 17:29:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id CE8676031D; Sat, 12 Oct 2019 21:29:12 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5DBB8601B3; Sat, 12 Oct 2019 21:29:10 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EED93309B149; Sat, 12 Oct 2019 21:29:08 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.146) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:28:15 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0334.microfocus.com (2002:f78:1192::f78:1192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:59 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fz5h22T6zLQp76jRkoh852h2c8XoRseVOCWjxG1LHaa1yEqHRfdhzThIZmd+1AX9pj/S/y60c8g3EbMmxbyOMCERae5G5nPbOe18pOkWsUMM5ewzqfVnwvK1SEuO23QZr8ntO2CWRp4e1Bzz31y62qupPsjzb5g2B7wfslwxgFKtNflyPNMRHpgE+uUrQ5qEYP2I51UzMEFpaWVfbQ38SN/1mHmXgY4Xx8SoIlxbwuS1zKIlyS8Ru+fevsIGYIBwGlLKO0YTv6jRON4IUpiYz3EPtEhc764ewVKS3ddLU6hqkVzu6xRBamooSlA9ES2vFU7nKzWgOWKC0yHPAC+EfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5MZdOkCNogQ8WE2wRy4cw9QaNwaNXBS9Ir+Biw/uxXY=; b=ljpddHxEidQxz9WKo96QBWZBqYYTBeU6q9WtcDVgifcIHTIRge36LQXeYK56N4AZ4Y2+r7SygMt28ZfbWG78+lLm9FqpsdobuhirrDFv4qMIEBuqcIjNiVZSjRS/hWfIl/LRatQLav0luMM7hY1WklH6s2Ezjk/e7yCETlnhp6FG0G+44UCHYR2fFSYyTd+YVAwhNRnpbPLkgaZ0OsEa/kvQsojiXwfyInyzC5l6JHaiwBvtVCoPDU3aYb/rvGkwog5F6UPW5SKAFEDGLc7IXJ/utFeQ89rhWb04t+7xZgn+mWyVA+no/MbvZF4Z6T+9udEtRbl1tr507wRCNOIAVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:55 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:55 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 49/72] libmultipath: vector_for_each_slot: fix -Wsign-compare warnings Thread-Index: AQHVgUQCXbtcIqG9lUSCHHOLWx2V+g== Date: Sat, 12 Oct 2019 21:28:38 +0000 Message-ID: <20191012212703.12989-50-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 33a6c5e4-0a3e-4f32-06f9-08d74f5b250f x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:843; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: c3skHOxlN50BZKDCRBPOtClILtClHZzsIESAl0SY/IXTcT1nAcZXClaen1ZoXr2wk8/4bz78otbjp4SCf4Q9PASuoVF0SYeK6TSvAW9lLoZspw4nrpiSBKOEvmFMml6mQgK8YoAf5JFafyzmcluXpbFumgK7W3u0ARrUbny6z8BNK3RnJ1jsXxyrngFVMCAmaaYMdiDeIushCwQ7n7l8zul8nD/cMTDOjhJxTbvjYcoVmaXL9CttaJt2zPing/1rCYVhegScCh6oQ9qPUrrie6z66iwjQQAxrhCiEFn23sV3wqE05wCcXnSAmkiJjz4jQKe4zeH55JIs6GgNelP37ODsXAmdI+Z8N+rxgLEkWmXaGT9LJXEU4KWYArN/419gVYeEWUbdVsLXl7VTSfyib2ozJjMWJbnTInL3CJ0483M= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 33a6c5e4-0a3e-4f32-06f9-08d74f5b250f X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:38.1063 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +3rgcb9AsVBXklPKrl/wRyjCqKCkUOv9giixA1Yw7kF5NTaB73iTyeX1jvpfpnatQRDBHlG2icjACB77U4fAFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:29:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:29:09 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLTCiw006255 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 49/72] libmultipath: vector_for_each_slot: fix -Wsign-compare warnings 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 12 Oct 2019 21:31:27 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/vector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/vector.h b/libmultipath/vector.h index 344dffd5..e16ec461 100644 --- a/libmultipath/vector.h +++ b/libmultipath/vector.h @@ -36,9 +36,9 @@ typedef struct _vector *vector; #define VECTOR_LAST_SLOT(V) (((V) && VECTOR_SIZE(V) > 0) ? (V)->slot[(VECTOR_SIZE(V) - 1)] : NULL) #define vector_foreach_slot(v,p,i) \ - for (i = 0; (v) && i < VECTOR_SIZE(v) && ((p) = (v)->slot[i]); i++) + for (i = 0; (v) && (int)i < VECTOR_SIZE(v) && ((p) = (v)->slot[i]); i++) #define vector_foreach_slot_after(v,p,i) \ - for (; (v) && i < VECTOR_SIZE(v) && ((p) = (v)->slot[i]); i++) + for (; (v) && (int)i < VECTOR_SIZE(v) && ((p) = (v)->slot[i]); i++) #define vector_foreach_slot_backwards(v,p,i) \ for (i = VECTOR_SIZE(v) - 1; (int)i >= 0 && ((p) = (v)->slot[i]); i--) From patchwork Sat Oct 12 21:28:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187017 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 1DC2A1709 for ; Sat, 12 Oct 2019 21:30:25 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF3152089C for ; Sat, 12 Oct 2019 21:30:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF3152089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 01ED7801667; Sat, 12 Oct 2019 21:30:24 +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 CE8855D784; Sat, 12 Oct 2019 21:30:23 +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 8D66F4EA71; Sat, 12 Oct 2019 21:30:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLTD8T006262 for ; Sat, 12 Oct 2019 17:29:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 887F05D71C; Sat, 12 Oct 2019 21:29:13 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3696B5D6A3; Sat, 12 Oct 2019 21:29:11 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5B841300BEAB; Sat, 12 Oct 2019 21:29:09 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.146) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:28:15 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0334.microfocus.com (2002:f78:1192::f78:1192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:59 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:28:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GI6Wnl8eQXsEKWLERGhxp2sO15kjsBuLKuFkvhArFPKkYq26jJXWs4aR5wGNH2ZG44RyEiS3wxSbt8e+ToMISqU3mdM38dHcNBG1VXK53aDU4UJTitbo4E/J6yebH4AAVGIUjzuk3sA8GPcJkvFDrepfTuXUn6/Omir3Pk/fJTWDzJ08K4NBhYOQz6Ai+TovOtwAiZiRwQb3VpnEKwzJhsDFhprvJaQIgeA886pQNczOJgmaZAbCIZP67pDgGTA1HUABaW3+duVpZ1ZbdwBzPi+3Fp5JP2SXazPFBFNSyB5esO+Iisk0RjsqDU85pIzaGBIDmXo8ZgCM7PgOXyrevg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9rRsifiFdp7m0VpnXoQ41KW/4ve+scFIKc3fKp/LunE=; b=Vfxd29mePcDjYp0/67aZPu0DadkpcjiytFc49KxGdJFvYZNpws+TWXrbXRb+vwfDccOmS+Gd/ZlTo2/oALPybfwVRI5Lcv57dR14PMt0SlSVHCRW5YIqSztq6YGNTdMON1zOYNwOikM0AL9fOh3fL/EP+uAvKhyKF/KOfV2VfKebzoni6T1D0peIUov0ww2zHLuMyxps/Xu3fgjKz/Jg7nVGBaGAexl19lE+CN2E61NiVjOrYV+EFK9PAglbxfNikvk1vg7rp2kqhZpnvB3RKzggS/r0Sasi8GmX0xFZ9eiBcxPawnm2UPqnvC696vTlark0pU3cV7c0llb1bZ/23g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:55 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:55 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 50/72] libmultipath: set_int(): add error check and set_uint() Thread-Index: AQHVgUQDFB2dz9prvU2Uj2e4S7uXag== Date: Sat, 12 Oct 2019 21:28:39 +0000 Message-ID: <20191012212703.12989-51-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f340fb8a-2f56-4a3d-808b-08d74f5b25cd x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:595; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kVzQSgth9Uu9qpHa9sMS2xWSGCiQ2Spkhd2NLTJMRRo6H4l8GfD6FM3PY7y39cwQyMyCa2x7V1dDMo61b0z36QAV5z5lW6waeF36KKxU78tivrHWC525bLmu/A+1p739P+1JAzI8NMweoCU6yF7aIpIqyjChy/Tnl75nwTQMuCjmPLs496zSc8pEMv/EZHMVTYKSiUYevYGrnKbtJAU6HxxisktOUyR4rORE8C5z3kl8iuULbEUN8uw3pCaBInxEDpg1syLyHN3MwOR+/viWghlEFzfXuEllBDFqbzOm6cxAlGWpkvdu9cl4fHUAArZ+1Dq7BUqgyjXsRn9SvOsljmXwPIjTQ/l7cLwIfM7NSSY6wXfbVWpKzmpe7b0kks/neWbV35ybKsbCWPbNgPDmywr8uCKTrzGU6xnr3Yff1p8= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f340fb8a-2f56-4a3d-808b-08d74f5b25cd X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:39.2596 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: S6JFsfvxu8/QNIzeAhzPw3A8Mx+XkyDrvnF50945f1n2/WhwFpC4qmI4B7OuNMlRc9J6ddYhGbLgIAa+vkQcWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 12 Oct 2019 21:29:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 12 Oct 2019 21:29:10 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLTD8T006262 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 50/72] libmultipath: set_int(): add error check and set_uint() 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Sat, 12 Oct 2019 21:30:24 +0000 (UTC) From: Martin Wilck Use strtol() to check for valid input, but don't return error as that would cause config file parsing to fail because of a single typo. Also, add set_uint() to parse an unsigned parameter. Signed-off-by: Martin Wilck --- libmultipath/dict.c | 48 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/libmultipath/dict.c b/libmultipath/dict.c index 2b046e1d..c23d525b 100644 --- a/libmultipath/dict.c +++ b/libmultipath/dict.c @@ -31,16 +31,58 @@ static int set_int(vector strvec, void *ptr) { int *int_ptr = (int *)ptr; - char * buff; + char *buff, *eptr; + long res; + int rc; buff = set_value(strvec); if (!buff) return 1; - *int_ptr = atoi(buff); + res = strtol(buff, &eptr, 10); + if (eptr > buff) + while (isspace(*eptr)) + eptr++; + if (*buff == '\0' || *eptr != '\0' || res > INT_MAX || res < INT_MIN) { + condlog(1, "%s: invalid value for %s: \"%s\"", + __func__, (char*)VECTOR_SLOT(strvec, 0), buff); + rc = 1; + } else { + rc = 0; + *int_ptr = res; + } FREE(buff); - return 0; + return rc; +} + +static int +set_uint(vector strvec, void *ptr) +{ + unsigned int *uint_ptr = (unsigned int *)ptr; + char *buff, *eptr; + long res; + int rc; + + buff = set_value(strvec); + if (!buff) + return 1; + + res = strtol(buff, &eptr, 10); + if (eptr > buff) + while (isspace(*eptr)) + eptr++; + if (*buff == '\0' || *eptr != '\0' || res < 0 || res > UINT_MAX) { + condlog(1, "%s: invalid value for %s: \"%s\"", + __func__, (char*)VECTOR_SLOT(strvec, 0), buff); + rc = 1; + } else { + rc = 0; + *uint_ptr = res; + } + + FREE(buff); + return rc; } static int From patchwork Sat Oct 12 21:28:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187031 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 C8C8614ED for ; Sat, 12 Oct 2019 21:31:06 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A595220700 for ; Sat, 12 Oct 2019 21:31:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A595220700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF3661DB6; Sat, 12 Oct 2019 21:31:05 +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 9B71D5C226; Sat, 12 Oct 2019 21:31:05 +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 681FC4EA71; Sat, 12 Oct 2019 21:31:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUJFU006584 for ; Sat, 12 Oct 2019 17:30:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 93B9AF6E1; Sat, 12 Oct 2019 21:30:19 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 871E519C70; Sat, 12 Oct 2019 21:30:19 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D3D9300BEAB; Sat, 12 Oct 2019 21:30:18 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.190) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:34 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:28:59 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.10) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UDTbWyB5TpzhlwF08tfDaCYuuUoWKJdOQqs9t6lRg+S6v5z3ffA8Y1ySha3Nc19aOIG+oqV6+vgl4NUujf+w7njmfDMaHAl7kW6roF428p41tH361ZupIHaGBVBjZd5IOxx/j8R01H64QzyNPEtoHX/0bPbvcIO1TiSoLNuhNwroekOUicZtiPkHBus+KRyj81xDrcGEv9y8l/Nz9aJDE6Et9JVnHHzIRAXm7UrQ+Tmv8qW7noir1tgBGk9vfoyVNqtHpyc3kfgBLPJof+aQ4+XGw9H9XX/IxoEK4K3mN5aW66dmeS6B1tT3m298OFMJYm58ggedyVMqwiapVS4XbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rgjc6dqCf4sVCU93dqnP3WjIfoVCatAZI2Xp158RssU=; b=QqmZUi9/P0JaGtptRyfF4AI4mAKGxknYbPRnmv8jul8SOjX39UmEw7I9WT8h7Kmfy2WQs9rYSurv2SGjDy2z0EwKpZB9JVglVQczZGcUdVaqGwiTKU0kpD7xmROhSg4wDwdUldGRLCzVjMHaR14v2oRqlpjNkmHyx2t+I6NPaY86SdxwsNPvK2u0sFfU7HwVIyEvxk5EkzO7H9jZGEXABDECmcBXmcvyfTrSaIutaFFGCSk3M+flKJVPVmW45kq8kfK9iAtTlaiQmoWvrhCR43XpdOgNs4+0cqmwBsky1WQPnbrC6Bu6zUKNJNxVGAGhHJVhaF4Kn0S/tF22S7UGUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:56 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:56 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 51/72] libmultipath: make "checkint" unsigned Thread-Index: AQHVgUQEn/EfbojPIEGiRqSOTky+KQ== Date: Sat, 12 Oct 2019 21:28:40 +0000 Message-ID: <20191012212703.12989-52-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 760750c7-7d50-433c-cb67-08d74f5b267d x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:36; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wOttwWlbfbftTACY7/ovWNCZurEu8rZuaGLYQzQ/B9SGPqL5SR/HuJZ7yWiGQpDqGT+WbBG4TX/k9KamrBbMJsFjdUb4lfesUAUkklMyrvliQ5rYYPZJqdBHIVsbgbUtKhSt6vKDHaS1skJ3htErLOdc3v5Gy9tA4z7Og+25m7yxDykKfTUtmvHUDMYWnoV3cXh7nZRfGAPpBoBB8EgObIPdI1rsbNbmnrx5QFC1zgwDDpquPyKJqGGwGvzS15ktT7fte0CSdaOiVe21gjr39jpU4Y5N0jyBbwxRG1JvgTypvjE8Iexvq2goOzHvjW/mzY8Awr/popYnuNw62RE/+5uhqExFR95PAxjLwnLElhObwK7jrQ4KsKBWGbdTICS/zsSRPpjMQPrRRonjXOyClUctf9lJ/9cuDogJ7LfSFpU= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 760750c7-7d50-433c-cb67-08d74f5b267d X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:40.4020 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rvP87pZi/QoRA7PqCSJa/gwPC7J9RQnNCp2sgAuE1q+2YEjF22t1cOUaRe73vjan6QuA9ODBdM/45sJLDR9EhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 12 Oct 2019 21:30:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 12 Oct 2019 21:30:18 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUJFU006584 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 51/72] libmultipath: make "checkint" unsigned 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Sat, 12 Oct 2019 21:31:06 +0000 (UTC) From: Martin Wilck path->checkint was unsigned already, now use this type everywhere. Signed-off-by: Martin Wilck --- libmultipath/config.h | 4 ++-- libmultipath/dict.c | 4 ++-- libmultipath/discovery.c | 2 +- libmultipath/discovery.h | 2 +- libmultipath/io_err_stat.c | 2 +- libmultipath/structs_vec.c | 2 +- multipathd/main.c | 10 ++++++---- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/libmultipath/config.h b/libmultipath/config.h index ffec3103..2ab7b42c 100644 --- a/libmultipath/config.h +++ b/libmultipath/config.h @@ -137,8 +137,8 @@ struct config { int pgpolicy; int minio; int minio_rq; - int checkint; - int max_checkint; + unsigned int checkint; + unsigned int max_checkint; int pgfailback; int remove; int rr_weight; diff --git a/libmultipath/dict.c b/libmultipath/dict.c index c23d525b..a90690fa 100644 --- a/libmultipath/dict.c +++ b/libmultipath/dict.c @@ -314,7 +314,7 @@ snprint_mp_ ## option (struct config *conf, char * buff, int len, \ static int checkint_handler(struct config *conf, vector strvec) { - int rc = set_int(strvec, &conf->checkint); + int rc = set_uint(strvec, &conf->checkint); if (rc) return rc; @@ -325,7 +325,7 @@ static int checkint_handler(struct config *conf, vector strvec) declare_def_snprint(checkint, print_int) -declare_def_handler(max_checkint, set_int) +declare_def_handler(max_checkint, set_uint) declare_def_snprint(max_checkint, print_int) declare_def_handler(verbosity, set_int) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 6288c3e0..4288c9fd 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -754,7 +754,7 @@ sysfs_set_nexus_loss_tmo(struct multipath *mpp, struct path *pp) } int -sysfs_set_scsi_tmo (struct multipath *mpp, int checkint) +sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint) { struct path *pp; int i; diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h index 8d04c2af..0516e41b 100644 --- a/libmultipath/discovery.h +++ b/libmultipath/discovery.h @@ -42,7 +42,7 @@ int alloc_path_with_pathinfo (struct config *conf, struct udev_device *udevice, int store_pathinfo (vector pathvec, struct config *conf, struct udev_device *udevice, int flag, struct path **pp_ptr); -int sysfs_set_scsi_tmo (struct multipath *mpp, int checkint); +int sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint); int sysfs_get_timeout(const struct path *pp, unsigned int *timeout); int sysfs_get_host_pci_name(const struct path *pp, char *pci_name); int sysfs_get_iscsi_ip_address(const struct path *pp, char *ip_address); diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c index 6b3a3e19..d7e296fa 100644 --- a/libmultipath/io_err_stat.c +++ b/libmultipath/io_err_stat.c @@ -357,7 +357,7 @@ int io_err_stat_handle_pathfail(struct path *path) if (path->state != PATH_DOWN) { struct config *conf; int oldstate = path->state; - int checkint; + unsigned int checkint; conf = get_multipath_config(); checkint = conf->checkint; diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c index c43b58fb..6991f9ac 100644 --- a/libmultipath/structs_vec.c +++ b/libmultipath/structs_vec.c @@ -292,7 +292,7 @@ update_multipath_strings(struct multipath *mpp, vector pathvec, int is_daemon) void enter_recovery_mode(struct multipath *mpp) { - int checkint; + unsigned int checkint; struct config *conf = get_multipath_config(); checkint = conf->checkint; put_multipath_config(conf); diff --git a/multipathd/main.c b/multipathd/main.c index 26d5aa9c..bb5c1f1d 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -493,7 +493,7 @@ int update_multipath (struct vectors *vecs, char *mapname, int reset) if (pp->state != PATH_DOWN) { struct config *conf; int oldstate = pp->state; - int checkint; + unsigned int checkint; conf = get_multipath_config(); checkint = conf->checkint; @@ -1985,7 +1985,7 @@ should_skip_path(struct path *pp){ * and '0' otherwise */ int -check_path (struct vectors * vecs, struct path * pp, int ticks) +check_path (struct vectors * vecs, struct path * pp, unsigned int ticks) { int newstate; int new_path_up = 0; @@ -1993,7 +1993,8 @@ check_path (struct vectors * vecs, struct path * pp, int ticks) int add_active; int disable_reinstate = 0; int oldchkrstate = pp->chkrstate; - int retrigger_tries, checkint, max_checkint, verbosity; + int retrigger_tries, verbosity; + unsigned int checkint, max_checkint; struct config *conf; int marginal_pathgroups, marginal_changed = 0; int ret; @@ -2333,7 +2334,8 @@ checkerloop (void *ap) while (1) { struct timespec diff_time, start_time, end_time; - int num_paths = 0, ticks = 0, strict_timing, rc = 0; + int num_paths = 0, strict_timing, rc = 0; + unsigned int ticks = 0; get_monotonic_time(&start_time); if (start_time.tv_sec && last_time.tv_sec) { From patchwork Sat Oct 12 21:28:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187081 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 7EB1E14ED for ; Sat, 12 Oct 2019 21:33:53 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5BB8420700 for ; Sat, 12 Oct 2019 21:33:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BB8420700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A1A4818C428F; Sat, 12 Oct 2019 21:33:52 +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 80C5E5C226; Sat, 12 Oct 2019 21:33:52 +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 550014EE6A; Sat, 12 Oct 2019 21:33:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUN9g006631 for ; Sat, 12 Oct 2019 17:30:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id C7C90413A; Sat, 12 Oct 2019 21:30:23 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD241424F; Sat, 12 Oct 2019 21:30:23 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A2ACB3076BC1; Sat, 12 Oct 2019 21:30:22 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.190) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:38 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:00 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SHj3jAxla7Fipm+7fcVbNq5Krq4blpABaCxhny7demEBnpu+PO48vtgjVr4xGCpQYdnsc5OvzsDy1z7gNgX2HyMryNUCvTSWxdtf4bNqPE9Ifo7wNBeNvdo4Tm84EN0m9SBEv02mAePE3WsLp3i/xI63y5P2pMg3nGAuOfKxbpUbAbY1otz/kWuttYGyvQrjywSPNOlyPxdRqnGUeV19Ghxz2/wjrD/Zd+SoUFl21yLfYE0ROZ3RmORPg+kNKs6wpbt0Q4fGv34bP0WSduB3+ETtHOJ6qpQolykTzvP2+BRc5Vougizz5XWMFLWjK9YChAho23gz4tWnSKO5D1F4bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SPS4qFFk//nTqXswvFHn+6qHtTNDIj9apVglpQxjW7Y=; b=gC0peuSDtIntt3ac45lt7hy/lrb2KpZNdroA5BsPcPzoQwkyQblblWxSHzzx8DIsMEgBXKaDzs1ODZNqHj3xnyiGRUhIwMc6rDARQI9yhH6JLcbHwDwkGpCgLZwUaUC9XwZNszZn7F0U8mevVSaDjruhrV/nvrD8D0xRQ0tNWq6JsJyAYQgESm4TNiByw50rmzQQspC/WR1tRlj2kY5I3OLEwEPHrR/TxVJPUsHXj6PZFXJ30b7Wg5VhklZr1cLtS3qA3QZETQCN6J/P8qSZ8aS9mim3FfhVG+KKYRpG6YyrUdoTceR5L2+aUwt0jVDeMfVTa7P1aLQH6lxxGtHXeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:56 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:56 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 52/72] libmultipath: use unsigned blksize in directio context Thread-Index: AQHVgUQE65T1J0216UmsPbDPYrZ0Cw== Date: Sat, 12 Oct 2019 21:28:41 +0000 Message-ID: <20191012212703.12989-53-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e0577557-83f4-4254-4633-08d74f5b272a x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:288; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XZoyjJXbzeuJ9Zr8OXlD0zIFXJszhTdsProLJQic5HnwZwBwKVgq8p6woFfD+gEFJchPcxgmalMYeLLUITGZGE32oIHXfYFOYmp85etZBw9qDQRAr2pVAz5PVcWgVFzQ9KGhm+7J/Iv/appgp79r+S2yM92c+IKAgxdoX+o0pWJlI5A1CbVZ3BBqXokv1QZLvKJ/SZKmfCZkhhM0oErCBDEfsPbIBMCNO5c1VQbgC27JuumLGSl0PFPm9gGJyjHuOQFNRH71YVom5jnPrMUN4TS0qBSmLaP8wT1PZLK9ldPekQb7EOTikiwmcyaYpraDeMEcEal6FPKgZrSeIlXomUXZVY6J2pGo6mi29ylfBS+m5NcbE3BX4rFTWruuDStRuNpjQ9T//C6Ej380Q9e4LrapRGNSAM2xU1LUeM6+0tc= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e0577557-83f4-4254-4633-08d74f5b272a X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:41.6883 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VS9BrOVo7DulB1kLPeEgfj3m8BaG6RDo0ELgX92eNLOax3Ry78V3N3zQ0tCo5EqMTHudIqsJvdjrI5+Pd79xOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sat, 12 Oct 2019 21:30:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sat, 12 Oct 2019 21:30:23 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUN9g006631 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 52/72] libmultipath: use unsigned blksize in directio context 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Sat, 12 Oct 2019 21:33:53 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/checkers/directio.c | 2 +- libmultipath/io_err_stat.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libmultipath/checkers/directio.c b/libmultipath/checkers/directio.c index 1b00b775..239a811c 100644 --- a/libmultipath/checkers/directio.c +++ b/libmultipath/checkers/directio.c @@ -37,7 +37,7 @@ const char *libcheck_msgtable[] = { struct directio_context { int running; int reset_flags; - int blksize; + unsigned int blksize; unsigned char * buf; unsigned char * ptr; io_context_t ioctx; diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c index d7e296fa..dcc8690d 100644 --- a/libmultipath/io_err_stat.c +++ b/libmultipath/io_err_stat.c @@ -54,7 +54,7 @@ struct io_err_stat_pathvec { struct dio_ctx { struct timespec io_starttime; - int blksize; + unsigned int blksize; void *buf; struct iocb io; }; @@ -128,7 +128,7 @@ static int setup_directio_ctx(struct io_err_stat_path *p) { unsigned long pgsize = getpagesize(); char fpath[PATH_MAX]; - int blksize = 0; + unsigned int blksize = 0; int i; if (snprintf(fpath, PATH_MAX, "/dev/%s", p->devname) >= PATH_MAX) From patchwork Sat Oct 12 21:28:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187065 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 8907F14ED for ; Sat, 12 Oct 2019 21:32:50 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 661952089C for ; Sat, 12 Oct 2019 21:32:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 661952089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A7380316EFEC; Sat, 12 Oct 2019 21:32:49 +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 82CD05D772; Sat, 12 Oct 2019 21:32:49 +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 4D3294EE71; Sat, 12 Oct 2019 21:32:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLTgFG006401 for ; Sat, 12 Oct 2019 17:29:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 87A7E19C70; Sat, 12 Oct 2019 21:29:42 +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 0488D19C6A; Sat, 12 Oct 2019 21:29:40 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB396356C9; Sat, 12 Oct 2019 21:29:38 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:00 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:00 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m7d3TzZl8LTq01S7d41G7QQUIR6p7brI4XPfyVtjizmQPRaiEURyznF9yG8bMRgh3CxrDaWN5qFDvm2Nmq/Qh5hxAwGMbL7BWktw/pJ3MypsmN4i53oljE+McM0jSlv+eY+B+qY8b8t4YA83dYAYzF3NEB9XLkAuAI/qZt9BGtqB4FrHBiNLe6qwy6ZVF5MQqiCfwlacXjH7tMLZw7muNkoBaa9R6STztjsm9QOs0h7KI4L4KjvL8oPLNnkqmF6dUQEsWugSzyZ5EgTrmAKSVdiygBHADDCR8mVmaKfZZMIa724zpeD+sKuMa3vAe3fKgXQkTxm4p/SCJKcEhxUjEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JDe8F+Q0lTfy4JujH1OmKlv9IXWdPR8UrhmXYl3Qk/s=; b=euBLUkxy+uxZr0HuK9wAaPBP7mKhwhMD7rqRvgUXzdX99annslkpiZLDSINuvFDdTX/BRayYSUKdqslpcpEG2IgOgAx+9j0C+jjjvTnJYrIaM/3Nk5+H8IkIzJFz1+ScTuP1Ha0tJgDu1R2GeX0fiaGl6wGpT9G1qA+HOFS9UcIM9sYo8kVdIK2bsDO4C5kn3Kzq/e/PrKGjT6Nqioa6QgjPJ6MlUj4CVYcqkHDgYhYPMtIl+y6okiLR15Qg/GaSVrTuyEeKbYJ0iiQmb2I+nGCIOz9Efhrx0UrzJkB9+VH3tMkqSMUMBK8vHPfahcJ4k3lACI2y4YgC5mdRWf1Xwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:57 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:57 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 53/72] libmultipath, kpartx: byteorder: always use unsigned types Thread-Index: AQHVgUQFE9QLCiotBU6gO6k8M8OIyQ== Date: Sat, 12 Oct 2019 21:28:42 +0000 Message-ID: <20191012212703.12989-54-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b3606315-69b8-4a1c-8e96-08d74f5b27fe x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:175; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 388OlPHew8+x5ZP+hWGv35k0uTq5Jd7jHM9ol++m5LvDWWKbxo504w40/lghKBwVIh5In3ye6ydwdD+kNZ5rjfs9NSPr1vqf+Bqy8oUo/lCa5Br8BATF301RND+gjkkB4HUaM1Tbl6xqBEt1FAUOnX8or3bYDrELjxuSYVuQKXuJ+ZRmuphqRqjyHByftNn6MV5oZYMK2iY09DGqHd2+f7bE3ni/tG3yPOkymKbFJe4yHO5tltksayZdHWGtCzi29L7Hgi8qtWAi4zJTCkmg55RM+mVzAd2uEDPpvOAna30pZi8sStRGHNNPdJQR3RbKyY6OSKjJjc77vUfQHZUAeOoodb4Zt04BSSds9S1ptKLdtaWuC0BnpYYqYPGLEPHWOVU9P27x3I2kQnNOpFTuAkV9amM7gXDWinqp8Up7hPw= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b3606315-69b8-4a1c-8e96-08d74f5b27fe X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:42.9186 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5aiC0mghbgt+tPHmNMAE5izmlzuAnma77va+h5ogHgFzraFtp6gupwVRqLOTYs9iTVCYT7ffBHNNCS7VXyvdvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 12 Oct 2019 21:29:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sat, 12 Oct 2019 21:29:39 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLTgFG006401 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 53/72] libmultipath, kpartx: byteorder: always use unsigned types 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 12 Oct 2019 21:32:50 +0000 (UTC) From: Martin Wilck The swapped results are unsigned, so the non-swapped ones should be unsigned, too. Signed-off-by: Martin Wilck --- kpartx/gpt.c | 6 +++--- libmultipath/byteorder.h | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kpartx/gpt.c b/kpartx/gpt.c index 4f88d486..aa2a440c 100644 --- a/kpartx/gpt.c +++ b/kpartx/gpt.c @@ -40,9 +40,9 @@ #include "kpartx.h" #if BYTE_ORDER == LITTLE_ENDIAN -# define __le16_to_cpu(x) (x) -# define __le32_to_cpu(x) (x) -# define __le64_to_cpu(x) (x) +# define __le16_to_cpu(x) (uint16_t)(x) +# define __le32_to_cpu(x) (uint32_t)(x) +# define __le64_to_cpu(x) (uint64_t)(x) # define __cpu_to_le32(x) (x) #elif BYTE_ORDER == BIG_ENDIAN # define __le16_to_cpu(x) bswap_16(x) diff --git a/libmultipath/byteorder.h b/libmultipath/byteorder.h index 5c771467..0a862447 100644 --- a/libmultipath/byteorder.h +++ b/libmultipath/byteorder.h @@ -9,19 +9,19 @@ #endif #if BYTE_ORDER == LITTLE_ENDIAN -# define le16_to_cpu(x) (x) +# define le16_to_cpu(x) (uint16_t)(x) # define be16_to_cpu(x) bswap_16(x) -# define le32_to_cpu(x) (x) -# define le64_to_cpu(x) (x) +# define le32_to_cpu(x) (uint32_t)(x) +# define le64_to_cpu(x) (uint64_t)(x) # define be32_to_cpu(x) bswap_32(x) # define be64_to_cpu(x) bswap_64(x) #elif BYTE_ORDER == BIG_ENDIAN # define le16_to_cpu(x) bswap_16(x) -# define be16_to_cpu(x) (x) +# define be16_to_cpu(x) (uint16_t)(x) # define le32_to_cpu(x) bswap_32(x) # define le64_to_cpu(x) bswap_64(x) -# define be32_to_cpu(x) (x) -# define be64_to_cpu(x) (x) +# define be32_to_cpu(x) (uint32_t)(x) +# define be64_to_cpu(x) (uint64_t)(x) #else # error unsupported #endif From patchwork Sat Oct 12 21:28:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187095 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 A6F9517EE for ; Sat, 12 Oct 2019 21:34:41 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8464220700 for ; Sat, 12 Oct 2019 21:34:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8464220700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BDEC218CB91C; Sat, 12 Oct 2019 21:34:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 977125C223; Sat, 12 Oct 2019 21:34:40 +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 5B062180BA9B; Sat, 12 Oct 2019 21:34:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUReI006660 for ; Sat, 12 Oct 2019 17:30:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 32AAB19C70; Sat, 12 Oct 2019 21:30:27 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 299FA19C6A; Sat, 12 Oct 2019 21:30:27 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1803E8666C; Sat, 12 Oct 2019 21:30:26 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.190) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:42 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:00 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mXPCNAeTgCu34M07e9oSI0Rnhp/n5MDpMThu+0Z5cOj7YzTQeGcEH+xA4rfX1fxwIMRFD/cpejsuh/yiDcMbtb1hSrm1Z6IrWQrV3AidgzxbU9OSK30SnNJjVtOta+Juqbud6+b6mPUi071WLb24h3yHVxJ98fspbtMVCZpH7IomYtd2HJzpEDdUkcPODQERhf0WHBb9QZQCpt2qWQPugEXPCm3Id6s/lXNenbygDU8KYfVjsmqMVe4OHVT8WJr44hk9FAi9aDMuMcvaCUwrRw//CZ/FPjL+d6mp8qv/3NL8TuZzhgx1NAh5imDxKgqfOmqoDPH5WD2PdWY+2SPosQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/lcoTlH+opvHWXHYoeUtXPE4SxW9SETW4lVWpF/S5us=; b=EG7ej2J30qU13O/CuY1d4N66/1khPlzamsRP4rOg19m7RaHSlq5k6+1EKMj5XY1JqT74vTdeEq9r1t300wT1R2POWs3Ng/r39uFGQO8XubBZRQUI1l6mRLbwRL9F7w+9Q1dCfxwHe7qmoHYAvwUYLvKMP1DI3oG63MVovEc4KXfYBWplayoSdzzuXfOK1W3xOQL72Y67ZGY5/S1vaJQ5Q/tHHAf/ZvSDy4pvzmXnGgmrBGaceGaxz3i4MuwK4s3KT/X+1ExH3LzVWafvaQuNOd4WsFvb4V5tkBjYHV/9KgUFN2a7mkw9JoEdbxUc+sKnDSGU3CQ+oy1BKwYLF+oRfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:57 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:57 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 54/72] libmpathcmd: fix -Wsign-compare warnings Thread-Index: AQHVgUQGWZB+g0zMY06dqTPEFclz/Q== Date: Sat, 12 Oct 2019 21:28:44 +0000 Message-ID: <20191012212703.12989-55-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: eead2dd2-ac01-4890-7e8a-08d74f5b28ab x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:346; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: W4GGIHf4rgOPJJOzGTGLjLkyjBIOSnEGsR6xswfrj3BvWtDBdKx9SbvppwT3AEj2OE1E6qoNSTiIUypIy0MXnPGfHGJo/AbCGLdwIif2nVS8n+QaRQuo+0MZg1DddikYK3f3ZhPbY9tT0QeQDSrY/9n71Kq4dQh9jxLde2UNzl2Jz8hhrUSldm1wc0tyRSltaHciCq4hSIO1k2857ObwoK7A5QstcBx+HIF64ByQQ+yjPMNwo8XNhp5m6QhBjQPif1NPuSjgk1mlSX6+RFJaV8u5JNpD5o+50qgbaDWDe7ReeBLJSfWnb/OnXEVHK8N6AOefGyBV8MVwFz6eLFu26tZKhcP3MfeBLjCOqK6PP0hcNP+ZxVDL24lTU1cqEnQHuiYUP54YTgnh6P56dOmu8E0IZd1Tm/TFySn1uO7Vnmo= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: eead2dd2-ac01-4890-7e8a-08d74f5b28ab X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:44.1948 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GpQX2dTGi5e74ttQb4rTBqj+nBNu9ee/lE09IRnvADHAygpTNbo5OSpAcfjyAgaI7NSsIzmfb2dJo6baZ19n5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 12 Oct 2019 21:30:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 12 Oct 2019 21:30:26 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUReI006660 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 54/72] libmpathcmd: fix -Wsign-compare warnings 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Sat, 12 Oct 2019 21:34:41 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmpathcmd/mpath_cmd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmpathcmd/mpath_cmd.c b/libmpathcmd/mpath_cmd.c index f00bf7e1..60b2d965 100644 --- a/libmpathcmd/mpath_cmd.c +++ b/libmpathcmd/mpath_cmd.c @@ -96,7 +96,8 @@ static size_t write_all(int fd, const void *buf, size_t len) */ int __mpath_connect(int nonblocking) { - int fd, len; + int fd; + size_t len; struct sockaddr_un addr; int flags = 0; @@ -172,7 +173,7 @@ int mpath_recv_reply_data(int fd, char *reply, size_t len, ret = read_all(fd, reply, len, timeout); if (ret < 0) return ret; - if (ret != len) { + if ((size_t)ret != len) { errno = EIO; return -1; } From patchwork Sat Oct 12 21:28:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187099 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 84672112B for ; Sat, 12 Oct 2019 21:35:02 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 61D5820700 for ; Sat, 12 Oct 2019 21:35:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 61D5820700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9201610CC1F9; Sat, 12 Oct 2019 21:35:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6A1AB5C223; Sat, 12 Oct 2019 21:35:01 +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 2F75F18037C9; Sat, 12 Oct 2019 21:35:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUTUK006675 for ; Sat, 12 Oct 2019 17:30:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 726CD5D717; Sat, 12 Oct 2019 21:30:29 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2669B5D6A3; Sat, 12 Oct 2019 21:30:27 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C504A3090FD1; Sat, 12 Oct 2019 21:30:25 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:47 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:01 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kVS7pFebbx+mSXQ0GHzkFvaxHM+V1W6LtIaDhUhDOGoxEIGXdIVqfKb1ChRws4ySI1M8HJkx5+Tktq0m9OmK+N20yvQMxMzOMQTuMiWODAxlcszzKl0YHcsh4aRTLWAzr+1c23gD2vp1Agy4A+KrwVpgenYcn2mO5mTw3HFZFQIQXn93a0MTPQMxWMMfql+YHs4rJmIMJJvX3JsZ4GXZrytNRnHqNqfA/mlGoemDAXpHgh9O6PptSvPjSR9wBG3cXasTsZ5weVbFiSeIHQgjby2NBWmws5CYU8Z3kCEygsmar7fm9LAHIFkTNSb/+cFJWF20Kpy3xKy1UoZc5LaSEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XanBbfJcXPRntUx0bTMwK8UER6q2AkYciCn2lSWUklA=; b=MhHIdAyPm5BtoQlef3WBUEm4rmiKXyrmtpTXcCwjWlFf/WPSJeRZwymMZDL3VTqZRFaTK/Z8HhIN3imBugGIR/TEfXTwONN8JADMo++PgEmePAs+CSG99O2FglabvX8Zdzoek9SIuaoFP3vi8j0Im7nWIup92d/W5ncEdfX8sN2xPAc0ZcEf6xIgcDMpF3CyjaeklwR9yvfOZpHFdCg6Y9clNSrW2cj5Msn6zYSPvX0g6E6bLSOXFdMe+vGwEnYWqMBatevjgOqtnH3PTafq6wWGAczMkAbpWnt71ig/eRku9nrJJHQCh/sM1EeU0P34FLiPf09s/5oBD9Y+/d7O+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:57 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:57 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 55/72] libmpathpersist: fix -Wsign-compare warnings Thread-Index: AQHVgUQH+KMgGVL0dUmJ3nYqYQCSEg== Date: Sat, 12 Oct 2019 21:28:45 +0000 Message-ID: <20191012212703.12989-56-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ace5b15a-f1d4-44b1-04f1-08d74f5b296d x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1013; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dmZysS3nSBh1DSIuzv0ely0acl+GE0drvkF9sFoYwvz7R3GUxWBx0wrmKnnnLTWLE/RMAoF9lKljaZOk7wh9PSteRo/zIQ9wbhMMnVYYWSqbUs1JtBT0HMcgu+9ovDauSpnXilgzJetOoNeIk22RWXnzoKFyoDL5Grc5kTiQw1WSAyDwLEF9bDhz+nSbdFqndChEnhuo9awqiAYXVZHPHH8eJdHtM8hVR52CLShWcmbjcWievy3IA4P1KL98ZApq1bwypnwc3SJmbIeMfT6HCzFQZrFHQM2lQYg97k8AiNHCjcerVm77VWsCHx2NgucnP5zGE5YgVy98xMAf4BCO6owqoWsXyTp3Mc5qLGOoUkdKQkQSntHOTxHTyq/YpmZ4LVVMwnTQLHcrbIs/s1OeUI27QC9sBj/5BT0UN7702Bo= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ace5b15a-f1d4-44b1-04f1-08d74f5b296d X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:45.3272 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: douC31w0QCEWv3wOUH4g5CUcz235tDyF5mMpT9/r/wcWyxnIo+6Vl73d8OFcc4PvOgIGYFVjuBluckl5xNIV2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sat, 12 Oct 2019 21:30:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Sat, 12 Oct 2019 21:30:26 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUTUK006675 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 55/72] libmpathpersist: fix -Wsign-compare warnings 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Sat, 12 Oct 2019 21:35:02 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmpathpersist/mpath_persist.c | 3 ++- libmpathpersist/mpath_pr_ioctl.c | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c index 603cfc3b..0c57dd92 100644 --- a/libmpathpersist/mpath_persist.c +++ b/libmpathpersist/mpath_persist.c @@ -854,7 +854,8 @@ int update_map_pr(struct multipath *mpp) { int noisy=0; struct prin_resp *resp; - int i, ret, isFound; + unsigned int i; + int ret, isFound; if (!get_be64(mpp->reservation_key)) { diff --git a/libmpathpersist/mpath_pr_ioctl.c b/libmpathpersist/mpath_pr_ioctl.c index 05b30b56..74b26b0c 100644 --- a/libmpathpersist/mpath_pr_ioctl.c +++ b/libmpathpersist/mpath_pr_ioctl.c @@ -140,7 +140,7 @@ retry : uint32_t format_transportids(struct prout_param_descriptor *paramp) { - int i = 0, len; + unsigned int i = 0, len; uint32_t buff_offset = 4; memset(paramp->private_buffer, 0, MPATH_MAX_PARAM_LEN); for (i=0; i < paramp->num_transportid; i++ ) @@ -204,11 +204,11 @@ static void mpath_format_reportcapabilities(struct prin_resp *pr_buff) static void mpath_format_readfullstatus(struct prin_resp *pr_buff) { - int num, k, tid_len_len=0; + int num; uint32_t fdesc_count=0; unsigned char *p; char *ppbuff; - uint32_t additional_length; + uint32_t additional_length, k, tid_len_len = 0; char tempbuff[MPATH_MAX_PARAM_LEN]; struct prin_fulldescr fdesc; @@ -269,8 +269,8 @@ static void mpath_format_readfullstatus(struct prin_resp *pr_buff) void decode_transport_id(struct prin_fulldescr *fdesc, unsigned char * p, int length) { - int num, k; - int jump; + unsigned int num; + int jump, k; for (k = 0, jump = 24; k < length; k += jump, p += jump) { fdesc->trnptid.format_code = ((p[0] >> 6) & 0x3); fdesc->trnptid.protocol_id = (p[0] & 0xf); From patchwork Sat Oct 12 21:28:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187053 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 6C47C14ED for ; Sat, 12 Oct 2019 21:32:09 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48E7420700 for ; Sat, 12 Oct 2019 21:32:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48E7420700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7282A2D0FC7; Sat, 12 Oct 2019 21:32:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C3FC19C70; Sat, 12 Oct 2019 21:32:08 +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 1851C180B780; Sat, 12 Oct 2019 21:32:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUVOA006689 for ; Sat, 12 Oct 2019 17:30:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 98EC65C22F; Sat, 12 Oct 2019 21:30:31 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8FB955C223; Sat, 12 Oct 2019 21:30:31 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 17365C049E12; Sat, 12 Oct 2019 21:30:30 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.190) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:46 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:01 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eAn4v4IIC5QBHjLRL3NmFg77+1+7fl0Np2gEYfCLyA8pNVG5TSnUEhu+8rUJhMS7BgUNXeWNt5z1OA8lA6gWRkE/36yRn4aQFQFxtx19w3AltPUrfKbkhuzOstgup7I+p3mM65x/lJRNjyOuDNc8TZhKI93IwLyiP70lvgE+TQAXlyFCTOdavbMAOZUZhzWdvxWmwEPZ/WDczd5z2YMdkULZ46aqAE0bFvauwYtv1uS5ZKkXYc2pKyexN55U+gRHbCLywibtVKBQs8NsKpVNl81M4wy2VcM+R1KxIEA3esHziHMpL616n9HWGM0BzUI06qdkOVgigSudq5ONxrABuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I0sTLvrqsXPdlOifkXLxCW+ekI7YZ/5qZE3oTGnKQAM=; b=Dc3vIeANMnXGylPz41mcjHnZ/DTW4/6t/iW6AQpDhS08p/185IdVX/cRQ9YwzR1GOj1fLcvoFigbESgQ6vaF4BaRdUAS+NVmBmWj/EvwoKXlZh1MUPdnCFWSX4LZuTUMpvbIjZ+S7bVG6Hz22ZCsKj1pAo1Jdo0l+YTgjnmYF6kvo7rgVEDwKUjKvBtAOEZ5nb758MzIIZNkPjQA9E6lNhf2GezHQu+Ts44bIM/kQgBNOHKSCViWmrQV72hfVjGH6ue+2q/mg589D0nSTm3HahJh+yoGNwaS0yG2JX8HhFHsTCcXIQu9rX1qL2vAZwAT/9VkRssgYfSfL57jVasbJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:58 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:58 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 56/72] kpartx: use unsigned arguments in dm_devn() and dm_prereq() Thread-Index: AQHVgUQHj6XK5cW6JEuzyaULOf8Hcw== Date: Sat, 12 Oct 2019 21:28:46 +0000 Message-ID: <20191012212703.12989-57-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a419ac1d-ecb8-420b-3a01-08d74f5b2a1e x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:483; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: O/SZKY3//Ls0nOIRcdLD8I4OrDRFNJaVGe24pOW6i3xHqMiUnVyA4zUVTKA/B/aAiLGpEK5s3S0KkOJP7X6RkYV4iHsjxGoiD4yf0uSs2RvLIdSE0FsHgp7rRrLDDOk9hsU3SUKQggp101LCUxOyhQvAAqQRnb+xfCRFFfSeDdd2NaTY+YahCPGuPxQwk7g1PDf4XRb77zGoAtOTxVZnW8DRsRKWvLK9+ifh0ASlZDSgH/O3PvVEx7ZvhskLgJehN4oSFc1c9hjOIu7nysubNGXYosIEHJHKpbYXH4/4mHvV221nlj2rUpta3A/fLEHtTTOsi1hCLLISXgMZ6ir4f/LmipM9aZGoGPCvGnK3zoevjXUKfMuPZf65F2vwz7tFbEoQKnyxG7oiNgXmfXuRAdyyv3kDUp3FClcLOCTuuuU= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a419ac1d-ecb8-420b-3a01-08d74f5b2a1e X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:46.6694 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: zA5P9fyCL14aHseRhQQMgKdZ5+joXpAbtC6NuxD+EKY+4nUyx+HwhFpxEDnpkgWAMkPMhVf5rS16m7opDpG00g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:30:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:30:31 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUVOA006689 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 56/72] kpartx: use unsigned arguments in dm_devn() and dm_prereq() 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 12 Oct 2019 21:32:08 +0000 (UTC) From: Martin Wilck In both cases, the corresponding libdevmapper values are unsigned. Signed-off-by: Martin Wilck --- kpartx/devmapper.c | 10 +++++----- kpartx/devmapper.h | 7 ++++--- kpartx/kpartx.h | 7 ++++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c index 7e599e07..9a3dd5f8 100644 --- a/kpartx/devmapper.c +++ b/kpartx/devmapper.c @@ -17,7 +17,7 @@ #define MAX_PREFIX_LEN (_UUID_PREFIX_LEN + 4) #define PARAMS_SIZE 1024 -int dm_prereq(char * str, int x, int y, int z) +int dm_prereq(char * str, uint32_t x, uint32_t y, uint32_t z) { int r = 1; struct dm_task *dmt; @@ -359,7 +359,7 @@ out: } int -dm_devn (const char * mapname, int *major, int *minor) +dm_devn (const char * mapname, unsigned int *major, unsigned int *minor) { int r = 1; struct dm_task *dmt; @@ -528,7 +528,7 @@ do_foreach_partmaps (const char * mapname, const char *uuid, struct remove_data *rd = data; unsigned next = 0; char params[PARAMS_SIZE]; - int major, minor; + unsigned int major, minor; char dev_t[32]; int r = 1; int is_dmdev = 1; @@ -645,7 +645,7 @@ int dm_find_part(const char *parent, const char *delim, int part, char params[PARAMS_SIZE]; char *tmp; char *uuid; - int major, minor; + unsigned int major, minor; char dev_t[32]; if (!format_partname(name, namesiz, parent, delim, part)) { @@ -715,7 +715,7 @@ char *nondm_create_uuid(dev_t devt) return uuid_buf; } -int nondm_parse_uuid(const char *uuid, int *major, int *minor) +int nondm_parse_uuid(const char *uuid, unsigned int *major, unsigned int *minor) { const char *p; char *e; diff --git a/kpartx/devmapper.h b/kpartx/devmapper.h index 73b80f2f..701bdf6e 100644 --- a/kpartx/devmapper.h +++ b/kpartx/devmapper.h @@ -9,14 +9,14 @@ extern int udev_sync; -int dm_prereq (char *, int, int, int); +int dm_prereq (char *, uint32_t, uint32_t, uint32_t); int dm_simplecmd (int, const char *, int, uint16_t); int dm_addmap (int, const char *, const char *, const char *, uint64_t, int, const char *, int, mode_t, uid_t, gid_t); char * dm_mapname(int major, int minor); dev_t dm_get_first_dep(char *devname); char * dm_mapuuid(const char *mapname); -int dm_devn (const char * mapname, int *major, int *minor); +int dm_devn (const char * mapname, unsigned int *major, unsigned int *minor); int dm_remove_partmaps (char * mapname, char *uuid, dev_t devt, int verbose); int dm_find_part(const char *parent, const char *delim, int part, const char *parent_uuid, @@ -34,5 +34,6 @@ int dm_find_part(const char *parent, const char *delim, int part, #define NONDM_UUID_PREFIX "devnode" #define NONDM_UUID_SUFFIX "Wh5pYvM" char *nondm_create_uuid(dev_t devt); -int nondm_parse_uuid(const char *uuid, int *major, int *minor); +int nondm_parse_uuid(const char *uuid, + unsigned int *major, unsigned int *minor); #endif /* _KPARTX_DEVMAPPER_H */ diff --git a/kpartx/kpartx.h b/kpartx/kpartx.h index 3ec13dbc..015dcab4 100644 --- a/kpartx/kpartx.h +++ b/kpartx/kpartx.h @@ -33,11 +33,12 @@ struct slice { uint64_t start; uint64_t size; int container; - int major; - int minor; + unsigned int major; + unsigned int minor; }; -typedef int (ptreader)(int fd, struct slice all, struct slice *sp, int ns); +typedef int (ptreader)(int fd, struct slice all, struct slice *sp, + int ns); extern int force_gpt; From patchwork Sat Oct 12 21:28:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187057 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 E4C5F1668 for ; Sat, 12 Oct 2019 21:32:29 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C261020700 for ; Sat, 12 Oct 2019 21:32:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C261020700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 19A5110DCC96; Sat, 12 Oct 2019 21:32: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 EDB5E60471; Sat, 12 Oct 2019 21:32:28 +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 BD3054EE6D; Sat, 12 Oct 2019 21:32:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLTKKb006324 for ; Sat, 12 Oct 2019 17:29:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id C3009F6E1; Sat, 12 Oct 2019 21:29:20 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx26.extmail.prod.ext.phx2.redhat.com [10.5.110.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28D4219C6A; Sat, 12 Oct 2019 21:29:18 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 999ED801664; Sat, 12 Oct 2019 21:29:16 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.146) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:28:23 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0334.microfocus.com (2002:f78:1192::f78:1192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:01 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DY9h7AePmKd9OMogUAwFIXnFYLlmUdt3yeNf1miSfJqOYI+FYKuPKQWA96LCShSDV9oo6ZxIWGCqNI3taksrE42M6AVp+zM+hVuPETAtEYARYUUQ6jQMh5al5NpDF/dddl0YE1aXvz9hxxd2XpOdYmP7gMIchmyudPEnTYD5cSCo+tjapofrdWuIcKYQ9GXEeUyk69t6yZUDQ1VfgeBYjEwsrf2Bt8qaypxTqtGacdSZUdOi6VV/w1TlJNFqrWHLvnR27lmjh2BHn2VUSNt3N3Dwje+XUd8LajbDAq5AyE6zB8DRtMedd76iptdpYYPRS+CoAXp8H9a0kAvDo/TiXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DakRZyd6CaXJNuT8mROKwoFFQUX/MfTnUHUpuLFwo7g=; b=AlXSB+xSDAhPvLLJ9IUIKtAs9Y+/6qYGCMze9lcDchX5nQllbCKDRM86HWxgdEmrY/CSu0z03a6fwk1viTsHk3JkNetnshV7MosiX5tbSZ8oMVHT1AMhNKP+5W98erhcWW5AiEbFFDXYS0y+MPfLYJL/iNY+xq1e8gTkb9YN/xPBFPM77WAKs8IaZX3sqBg5lRyvYAz5Y8dcR0CURj6YOPbCyPZkbAeIgfxWsfIvoXx/OAdoTLP1KRJsEBBgoHOmuKP+UxS8PicIzwbd0PSCw+5S7RymLwRx7rAJeHzfssPEskiyok8com+JXKkDmTnTY5CeBhL0LuBguXWgXtVG9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:58 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:58 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 57/72] kpartx: use unsigned int for "ns" argument of ptreader Thread-Index: AQHVgUQITGba1A5U6ESrGfy9qCGHlA== Date: Sat, 12 Oct 2019 21:28:48 +0000 Message-ID: <20191012212703.12989-58-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 609ac169-bd34-4945-307c-08d74f5b2aeb x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:62; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cURX1bcsG+WnAZmRLwRMcsJFT4YzobM2uq+sQ16Bif7SBfjxHoWS1gmjJPvtd5q1k5SRFCI/96OP0BnhKphwTZbdtK628Ohj1LeJm6aEBbM74jZQSDItn2dMRZn2+Phrcb7QdMjWFNi5Tg5KZJwmO/GuvJ2ncBbLz/FM7dhJN/QsY7Ug/Y2Ds6BCzlvqRQdw1zLfJIj3MiV+UJLhtK0zfJwr8g/xTAXICrmH5DqD0/hqei03e7xLfvtdVVQ8LcN9t7XdUDGToBoXYt3eE+RtoRMmSq0oAtS+wzCporMhRXqqDNzONuYI2qA3OTXpYOkrx7HthA3f3Un7rXVIUPvrJDUi9xkmLC1RZj7qirXswEf8TnUbZk78W+bzn0UYBYmMdHqhJwUU1ixv46qxbUgpdmBvUyl+xHkl9QVvFBbJeMU= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 609ac169-bd34-4945-307c-08d74f5b2aeb X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:48.3695 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: UkN3bfTUThRA2mQ5LXE8akcv5QNOkuX6FDj6XG1IRXU1737I2XTsljiV9T5oQsbTH5RTFQ752gnEr82EIECMPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Sat, 12 Oct 2019 21:29:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Sat, 12 Oct 2019 21:29:17 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.67 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLTKKb006324 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 57/72] kpartx: use unsigned int for "ns" argument of ptreader 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Sat, 12 Oct 2019 21:32:29 +0000 (UTC) From: Martin Wilck ns, the number of slices, should be positive. Signed-off-by: Martin Wilck --- kpartx/bsd.c | 4 ++-- kpartx/dasd.c | 2 +- kpartx/dos.c | 4 ++-- kpartx/gpt.c | 4 ++-- kpartx/gpt.h | 2 +- kpartx/kpartx.h | 4 ++-- kpartx/mac.c | 4 ++-- kpartx/ps3.c | 4 ++-- kpartx/solaris.c | 4 ++-- kpartx/sun.c | 4 ++-- kpartx/unixware.c | 4 ++-- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/kpartx/bsd.c b/kpartx/bsd.c index f87175e2..0e661fbc 100644 --- a/kpartx/bsd.c +++ b/kpartx/bsd.c @@ -47,13 +47,13 @@ struct bsd_disklabel { }; int -read_bsd_pt(int fd, struct slice all, struct slice *sp, int ns) { +read_bsd_pt(int fd, struct slice all, struct slice *sp, unsigned int ns) { struct bsd_disklabel *l; struct bsd_partition *p; unsigned int offset = all.start, end; int max_partitions; char *bp; - int n = 0, i, j; + unsigned int n = 0, i, j; bp = getblock(fd, offset+1); /* 1 sector suffices */ if (bp == NULL) diff --git a/kpartx/dasd.c b/kpartx/dasd.c index 4f3f744e..1486ccaa 100644 --- a/kpartx/dasd.c +++ b/kpartx/dasd.c @@ -66,7 +66,7 @@ typedef unsigned int __attribute__((__may_alias__)) label_ints_t; */ int read_dasd_pt(int fd, __attribute__((unused)) struct slice all, - struct slice *sp, __attribute__((unused)) int ns) + struct slice *sp, __attribute__((unused)) unsigned int ns) { int retval = -1; int blocksize; diff --git a/kpartx/dos.c b/kpartx/dos.c index 4985152c..0c706690 100644 --- a/kpartx/dos.c +++ b/kpartx/dos.c @@ -74,10 +74,10 @@ is_gpt(int type) { } int -read_dos_pt(int fd, struct slice all, struct slice *sp, int ns) { +read_dos_pt(int fd, struct slice all, struct slice *sp, unsigned int ns) { struct partition p; unsigned long offset = all.start; - int i, n=4; + unsigned int i, n=4; unsigned char *bp; uint64_t sector_size_mul = get_sector_size(fd)/512; diff --git a/kpartx/gpt.c b/kpartx/gpt.c index aa2a440c..785b34ea 100644 --- a/kpartx/gpt.c +++ b/kpartx/gpt.c @@ -602,11 +602,11 @@ fail: */ int read_gpt_pt (int fd, __attribute__((unused)) struct slice all, - struct slice *sp, int ns) + struct slice *sp, unsigned int ns) { gpt_header *gpt = NULL; gpt_entry *ptes = NULL; - uint32_t i; + unsigned int i; int n = 0; int last_used_index=-1; int sector_size_mul = get_sector_size(fd)/512; diff --git a/kpartx/gpt.h b/kpartx/gpt.h index 7bb54b74..4e1b49aa 100644 --- a/kpartx/gpt.h +++ b/kpartx/gpt.h @@ -105,7 +105,7 @@ typedef struct _legacy_mbr { #define EFI_GPT_PRIMARY_PARTITION_TABLE_LBA 1 /* Functions */ -int read_gpt_pt (int fd, struct slice all, struct slice *sp, int ns); +int read_gpt_pt (int fd, struct slice all, struct slice *sp, unsigned int ns); #endif diff --git a/kpartx/kpartx.h b/kpartx/kpartx.h index 015dcab4..dfc66c5d 100644 --- a/kpartx/kpartx.h +++ b/kpartx/kpartx.h @@ -38,7 +38,7 @@ struct slice { }; typedef int (ptreader)(int fd, struct slice all, struct slice *sp, - int ns); + unsigned int ns); extern int force_gpt; @@ -54,7 +54,7 @@ extern ptreader read_ps3_pt; char *getblock(int fd, unsigned int secnr); -static inline int +static inline unsigned int four2int(unsigned char *p) { return p[0] + (p[1]<<8) + (p[2]<<16) + (p[3]<<24); } diff --git a/kpartx/mac.c b/kpartx/mac.c index 6aeac4e9..c21ac702 100644 --- a/kpartx/mac.c +++ b/kpartx/mac.c @@ -6,12 +6,12 @@ int read_mac_pt(int fd, __attribute__((unused)) struct slice all, - struct slice *sp, int ns) { + struct slice *sp, unsigned int ns) { struct mac_driver_desc *md; struct mac_partition *part; unsigned secsize; char *data; - int blk, blocks_in_map; + unsigned int blk, blocks_in_map; int n = 0; md = (struct mac_driver_desc *) getblock(fd, 0); diff --git a/kpartx/ps3.c b/kpartx/ps3.c index 2cf4ffa2..42551bcc 100644 --- a/kpartx/ps3.c +++ b/kpartx/ps3.c @@ -34,7 +34,7 @@ struct disklabel { static int read_disklabel(int fd, struct disklabel *label) { unsigned char *data; - int i; + unsigned int i; for (i = 0; i < sizeof(struct disklabel) / SECTOR_SIZE; i++) { data = (unsigned char *) getblock(fd, i); @@ -49,7 +49,7 @@ read_disklabel(int fd, struct disklabel *label) { int read_ps3_pt(int fd, __attribute__((unused)) struct slice all, - struct slice *sp, __attribute__((unused)) int ns) { + struct slice *sp, __attribute__((unused)) unsigned int ns) { struct disklabel label; int n = 0; int i; diff --git a/kpartx/solaris.c b/kpartx/solaris.c index e7826c62..c2480b50 100644 --- a/kpartx/solaris.c +++ b/kpartx/solaris.c @@ -28,11 +28,11 @@ struct solaris_x86_vtoc { }; int -read_solaris_pt(int fd, struct slice all, struct slice *sp, int ns) { +read_solaris_pt(int fd, struct slice all, struct slice *sp, unsigned int ns) { struct solaris_x86_vtoc *v; struct solaris_x86_slice *s; unsigned int offset = all.start; - int i, n; + unsigned int i, n; char *bp; bp = getblock(fd, offset+1); /* 1 sector suffices */ diff --git a/kpartx/sun.c b/kpartx/sun.c index 276066d1..df630a7c 100644 --- a/kpartx/sun.c +++ b/kpartx/sun.c @@ -59,11 +59,11 @@ sun_verify_checksum (struct sun_disk_label *label) } int -read_sun_pt(int fd, struct slice all, struct slice *sp, int ns) { +read_sun_pt(int fd, struct slice all, struct slice *sp, unsigned int ns) { struct sun_disk_label *l; struct sun_raw_part *s; unsigned int offset = all.start, end; - int i, j, n; + unsigned int i, j, n; char *bp; bp = getblock(fd, offset); diff --git a/kpartx/unixware.c b/kpartx/unixware.c index c7b9786e..2f663af0 100644 --- a/kpartx/unixware.c +++ b/kpartx/unixware.c @@ -48,12 +48,12 @@ struct unixware_disklabel { }; /* 408 */ int -read_unixware_pt(int fd, struct slice all, struct slice *sp, int ns) { +read_unixware_pt(int fd, struct slice all, struct slice *sp, unsigned int ns) { struct unixware_disklabel *l; struct unixware_slice *p; unsigned int offset = all.start; char *bp; - int n = 0; + unsigned int n = 0; bp = getblock(fd, offset+29); /* 1 sector suffices */ if (bp == NULL) From patchwork Sat Oct 12 21:28:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187051 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 6EADA1709 for ; Sat, 12 Oct 2019 21:32:09 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B2CE2089C for ; Sat, 12 Oct 2019 21:32:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B2CE2089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 7B10C8980E2; Sat, 12 Oct 2019 21:32:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A77860BFB; Sat, 12 Oct 2019 21:32:08 +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 1595D180B76F; Sat, 12 Oct 2019 21:32:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.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 x9CLTI2k006309 for ; Sat, 12 Oct 2019 17:29:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5C5551001B08; Sat, 12 Oct 2019 21:29:18 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 52D4210013D9; Sat, 12 Oct 2019 21:29:18 +0000 (UTC) Received: from m4a0039g.houston.softwaregrp.com (m4a0039g.houston.softwaregrp.com [15.124.2.85]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 31F01859FC; Sat, 12 Oct 2019 21:29:17 +0000 (UTC) Received: FROM m4a0039g.houston.softwaregrp.com (15.120.17.146) BY m4a0039g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:28:23 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M4W0334.microfocus.com (2002:f78:1192::f78:1192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:02 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.72.10) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M+cxy018ZpK1eMCHtc/fT5ZrEo3y4svOYpsjj01bdeXlMRZ9RNxO+GSAUew+38l1M8+pjILmhjVqhO1JjsRA8glX76SLnn/ys9kxE3TxG6USbNfUn4kGY/Crzo72uH+zLcCxWe3aZuNvJdXYy3iQJ3JQ/tSw+A9RbHv4e8FrfKd9mG2klTTc3I7ECHlLQLIpr7fbzGcA+GOv6aCYPddjMjZ0jQruEk6rluiSIYgzdM2+EXsRvHYBAcDqrZ4m7BWytp7fOzniU2fQ5LEe4X9dK4/rdnWGic70qzjHRgdiemqwTeiy7BhEv+y2ksMv3WDklY/AzhYwReVzGAskJD6JbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+oqMByhV6YvycWM6h+QBRDxGITatd1+q0tM5TMzRfzY=; b=CthP3tKyqU+2Ii95/+amAKSYk7WHetI02ySlna+lgbaQh3tN0go8Jn7dyiOFhSo6UO22GkQsrPaCovEtpfsmXa11NVHqSd1HnrFQz971ffPvgazJxjdkObX9yiCScmcKsDj13RlCBxBca7hmef7mtyqdyrYWCirK79uFSoNTBpj59P+1j69hFNjHxJTnY5Os6HjW5HiAXzGVi9XLxBY4dJXcIc+WUKuBwDOheGf4baDCXj4iG/9aI8S2+CXfWxzDRqWSjkQbMfCyBMfOp1ZRsjV4Gh4DWwAlpByYzCBNnS27L3u9EZhss/O2i/rBJ/2KQXbWFoXm7ROvdZX96I19OA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:28:59 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:28:59 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 58/72] multipath-tools: Makefile.inc: enable -Wsign-compare Thread-Index: AQHVgUQJOMBBmmL94Uu3pfBt1KATzQ== Date: Sat, 12 Oct 2019 21:28:49 +0000 Message-ID: <20191012212703.12989-59-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7ccfd836-b2b9-4873-2c33-08d74f5b2bea x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:383; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dOgCXnP9iQhPslL3EkOeEyLeCBeFG00jyG66CREOk6lYSyHHvO3unjcIZUDOC18Enm5/eG51AY1UGwDx/Rzpk2OixgAtFA5S8VihFLL+jjStaJQS0OiYZ1b2ysDQLjh5LQYhLAg3Taqy+wgSOQZSYKiuzdXUrr3ocjnt4hgHbvVbBj6rwL2uQhr0XUTdQgOnc/uTb2xi8IHGgDBFzSG+7WxRww14ZadwcCSpPW5ppWPyZm4FA5qLOXpzk0w5XAAe5m+vwx7R1XI/n3tJwVfPSyhMljb2KMxU1g0KDSEOQgHNmDM1IIL7u0bbWfLxp275Qf3TuTKd4UIvdpJTWi0+b20+RjDkYWEwNuRYGhbpVrH/RMURln5TQdrKF/whQdwmQt7HgaUqM3xuZa3JWwbgdDpZFxp4aduhgfhluI+De4E= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 7ccfd836-b2b9-4873-2c33-08d74f5b2bea X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:49.7057 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: j99YH0zb0HaN+YCYJeL8egAUck8kOqYdOUQ+boHwvoXUEJWJxdjqrNm7BcL0n50H+tfmkcomC7oRjUTJr3CFng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 12 Oct 2019 21:29:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 12 Oct 2019 21:29:17 +0000 (UTC) for IP:'15.124.2.85' DOMAIN:'m4a0039g.houston.softwaregrp.com' HELO:'m4a0039g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.2.85 m4a0039g.houston.softwaregrp.com 15.124.2.85 m4a0039g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLTI2k006309 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 58/72] multipath-tools: Makefile.inc: enable -Wsign-compare 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.6.2 (mx1.redhat.com [10.5.110.67]); Sat, 12 Oct 2019 21:32:08 +0000 (UTC) From: Martin Wilck With the previous patches, there are no signedness warnings any more. Signed-off-by: Martin Wilck --- Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc index da9a3d7d..0c800ab3 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -93,7 +93,7 @@ ERROR_DISCARDED_QUALIFIERS := $(call TEST_CC_OPTION,-Werror=discarded-qualifiers OPTFLAGS = -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \ -Werror=implicit-function-declaration -Werror=format-security \ - -Wno-sign-compare -Wno-clobbered \ + -Wno-clobbered \ -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ -Wp,-D_FORTIFY_SOURCE=2 $(STACKPROT) \ --param=ssp-buffer-size=4 From patchwork Sat Oct 12 21:28:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187087 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 5F07F1709 for ; Sat, 12 Oct 2019 21:34:15 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3BA0D20700 for ; Sat, 12 Oct 2019 21:34:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BA0D20700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 87D47C050DEC; Sat, 12 Oct 2019 21:34:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 689E25C226; Sat, 12 Oct 2019 21:34:14 +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 35FCF1803517; Sat, 12 Oct 2019 21:34:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUVIW006694 for ; Sat, 12 Oct 2019 17:30:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id AF85A5DA5B; Sat, 12 Oct 2019 21:30:31 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A6E475DA8D; Sat, 12 Oct 2019 21:30:31 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1D8154628B; Sat, 12 Oct 2019 21:30:30 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:51 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:02 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pb3hibnvmgoWewfYjARr9ZlnPHWqpl1fTIQjJ4zQ8A5oz2f+wdHvKhdJlyrl5eDJxsSrE98RMDqWFbnyzsHWBlaAF+8jr+Pzj10oZ/qw41f9if/3Uy4w4BCJc+AeLFEn34Xl/tS7zvvWIXN6VRXzQ7UYCuWqPWd4sFe9dhYV+pi2yNYW/YRmdtVRmy8J8pg5MjswCXoNF/h3PQ2jIceCh2fjn5IZ1Da+VY7BAr2BJdR5y8oeWo0UiUmaMGrznhu0Q+VOx4UI2cRFNxcJ35kN6ODl00nWGNvlw6v5tGr1GhnQUDoW3+ZPAIJjNHcy0H72fv5z2i45da07KUy+GXVapw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NJMppSmdmiyebriszpvI4QPX0FF+RiW/A8aS2KCIoHA=; b=Uy8gbP+5IOwIun3llYRngOFgt2FN8FSJ7y87DzYt3kD6K3LMsK9z4ZiWM1gjg8OPjqAkEZNy1Dt4CNEWiWVYRBX9YVwRaf8QE95BP+x/fAfCqqj8RbaUnMK7fjQUHnBvQPraAraN1CFP/LmlJ9ALpVMGIf3+/31dX2ak4cqqCRFYmlPplS7ozbRGji8CnN7bXX8WZ7KzdelZNmNx/Vrpz6MCwhh660xMB+6pe3UVs2x6gNj1Qs5DvubH/nEVURo58of9MBlqGS/QwbSSGNIpzzetM9m9v4ebVovNsf6NoqwQJaYpfVmyM3HscHGd14hOgx3OGRl4TJ+UxsNM9wScmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:00 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:00 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 59/72] libdmmp: fix clang -Wformat-nonliteral warnings Thread-Index: AQHVgUQKSNjmgfwjGUCKoyYI5lGyPw== Date: Sat, 12 Oct 2019 21:28:50 +0000 Message-ID: <20191012212703.12989-60-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 01cdd57a-4e0f-4f87-8673-08d74f5b2cb6 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:346; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1uGRiucplvOcbktua8kyRWkOy7G6VAKb4uxfUjgh3S5LIEAmCIWg2cIWOfGY5Qjs2lMqk+97uDVRMcPUXWNVx0nhA/WGdEsf8D3feCnPN2waBjD6TrTkjIC6NfYSy89TRUKefEOCVmBThlamiAHZvIB6zGodGJUkGdUyjp0w2YHpETuVGcQHs3UYK6a1dVKG1chzJ0C/6dQE3tQx8tCCOtDGL5wA83VJm4LI2T/1Z4kSo5y4y3xWGSKdu0Oi77lBtdCgmBDvW1cP3I0gdHLDrJBaGrU8QslacE0jql2n5bHd6K2yrP7uN2pzN1j4ynxIh2I0dO/84KdZVUluZzl0ll59sXmvDpz2WQgbCMADMQnBQ2ePiYAEri53DIcTYXf3+S4zfbXsMButEXA+IfuMkHnKfxuMSJzwm+PHcN+37jU= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 01cdd57a-4e0f-4f87-8673-08d74f5b2cb6 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:50.8791 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: UVcPoxabj6wQz6epvvafrstyD5pJroPsODSPrIX8CvcoeSLxfs7ex/X0yh3V+hAV8UedPcxz/BAEDaz0ZNVG4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 12 Oct 2019 21:30:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 12 Oct 2019 21:30:30 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUVIW006694 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 59/72] libdmmp: fix clang -Wformat-nonliteral warnings 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 12 Oct 2019 21:34:14 +0000 (UTC) From: Martin Wilck clang enables -Wformat-nonliteral with our compiler flags, and thus needs these format(printf, ...) attributes. Signed-off-by: Martin Wilck --- libdmmp/libdmmp_private.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libdmmp/libdmmp_private.h b/libdmmp/libdmmp_private.h index 3e813cb4..ac85b63f 100644 --- a/libdmmp/libdmmp_private.h +++ b/libdmmp/libdmmp_private.h @@ -131,13 +131,15 @@ DMMP_DLL_LOCAL void _dmmp_path_free(struct dmmp_path *dmmp_p); DMMP_DLL_LOCAL void _dmmp_log(struct dmmp_context *ctx, int priority, const char *file, int line, const char *func_name, - const char *format, ...); + const char *format, ...) + __attribute__((format(printf, 6, 7))); DMMP_DLL_LOCAL void _dmmp_log_err_str(struct dmmp_context *ctx, int rc); DMMP_DLL_LOCAL void _dmmp_log_stderr(struct dmmp_context *ctx, int priority, const char *file, int line, const char *func_name, const char *format, - va_list args); + va_list args) + __attribute__((format(printf, 6, 0))); #define _dmmp_log_cond(ctx, prio, arg...) \ @@ -164,7 +166,7 @@ DMMP_DLL_LOCAL void _dmmp_log_stderr(struct dmmp_context *ctx, int priority, do { \ if (ptr == NULL) { \ rc = DMMP_ERR_NO_MEMORY; \ - _error(ctx, dmmp_strerror(rc)); \ + _error(ctx, "%s", dmmp_strerror(rc)); \ goto goto_out; \ } \ } while(0) From patchwork Sat Oct 12 21:28:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187067 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 A2BFC18B7 for ; Sat, 12 Oct 2019 21:32:50 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7EF862089F for ; Sat, 12 Oct 2019 21:32:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EF862089F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C60678A218D; Sat, 12 Oct 2019 21:32:49 +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 A46F760475; Sat, 12 Oct 2019 21:32:49 +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 67A764EE6D; Sat, 12 Oct 2019 21:32:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLU38G006481 for ; Sat, 12 Oct 2019 17:30:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 83F395D721; Sat, 12 Oct 2019 21:30:03 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1D085D6A3; Sat, 12 Oct 2019 21:30:00 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 95E89C08EC04; Sat, 12 Oct 2019 21:29:59 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.191) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:15 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:35 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.13) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mpEKtlfEJpOEI6WirIVPPdtVv9hvpSxFux61001MnfnKAW0+dJ8sKHlNDm5srHxjEg2BZVJbNYorUYRb5mTgrnSWRNEan4yzj7voF8qekR80gFIEpYJsz5WZjyfItTiNVyap7FWPghEzkXSgq3FrmtMlyhABiGockLGSgGYl+EQFs8TDhIGxyNJgyikcX5RBn0NDEL14+ktniulHedONJwTpCb1DNLvcNoicgBKEYG80qTQD4klCT9V9+7k7cuTjToxuawmpIxO4wlTwCtaJOgSlBHOzHVWlWSjAtFidku96Uma9kbWJgGiygqGz9S5jbysKEvoCdJZE58T+7kk4Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8+lrrPMw3h5slPr/9bgxkj6aO7GnEanJRltLRmikoLQ=; b=Hv2IVPrUUeU4f9Zay7PXTpAsuCGqnn/6mA0iMeZEUfkLV/UUa7nnmQZhAVAGyTKFbXxWf3ZcVeqEO9t6imMrE4wAwkER/dtMJgSBMmSr1cLhD5cnuWtSjSA/q9ki9PCb6Zjc4oXNuu60kF7YzuH8NUDo+KDreqwsNu+6Cf/U172EBfpIjiAJgZpNefEI0kHcKXgHHi8GjkoDp9pR2zDawiOGcEEJec0zIQi/NPeCGlpVFAbtEjghAuRHbPGqy7AIN2w/KBovG/fh1ehd/WHzhvYRda2jEBh5hh6KhlHu2+MCnY/U6rYNwbf3FpXGZGQ6UeuelJYp8WvkCpqYLiuZvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:30 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:30 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 60/72] libmultipath: fix clang -Wformat-literal warnings Thread-Index: AQHVgUQLfMf9B6H9RUOIk9bJDvFAQA== Date: Sat, 12 Oct 2019 21:28:52 +0000 Message-ID: <20191012212703.12989-61-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 680f224b-9845-486d-0d7b-08d74f5b2d6f x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:233; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rh/+iQYM7uG+OyjZZcgzYwBZX5PVVRAVMNllc7+FlYD5afFn/owOkkzQQyPlPoz0HsNmsiJ1YXHcA2L43AEB6Ve0TsD7RzWB8uQ6lH8P6jMj0CAXG7dKbenYhpLnOb7bp8pe911rtpOsPlSkfmoin7VH2N5wQocxQtMntMdpV0OPR8Q9aQMvM3zRUSHlFH+eIvR2/zfL6kPtuRDlEl8FYnQmoneb3+DVcLUvPoa4UDsIgxUwMQfv7GDm0fjvDJpuGGXx4oErgmAkeq1Fr7nvsE6uL0bFHCA/YxryhcdCY55LtJl4YQqJUvCG+BeAIU5Mdxqv2SwSNdFI0cwQXBTUxr5dVJdAPrzc2LFNfT+OsdD261rkc4nbqBRt+zueZkMN2IlCo+6Z87VKullpFIuk+bOjdA3PYPT4yahNtcvWaro= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 680f224b-9845-486d-0d7b-08d74f5b2d6f X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:52.0824 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0a4DX9ppHNw62fHILmkxnlMbpCIahisNiC6iRVc8sdvQLA5omIlGMT3FMWvlGGioJNKGhkCC7HBB9Q+n91O3Ng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:30:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:30:00 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLU38G006481 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 60/72] libmultipath: fix clang -Wformat-literal warnings 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Sat, 12 Oct 2019 21:32:50 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/devmapper.c | 2 +- libmultipath/log.h | 3 ++- libmultipath/log_pthread.h | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index 4bff37d0..acf576aa 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -59,7 +59,7 @@ void dm_udev_set_sync_support(int c) #endif -static void +__attribute__((format(printf, 4, 5))) static void dm_write_log (int level, const char *file, int line, const char *f, ...) { va_list ap; diff --git a/libmultipath/log.h b/libmultipath/log.h index 6551b5cf..d2448f6a 100644 --- a/libmultipath/log.h +++ b/libmultipath/log.h @@ -34,7 +34,8 @@ extern struct logarea* la; int log_init (char * progname, int size); void log_close (void); void log_reset (char * progname); -int log_enqueue (int prio, const char * fmt, va_list ap); +int log_enqueue (int prio, const char * fmt, va_list ap) + __attribute__((format(printf, 2, 0))); int log_dequeue (void *); void log_syslog (void *); void dump_logmsg (void *); diff --git a/libmultipath/log_pthread.h b/libmultipath/log_pthread.h index 7e138a00..810ac920 100644 --- a/libmultipath/log_pthread.h +++ b/libmultipath/log_pthread.h @@ -3,7 +3,8 @@ #include -void log_safe(int prio, const char * fmt, va_list ap); +void log_safe(int prio, const char * fmt, va_list ap) + __attribute__((format(printf, 2, 0))); void log_thread_start(pthread_attr_t *attr); void log_thread_reset (void); void log_thread_stop(void); From patchwork Sat Oct 12 21:28:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187093 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 EA2C317EE for ; Sat, 12 Oct 2019 21:34:35 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C81A220700 for ; Sat, 12 Oct 2019 21:34:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C81A220700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1618310CC1F2; Sat, 12 Oct 2019 21:34:35 +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 EC6F2608C2; Sat, 12 Oct 2019 21:34:34 +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 BA8EF4EE6A; Sat, 12 Oct 2019 21:34:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.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 x9CLUdPa006738 for ; Sat, 12 Oct 2019 17:30:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id ED64A10016EB; Sat, 12 Oct 2019 21:30:39 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx25.extmail.prod.ext.phx2.redhat.com [10.5.110.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 85E581001B08; Sat, 12 Oct 2019 21:30:37 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4389610C093C; Sat, 12 Oct 2019 21:30:36 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.190) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:52 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:36 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.13) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FQTB7ncRHvrJJqs7j+ccrjLrWFTDWlfMdhmP/kF//w1oK+0aP0FNLtPMSVI6cLngjHD25dHDAal9o1AM6XHHfPDdPz1gnxlVylmRHMSJQHbc5qUSbZxX43AsbR+ZW+Xej2muvYdY2Uf6qNea6K1ssl+4H6JKoh/DXPXczb7b8Ye8KeihFFYIlPrO2Qw076RyAOH6xfpXxqj9d0Ozls7H7DCni+G37f1/5kIcKsRTn4Pw5XLsPUyVjN5wyt7PkGYcy3OYyc8nS+Frm7CoHm0Ls8FNgI7kMz5r/QfqcFKYdzsHqZrZ2MNlatUGNt011UMei0PHbI10yXhnNCGRgxw9RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E7rAG6XVGxvn9zm484hVBM76X/Gzg83iVBtRU+ej7t0=; b=m3zLqbaPp4BsntgwZU4GmZU4mDWqyiBjqTdwiIEi7PrG7IJwPmirZiRSwdFImM4oZ9av0SgjTExrFEmGOcZuaKnkKNcbIGiggKuZyPGlU4iv8SFWZ3UZEpAzGAz3f/c2h0m2SaCjDVD3JX6cxiniIY2C47idJsZA3avUt5cmLrA2jiTWruCWUzyKGy0htHea5pl3bZfDoU0/fJKQdoXasPQ8q+DtZS+jtC6IGPx9re1pBRiCTIHZfkIbUK3QHCjwON2V5WGmV4rCH7Ie3mioVeoFGpyrSKliMr4tRVqWHjy4aUlhJ80VXh3nlDU8aE29WLTbTZI5/HPWt6qJNGJYwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:31 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:31 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 61/72] multipath tests: blacklist: remove always-true condition Thread-Index: AQHVgUQLnhrQRVFCmEyPGYtb+CqRnw== Date: Sat, 12 Oct 2019 21:28:53 +0000 Message-ID: <20191012212703.12989-62-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 753b3f3e-6a74-4b63-c003-08d74f5b2e25 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:469; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: A9oDXH/ORTfFm6mBWiVTzAgNAyfenf4nN69L7CDjqYh4vjJ5omQtjPA9dOmjQ2Y/WyI7kABZsXEC6YUWuD8s8/C8edlS1coAbppmon1Rid5dYTorRwEAc/lS2iyy35ndlB6jNxMqCjPsFlcloUnBXn1nOLjYWyoX/Hfv3gXMCeTeux54b4ZJF/6a0hGF9N2Py0Sk6vBjaQYtx3Cd+Tks4wTu8nbpxAH4NKaAEmxBgKFFu/2TvQzh8rB8JFL4AiCmnGdKDHWzBZ0cszBgcV435J3AQCFL39wsMunNOnFDtQUEUFAJ4YUpCHERMMIJAnbIsZ9DK0mmLwey8vnJDjk8yKpzMHYJ6OUbgCbk80FRrOdgd0n1sYnGbj2emm+bU/NPPi8fWRY8sc49mcyUZqn6LkvnNTbMM8v+dSHQyrM+yY0= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 753b3f3e-6a74-4b63-c003-08d74f5b2e25 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:53.4037 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5TSAek+P6Awctxa+2kJ5G9i3ovSVUAskYCbhmTlYEMLfK9uy5+u94ywdPkCGZh5CvUOCzPuOZIluub5TRFYY/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Sat, 12 Oct 2019 21:30:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Sat, 12 Oct 2019 21:30:37 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.66 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUdPa006738 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 61/72] multipath tests: blacklist: remove always-true condition 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Sat, 12 Oct 2019 21:34:35 +0000 (UTC) From: Martin Wilck clang warns about this (udev_device->property_list can't be NULL). Signed-off-by: Martin Wilck --- tests/blacklist.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/blacklist.c b/tests/blacklist.c index 733ee398..6e7c1864 100644 --- a/tests/blacklist.c +++ b/tests/blacklist.c @@ -40,8 +40,6 @@ struct udev_list_entry * __wrap_udev_device_get_properties_list_entry(struct udev_device *udev_device) { assert_non_null(udev_device); - if (!udev_device->property_list) - return NULL; if (!*udev_device->property_list) return NULL; return (struct udev_list_entry *)udev_device->property_list; From patchwork Sat Oct 12 21:28:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187103 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 3610714E5 for ; Sat, 12 Oct 2019 21:35:23 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 13EB320700 for ; Sat, 12 Oct 2019 21:35:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13EB320700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43DD12D6A10; Sat, 12 Oct 2019 21:35:22 +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 1D7246017E; Sat, 12 Oct 2019 21:35:22 +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 D76234EE6D; Sat, 12 Oct 2019 21:35:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.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 x9CLUfor006749 for ; Sat, 12 Oct 2019 17:30:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id C397110016EB; Sat, 12 Oct 2019 21:30:41 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx21.extmail.prod.ext.phx2.redhat.com [10.5.110.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B8BB710013D9; Sat, 12 Oct 2019 21:30:41 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6826F18C4272; Sat, 12 Oct 2019 21:30:40 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.190) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:56 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:37 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.13) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i/bMg3bcg5BHVcqBQ28TVYQsilIC+MYQfy/ml5syXP3iRqZ6RkUv7e77EkUxb3xlboKTwa0l33bODU7plcjEl2lH8WJOjNlFUtfowG41aq/tyfdiaYOxa4dglYl1PFqv3N7da6A6975GAGmcw/EWvhB2svvkihiZcw6a2vFtZh4xqRua0Ma+ViQQaJXjOxtIlJrc297TTnssFO2l89zmQxgWjZBIshc79XH/GA7Bhp8MxSa2wkQlFCFJdI2tYYFbMJSsZGO12pK1FJ0v/rj9SfI1RtjSXnRFjC2+RO8/uuGsnF3vjZmH+0ym+6pvAkEaJTUsoGjbvPs1gMbMbD10GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3LSE/G0GDskcWAVfXFBX9V9l0ubN/6veEo6jEFnGWlM=; b=Uv1ieweqGmdeOm0oKdCIerUKnApHwwYvFXxbClmsWBv37tsLS2sg2nmJMtYS3mAZuCXfKNUReh0NYiTupHzNT9QZHkfAeu57pJF3t2jyLToLPf3cu0wpcqwVEiBz9znivC1T2CzVukIROHoFYOt4TN3JRmjznpNwwPH6sostjqakB36MHLPTi+pqtLklihF6pjttNMD8a6vXj6bHjtMRfCGZ38Ma8L6UjFxonrqJKfTxJUrB76XUonrnKyDIFdXkKoWz01w23p1Bc55zeXNCkCtD4IEkvXvOPHzriBKL5kgWcT585bHkLHIUrwlsWNtyHamCCiUEw1c7xDkA8r2zfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:31 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:31 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 62/72] multipath tests: hwtable: fix strncat() invocation Thread-Index: AQHVgUQMffoOTC1CLU+p9+j9NFSyfQ== Date: Sat, 12 Oct 2019 21:28:54 +0000 Message-ID: <20191012212703.12989-63-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 70428adb-9c3d-4732-b66d-08d74f5b2ef2 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:608; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ngOSgaiDpWcdNu1WYxt9/zNZOHQ8wY1B6DBrZf5OOFrphPYzUJp9ECiV5Etxi/UYa3pYWRTuXvXJcPP+3DWTBJrlQ4A8PkH8yePmd+OkIBR3nLWvz6WsiuSGq7+tD/PZseIZTrbbPjtl1WRmIsZD9SJVxcta7/m1ce0tw0Efr7DFUZfpWqfEiN0SVGskHTCumEqYhsOhoLAEnenfqzn5J4T3WGWKKUhSlLioAm6YmaX5Jc9dm2dJOwCwnAZztc8PJNAhFPsipbYP8u9JZRQN7uckjt+7fJ1tLGoEKgKl70xfZoqn9vdj2rOyHQymkaJiHs6HCLi/VG0Dzl6Y5xDEpe/Dbpffib9/Ezgg0sVqZ4hIne+1qBTYgMWOvgSXP1koaDsQuRi3DUGk6oiw26Qn90hs40UvN00Av2rr0s5939E= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 70428adb-9c3d-4732-b66d-08d74f5b2ef2 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:54.7519 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 4Q1eUEWQJSEiy2bazX1IS2uXdHvoB4S4wlbd9NgrgHTlO29Dgc6SDMCihH10rHPdAMD1fVxUR3TMyGKG8Y4/qQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Sat, 12 Oct 2019 21:30:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Sat, 12 Oct 2019 21:30:41 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.62 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUfor006749 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 62/72] multipath tests: hwtable: fix strncat() invocation 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 12 Oct 2019 21:35:22 +0000 (UTC) From: Martin Wilck clang detected this error. Signed-off-by: Martin Wilck --- tests/hwtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hwtable.c b/tests/hwtable.c index 977a5663..473028b7 100644 --- a/tests/hwtable.c +++ b/tests/hwtable.c @@ -261,7 +261,7 @@ static void write_defaults(const struct hwt_state *hwt) defaults[0].value = hwt->dirname; defaults[1].value = buf; assert_ptr_not_equal(getcwd(dirbuf, sizeof(dirbuf)), NULL); - strncat(dirbuf, "/lib", sizeof(dirbuf)); + strncat(dirbuf, "/lib", sizeof(dirbuf) - 5); defaults[2].value = dirbuf; write_section(hwt->config_file, "defaults", ARRAY_SIZE(defaults), defaults); From patchwork Sat Oct 12 21:28:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187105 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 4F283112B for ; Sat, 12 Oct 2019 21:35:39 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B81820700 for ; Sat, 12 Oct 2019 21:35:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B81820700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1B48080166A; Sat, 12 Oct 2019 21:35:38 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EDD8B6017E; Sat, 12 Oct 2019 21:35:37 +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 BDFE81803518; Sat, 12 Oct 2019 21:35:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUlkc006811 for ; Sat, 12 Oct 2019 17:30:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id C43406031D; Sat, 12 Oct 2019 21:30:47 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx24.extmail.prod.ext.phx2.redhat.com [10.5.110.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 691EF60468; Sat, 12 Oct 2019 21:30:45 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 14C4510CC1E0; Sat, 12 Oct 2019 21:30:44 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.190) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:30:00 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:37 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OS1wu5MEm6v3WAaChueqb4Vt+7zfYo6mo9+BJFTfI7t5LkkBHa0dZGG3TAV1jHTlVRxPBqnRVPKIv1luwHtwFrcz3ZtVleHeAY9Rtbg759PLzGDsh05fOZyPZ6InA7ba30BVoYMZyIDKkmFzpKBOJ9QJ86k6ErOnliq5RyMWQ46gtS4ifYB5zFXI4KTvmQEyxe0AR4AguAZLHYWP4Wo49ffBc+zA9IHI7hEQFvRKCWIPTJl5jGtDd72pai3h3vB+8JqlmPkAgHD12pJh5EV4qqXXiKO6j/9brC5JHIFKXmK7l2OopeCkHSWxCkPmxqR4WxsfAiYorcb6r7VE8A4+sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JIA9/rWiMiwzrJECbjx2OLR74kVGf2CPN1oBPBaIim0=; b=VKrBlLk8r8Pa+QqjTCkAYs1s4F5G6rLBzw0qa7B0tFXQCPsS7jHExnsA4EvNF7FBwp7Tu8j8boHT3HFKQcROdwkm6K5MMeeNvoh4glnwoloveacWcctjutz2vAEajLEc5aZ6m2gqjlXOD7Z124hfFI7bpsIwJzqELb0zcCO3tqGjHTxmKirRY7UUOYMC7EQEo6rTrBCUsXIqL7hQkUjFF/2DnG5+Gwmbts4kzhj0EWsydqJEHWdq2lN+yZrAGA42Zo/V/ZLAfMDUFbwUStZum2US4rZT31OaXgJdonQ1kz8lFVeBDj6tElzj3OzJr70HWi6ChlB3e1nPUgBJdu5x8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:33 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:33 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 63/72] multipath tests: fix -Wformat-literal warning Thread-Index: AQHVgUQNu1OZMsFNrE2juHATJ8/U0w== Date: Sat, 12 Oct 2019 21:28:56 +0000 Message-ID: <20191012212703.12989-64-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9786bc31-e65a-49e2-8a49-08d74f5b2fbd x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:296; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Zvd82Q7o13/8LYQ6S7llvbe9oGUlGv2nUTFuq1mLDSSmYWxdzdW7kPwslS6oeaEdl5zbqZU4uzvXNZ8RU4bAXa3SQ4DaWGsSUmCpVudjo+d8P7tLPiigFTsbIoQXG81V6dMI6jiQCpCozOG00LViR38ap2Yk8/pC+yl5gd5eSEQ3AsZ8Vw9dZeJxG2TsLACdVTAbeBQpWqrQz8kUz8hhOIg74tURu2z4mxgMwyLbYIe8ff8NBKh7Bd8F0y5UyTHZOqdYOZKFjW/34Jc3t1PlkyHURKvP/RO08kaUJqoHumzGTrtVtV0SQJGkufSQA5CRgC2Ajwbl7NIIWp9VRBkM5MJMIV8vswgFXpgDyLL2GRhqouAMQKuwazw1cky+7xmblldc2UoQwrEPz/1nOQigoFMnv/VOYPYLg7UShNDSmfY= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 9786bc31-e65a-49e2-8a49-08d74f5b2fbd X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:56.0652 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: o7hxGX58PJ9LkRM0snAbH0yyikrTdFNYA4KINvhfKZ8xEJz4VBEIRzyPkPbfalo3gS7/CztIeCwk4U0ff32Gmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Sat, 12 Oct 2019 21:30:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Sat, 12 Oct 2019 21:30:44 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.65 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUlkc006811 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 63/72] multipath tests: fix -Wformat-literal warning 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Sat, 12 Oct 2019 21:35:38 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- tests/test-log.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test-log.c b/tests/test-log.c index 76a266eb..d685d582 100644 --- a/tests/test-log.c +++ b/tests/test-log.c @@ -6,6 +6,7 @@ #include "log.h" #include "test-log.h" +__attribute__((format(printf, 3, 0))) void __wrap_dlog (int sink, int prio, const char * fmt, ...) { char buff[MAX_MSG_SIZE]; From patchwork Sat Oct 12 21:28:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187061 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 3DFBD18B7 for ; Sat, 12 Oct 2019 21:32:30 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1AF1920700 for ; Sat, 12 Oct 2019 21:32:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AF1920700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 28C83309843A; Sat, 12 Oct 2019 21:32: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 00C1060C5D; Sat, 12 Oct 2019 21:32:28 +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 C29A14EE6E; Sat, 12 Oct 2019 21:32:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUcpi006721 for ; Sat, 12 Oct 2019 17:30:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4247B6092F; Sat, 12 Oct 2019 21:30:38 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0D685608A5; Sat, 12 Oct 2019 21:30:36 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 883A03086262; Sat, 12 Oct 2019 21:30:34 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:29:56 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:38 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.13) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hw6JCFhXrFdh25fHvTpB7CmJk9anwoqt4jg8MVycVxc7QBCG4T+ncUAfAQtXOJ5HglmLouPxDs2jAo1kfkWjClDj2EQbNhV4tQdg1N8fbFPUfFVJ5oJ4lOwu73B4iJJDwpAa1Tn3FLhAZesDikYoE41SkjXXrVU+XE+AJxVaVtOduBanhMvzDKOE9BYUCiKvNxyEFqMLkYLZBqbmOS4mObSeiRJA4/d/oKUIT2mwfsm5oFVROIdUFE3m1p2whjA+DX/xDBpaQO7/XLMrxA5BTMt5jmvY2A5pMoZKJYBB/Rt9ADcfgzImEnKY/EiByv99LaGPKv4YhxMeIpIPYXlvkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xSALkrYZtQzeodS8lESPOAL4gPEkxdh3g9wsgCjF6bE=; b=RaYbJgspKFpAVP9ReaC2rdlxeJEZhfZITMWeAAuAee1oNpndR4+KQoV1iTBfBnYhT4MMhNbvXBjeBXyMfoievPv7SnSHhxL45dYVQU6Swo81/sb8dwMHPEvpIHB8U4cOboxd+Lcb5Ar0NLzGLuQi5jmgqY95gfxkZ5euMaPgU6njIYEtIjc+rBeQMSWMbxIJ84yCMxC8RzGurQFMIYxkTP5xa5g6eHz4gM7eCfWfluKhFY6MpcSOlDkIDeO7FCMHbIKMQk9g5OKI4T+EEYlIYCjEgdueRnxsm3wY9c4ew1xEIy/hh/aJVGqs/BUcbzzF0S6n/kX3my9SPbP2k0OjcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:33 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:33 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 64/72] multipath tests: util: fix clang strlcpy warnings Thread-Index: AQHVgUQOKOwyMv3N3EOoeEd8/q9E+Q== Date: Sat, 12 Oct 2019 21:28:57 +0000 Message-ID: <20191012212703.12989-65-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1b0c602d-662d-43dd-9676-08d74f5b3089 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7FpQSvDHgsRTB/MBbYWTrl2heRD/LxXAfjigIn5pPqUUPttS6QSXCjmmJp3zwPgLnQMvHmHIBvjARZfRDS6C+RItKYYlZnG86fOKYy3gPiPlQRijtSzISg0Ib9krLEQGTRgelgh1E0fspqxF3+kouoH9nTTXARr4KA6HfvQwD6usqP9STbWH2nhul0ryKhhS9HJ7jmuaUiQ7EAJN4kajuTym2MS/v0biyVdH87uMNVvuMj66Ee42s9vTF1ADHcHIMC5QR4mpXbsRqogfQHxIWLUIsC0EOwdo2jNyrS5mcHxfv8BOQFu2cP9eYa9AJQ5/hn5qdifl/1l0FKgmfoVuDSABB2vAzgD35SwizVoNyLtkvK8DP21iw5vmKMlhlZVSBw15FesbMpI53yr1TTnQHhuIzI26PBu2oBrEIWsx7IM= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 1b0c602d-662d-43dd-9676-08d74f5b3089 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:57.2855 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Y/rmYliDtVSobpsHkz7aQnQiIT5cFSYDCNJ3mBcvjCR8WBvoQ3gD5He2XTUotl3TveVUbYzSygrpqebjsayNFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:30:35 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:30:35 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUcpi006721 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 64/72] multipath tests: util: fix clang strlcpy warnings 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.42]); Sat, 12 Oct 2019 21:32:29 +0000 (UTC) From: Martin Wilck clang erroneously thought that we were using the size of the source for the destination, while they are equal. Trick it into accepting the code. Signed-off-by: Martin Wilck --- tests/util.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/util.c b/tests/util.c index 4e04a480..7c486fca 100644 --- a/tests/util.c +++ b/tests/util.c @@ -328,11 +328,12 @@ static void test_strlcpy_5(void **state) { char *tst; int rc; + const int sz = sizeof(src_str); - tst = malloc(sizeof(src_str)); + tst = malloc(sz); memset(tst, 'f', sizeof(src_str)); - rc = strlcpy(tst, src_str, sizeof(src_str)); + rc = strlcpy(tst, src_str, sz); assert_int_equal(rc, strlen(src_str)); assert_string_equal(src_str, tst); @@ -344,15 +345,16 @@ static void test_strlcpy_6(void **state) { char *tst; int rc; + const int sz = sizeof(src_str); - tst = malloc(sizeof(src_str) + 2); - memset(tst, 'f', sizeof(src_str) + 2); + tst = malloc(sz + 2); + memset(tst, 'f', sz + 2); - rc = strlcpy(tst, src_str, sizeof(src_str) + 2); + rc = strlcpy(tst, src_str, sz + 2); assert_int_equal(rc, strlen(src_str)); assert_string_equal(src_str, tst); - assert_int_equal(tst[sizeof(src_str)], 'f'); - assert_int_equal(tst[sizeof(src_str) + 1], 'f'); + assert_int_equal(tst[sz], 'f'); + assert_int_equal(tst[sz + 1], 'f'); free(tst); } From patchwork Sat Oct 12 21:28:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187113 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 523AC112B for ; Sat, 12 Oct 2019 21:36:21 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 25A8920700 for ; Sat, 12 Oct 2019 21:36:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 25A8920700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6979819D381; Sat, 12 Oct 2019 21:36:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45BD45D71C; Sat, 12 Oct 2019 21:36:20 +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 0E400180B76F; Sat, 12 Oct 2019 21:36:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUr8a006859 for ; Sat, 12 Oct 2019 17:30:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8B5645DA8D; Sat, 12 Oct 2019 21:30:53 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EEAC05DA5B; Sat, 12 Oct 2019 21:30:50 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A0EFC075BD2; Sat, 12 Oct 2019 21:30:48 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.190) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:30:04 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:39 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RUoTgTCTN/pJEF8M1TQGI9UlKvcNe13TkFa4QFEkgR6v3trP3dgFLbE/93W0d2rX65Uz70qcPRzjf+BpgyVmS4ZRtgXllyLEgz9XTq8LmEkp3lE0latJtYg5o2iaBG8ePtDyUWo2jpMQ4VfWH5g/xTWKS2tvPXIGj/HgHp3FTFPGvrBnSD6hFAfs5Ats7fgIyivxE/5jox4KM/WTQIeNuu1Pi9MIYlk5csUEAlsN43QY7asmG/WwdOOwiCNWO3TwK0Jb7IxgWXwUaXRN/p+Gz7Yng24sr3xzm+2nZjDJ90YJcSeoUTHCB36ZBumojX/gzLkxtflWEnCXENtPdue56g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aMIWr+Iyd2fb8QUYhvqNzslHU/8WIWw/znCJeYbkkIc=; b=mhsXIrBOOxPTzo/q8R5a0nXdzrjQipQUdnUiSXIY/19Mv/TtWu100+Fb2Ojiz2mmav4v1nzpyuqDcqLLb9EWyTmj4iBGOb7o+Bkx/4EyFPz/vGv1LmQlPP6QNLQzd+Jf6tO4Fjd1dtW5NPk6ICAmq+5zrt3NnZd2uxMNlla7jgdPpi/nRdPCEaTzLJHo9eHBZVOa4mwJLSYAs1LIKLkQQfqKYTe9kqq/n/9e72AEK5kwmwHCt73/rvQE1HTkywAvJHE80OjeScRROAkgW3SkonV8f5PQo552yo/PTuFSMNjqPNp8/nyswER0z44OTmP5nT4orc+Jp9UXSs6wXa4XRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:33 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:33 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 65/72] libmultipath: nvme: update to nvme-cli v1.9 Thread-Index: AQHVgUQOpD5IfFU9uUWVbFCSqwyM1w== Date: Sat, 12 Oct 2019 21:28:58 +0000 Message-ID: <20191012212703.12989-66-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3a024407-064c-45b9-acd1-08d74f5b313f x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(15650500001)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(5024004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(30864003)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002)(559001)(579004); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XsJSY915p6vSHRSLRQzL1IYOeo9HxqCC2MObOLQ4KohFM/Id7Z7TQwAjqG5prWFNy3+oajZAE423foT/Qb997kQFv9OBZvQtVu8U8o5CHPcXAvHP9iuaPZtcRklEF+ljXWCcGl+Y8smw0dUs2+ugXf8WdhlxLhT8NjTrgMKbA4tnGayW+BQ27PKYrV09PJFvSQk2y5fWa4ysJ4bi7t4sKQz+wwLFUZfkyOgcXfwkI3yw7uD88SiqPmQ0RmE6w6TJN1h6u8hnoQYWVL6FqEx+FN/5gR4F1Hmo90xmlt8AEsf+REBFMPyEo6gIyDqGgoay0KNy8osEnfgm+zKKvzKTRYYl6a1L3VR5CkmSCHFVE5v82HHYfzCRYmk96JARjmBV+AvLU1+Ys4W16d1/WoPbH1KITh136LcbwWzMOALsGfA= Content-ID: <5D06F790F0EDFF4E92130F4983ED33DA@namprd18.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 3a024407-064c-45b9-acd1-08d74f5b313f X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:58.6017 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: f9VEl2cC5A1p7upXcO2uRgtG0YWYV2MShquZ5cLMrJ0HpR8FVzXQM3Pp1F7ClFbE2HAoc2VGQw6iFizNHttouA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:30:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:30:49 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MIME-Autoconverted: from base64 to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUr8a006859 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 65/72] libmultipath: nvme: update to nvme-cli v1.9 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 12 Oct 2019 21:36:20 +0000 (UTC) From: Martin Wilck Update nvme code to nvme-cli v1.9 (977e7d4, Thu Aug 15 2019). Signed-off-by: Martin Wilck --- libmultipath/nvme/linux/nvme.h | 136 +++++++++++++++----- libmultipath/nvme/nvme-ioctl.c | 229 +++++++++++++++++++++------------ libmultipath/nvme/nvme-ioctl.h | 31 ++++- libmultipath/nvme/nvme.h | 121 +++++++++++++---- 4 files changed, 375 insertions(+), 142 deletions(-) diff --git a/libmultipath/nvme/linux/nvme.h b/libmultipath/nvme/linux/nvme.h index 68000eb8..a6975549 100644 --- a/libmultipath/nvme/linux/nvme.h +++ b/libmultipath/nvme/linux/nvme.h @@ -124,6 +124,9 @@ enum { NVME_REG_BPINFO = 0x0040, /* Boot Partition Information */ NVME_REG_BPRSEL = 0x0044, /* Boot Partition Read Select */ NVME_REG_BPMBL = 0x0048, /* Boot Partition Memory Buffer Location */ + NVME_REG_PMRCAP = 0x0e00, /* Persistent Memory Capabilities */ + NVME_REG_PMRCTL = 0x0e04, /* Persistent Memory Region Control */ + NVME_REG_PMRSTS = 0x0e08, /* Persistent Memory Region Status */ NVME_REG_DBS = 0x1000, /* SQ 0 Tail Doorbell */ }; @@ -221,7 +224,11 @@ struct nvme_id_ctrl { __le32 oaes; __le32 ctratt; __le16 rrls; - __u8 rsvd102[154]; + __u8 rsvd102[26]; + __le16 crdt1; + __le16 crdt2; + __le16 crdt3; + __u8 rsvd134[122]; __le16 oacs; __u8 acl; __u8 aerl; @@ -302,6 +309,8 @@ enum { NVME_CTRL_CTRATT_READ_RECV_LVLS = 1 << 3, NVME_CTRL_CTRATT_ENDURANCE_GROUPS = 1 << 4, NVME_CTRL_CTRATT_PREDICTABLE_LAT = 1 << 5, + NVME_CTRL_CTRATT_NAMESPACE_GRANULARITY = 1 << 7, + NVME_CTRL_CTRATT_UUID_LIST = 1 << 9, }; struct nvme_lbaf { @@ -332,7 +341,12 @@ struct nvme_id_ns { __le16 nabspf; __le16 noiob; __u8 nvmcap[16]; - __u8 rsvd64[28]; + __le16 npwg; + __le16 npwa; + __le16 npdg; + __le16 npda; + __le16 nows; + __u8 rsvd74[18]; __le32 anagrpid; __u8 rsvd96[3]; __u8 nsattr; @@ -355,6 +369,9 @@ enum { NVME_ID_CNS_NS_PRESENT = 0x11, NVME_ID_CNS_CTRL_NS_LIST = 0x12, NVME_ID_CNS_CTRL_LIST = 0x13, + NVME_ID_CNS_SCNDRY_CTRL_LIST = 0x15, + NVME_ID_CNS_NS_GRANULARITY = 0x16, + NVME_ID_CNS_UUID_LIST = 0x17, }; enum { @@ -425,26 +442,56 @@ struct nvme_id_nvmset { struct nvme_nvmset_attr_entry ent[NVME_MAX_NVMSET]; }; -/* Derived from 1.3a Figure 101: Get Log Page – Telemetry Host - * -Initiated Log (Log Identifier 07h) +struct nvme_id_ns_granularity_list_entry { + __le64 namespace_size_granularity; + __le64 namespace_capacity_granularity; +}; + +struct nvme_id_ns_granularity_list { + __le32 attributes; + __u8 num_descriptors; + __u8 rsvd[27]; + struct nvme_id_ns_granularity_list_entry entry[16]; +}; + +#define NVME_MAX_UUID_ENTRIES 128 +struct nvme_id_uuid_list_entry { + __u8 header; + __u8 rsvd1[15]; + __u8 uuid[16]; +}; + +struct nvme_id_uuid_list { + struct nvme_id_uuid_list_entry entry[NVME_MAX_UUID_ENTRIES]; +}; + +/** + * struct nvme_telemetry_log_page_hdr - structure for telemetry log page + * @lpi: Log page identifier + * @iee_oui: IEEE OUI Identifier + * @dalb1: Data area 1 last block + * @dalb2: Data area 2 last block + * @dalb3: Data area 3 last block + * @ctrlavail: Controller initiated data available + * @ctrldgn: Controller initiated telemetry Data Generation Number + * @rsnident: Reason Identifier + * @telemetry_dataarea: Contains telemetry data block + * + * This structure can be used for both telemetry host-initiated log page + * and controller-initiated log page. */ struct nvme_telemetry_log_page_hdr { - __u8 lpi; /* Log page identifier */ - __u8 rsvd[4]; - __u8 iee_oui[3]; - __u16 dalb1; /* Data area 1 last block */ - __u16 dalb2; /* Data area 2 last block */ - __u16 dalb3; /* Data area 3 last block */ - __u8 rsvd1[368]; /* TODO verify */ - __u8 ctrlavail; /* Controller initiated data avail?*/ - __u8 ctrldgn; /* Controller initiated telemetry Data Gen # */ - __u8 rsnident[128]; - /* We'll have to double fetch so we can get the header, - * parse dalb1->3 determine how much size we need for the - * log then alloc below. Or just do a secondary non-struct - * allocation. - */ - __u8 telemetry_dataarea[0]; + __u8 lpi; + __u8 rsvd[4]; + __u8 iee_oui[3]; + __le16 dalb1; + __le16 dalb2; + __le16 dalb3; + __u8 rsvd1[368]; + __u8 ctrlavail; + __u8 ctrldgn; + __u8 rsnident[128]; + __u8 telemetry_dataarea[0]; }; struct nvme_endurance_group_log { @@ -513,6 +560,21 @@ struct nvme_fw_slot_info_log { __u8 rsvd64[448]; }; +struct nvme_lba_status_desc { + __u64 dslba; + __u32 nlb; + __u8 rsvd_12; + __u8 status; + __u8 rsvd_15_14[2]; +}; + +struct nvme_lba_status { + __u32 nlsd; + __u8 cmpc; + __u8 rsvd_7_5[3]; + struct nvme_lba_status_desc descs[0]; +}; + /* NVMe Namespace Write Protect State */ enum { NVME_NS_NO_WRITE_PROTECT = 0, @@ -534,6 +596,7 @@ enum { NVME_CMD_EFFECTS_NIC = 1 << 3, NVME_CMD_EFFECTS_CCC = 1 << 4, NVME_CMD_EFFECTS_CSE_MASK = 3 << 16, + NVME_CMD_EFFECTS_UUID_SEL = 1 << 19, }; struct nvme_effects_log { @@ -581,9 +644,6 @@ enum { NVME_AER_SMART = 1, NVME_AER_CSS = 6, NVME_AER_VS = 7, - NVME_AER_NOTICE_NS_CHANGED = 0x0002, - NVME_AER_NOTICE_ANA = 0x0003, - NVME_AER_NOTICE_FW_ACT_STARTING = 0x0102, }; struct nvme_lba_range_type { @@ -606,12 +666,13 @@ enum { NVME_LBART_ATTRIB_HIDE = 1 << 1, }; +/* Predictable Latency Mode - Deterministic Threshold Configuration Data */ struct nvme_plm_config { - __u16 enable_event; + __le16 enable_event; __u8 rsvd2[30]; - __u64 dtwin_reads_thresh; - __u64 dtwin_writes_thresh; - __u64 dtwin_time_thresh; + __le64 dtwin_reads_thresh; + __le64 dtwin_writes_thresh; + __le64 dtwin_time_thresh; __u8 rsvd56[456]; }; @@ -665,6 +726,7 @@ enum nvme_opcode { nvme_cmd_compare = 0x05, nvme_cmd_write_zeroes = 0x08, nvme_cmd_dsm = 0x09, + nvme_cmd_verify = 0x0c, nvme_cmd_resv_register = 0x0d, nvme_cmd_resv_report = 0x0e, nvme_cmd_resv_acquire = 0x11, @@ -892,6 +954,7 @@ enum nvme_admin_opcode { nvme_admin_security_send = 0x81, nvme_admin_security_recv = 0x82, nvme_admin_sanitize_nvm = 0x84, + nvme_admin_get_lba_status = 0x86, }; enum { @@ -921,6 +984,8 @@ enum { NVME_FEAT_RRL = 0x12, NVME_FEAT_PLM_CONFIG = 0x13, NVME_FEAT_PLM_WINDOW = 0x14, + NVME_FEAT_HOST_BEHAVIOR = 0x16, + NVME_FEAT_SANITIZE = 0x17, NVME_FEAT_SW_PROGRESS = 0x80, NVME_FEAT_HOST_ID = 0x81, NVME_FEAT_RESV_MASK = 0x82, @@ -972,6 +1037,7 @@ enum { NVME_SANITIZE_LOG_COMPLETED_SUCCESS = 0x0001, NVME_SANITIZE_LOG_IN_PROGESS = 0x0002, NVME_SANITIZE_LOG_COMPLETED_FAILED = 0x0003, + NVME_SANITIZE_LOG_ND_COMPLETED_SUCCESS = 0x0004, }; enum { @@ -1131,6 +1197,9 @@ struct nvme_sanitize_log_page { __le32 est_ovrwrt_time; __le32 est_blk_erase_time; __le32 est_crypto_erase_time; + __le32 est_ovrwrt_time_with_no_deallocate; + __le32 est_blk_erase_time_with_no_deallocate; + __le32 est_crypto_erase_time_with_no_deallocate; }; /* @@ -1314,6 +1383,12 @@ static inline bool nvme_is_write(struct nvme_command *cmd) return cmd->common.opcode & 1; } +enum { + NVME_SCT_GENERIC = 0x0, + NVME_SCT_CMD_SPECIFIC = 0x1, + NVME_SCT_MEDIA = 0x2, +}; + enum { /* * Generic Command Status: @@ -1344,6 +1419,7 @@ enum { NVME_SC_SANITIZE_IN_PROGRESS = 0x1D, NVME_SC_NS_WRITE_PROTECTED = 0x20, + NVME_SC_CMD_INTERRUPTED = 0x21, NVME_SC_LBA_RANGE = 0x80, NVME_SC_CAP_EXCEEDED = 0x81, @@ -1372,9 +1448,9 @@ enum { NVME_SC_FW_NEEDS_SUBSYS_RESET = 0x110, NVME_SC_FW_NEEDS_RESET = 0x111, NVME_SC_FW_NEEDS_MAX_TIME = 0x112, - NVME_SC_FW_ACIVATE_PROHIBITED = 0x113, + NVME_SC_FW_ACTIVATE_PROHIBITED = 0x113, NVME_SC_OVERLAPPING_RANGE = 0x114, - NVME_SC_NS_INSUFFICENT_CAP = 0x115, + NVME_SC_NS_INSUFFICIENT_CAP = 0x115, NVME_SC_NS_ID_UNAVAILABLE = 0x116, NVME_SC_NS_ALREADY_ATTACHED = 0x118, NVME_SC_NS_IS_PRIVATE = 0x119, @@ -1382,6 +1458,7 @@ enum { NVME_SC_THIN_PROV_NOT_SUPP = 0x11b, NVME_SC_CTRL_LIST_INVALID = 0x11c, NVME_SC_BP_WRITE_PROHIBITED = 0x11e, + NVME_SC_PMR_SAN_PROHIBITED = 0x123, /* * I/O Command Set Specific - NVM commands: @@ -1422,6 +1499,7 @@ enum { NVME_SC_ANA_INACCESSIBLE = 0x302, NVME_SC_ANA_TRANSITION = 0x303, + NVME_SC_CRD = 0x1800, NVME_SC_DNR = 0x4000, }; diff --git a/libmultipath/nvme/nvme-ioctl.c b/libmultipath/nvme/nvme-ioctl.c index 70a16ced..69599763 100644 --- a/libmultipath/nvme/nvme-ioctl.c +++ b/libmultipath/nvme/nvme-ioctl.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -177,6 +178,22 @@ int nvme_compare(int fd, __u64 slba, __u16 nblocks, __u16 control, __u32 dsmgmt, reftag, apptag, appmask, data, metadata); } +int nvme_verify(int fd, __u32 nsid, __u64 slba, __u16 nblocks, + __u16 control, __u32 reftag, __u16 apptag, __u16 appmask) +{ + struct nvme_passthru_cmd cmd = { + .opcode = nvme_cmd_verify, + .nsid = nsid, + .cdw10 = slba & 0xffffffff, + .cdw11 = slba >> 32, + .cdw12 = nblocks | (control << 16), + .cdw14 = reftag, + .cdw15 = apptag | (appmask << 16), + }; + + return nvme_submit_io_passthru(fd, &cmd); +} + int nvme_passthru_io(int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, @@ -370,6 +387,11 @@ int nvme_identify_ctrl_list(int fd, __u32 nsid, __u16 cntid, void *data) return nvme_identify(fd, nsid, (cntid << 16) | cns, data); } +int nvme_identify_secondary_ctrl_list(int fd, __u32 nsid, __u16 cntid, void *data) +{ + return nvme_identify(fd, nsid, (cntid << 16) | NVME_ID_CNS_SCNDRY_CTRL_LIST, data); +} + int nvme_identify_ns_descs(int fd, __u32 nsid, void *data) { @@ -381,8 +403,18 @@ int nvme_identify_nvmset(int fd, __u16 nvmset_id, void *data) return nvme_identify13(fd, 0, NVME_ID_CNS_NVMSET_LIST, nvmset_id, data); } -int nvme_get_log13(int fd, __u32 nsid, __u8 log_id, __u8 lsp, __u64 lpo, - __u16 lsi, bool rae, __u32 data_len, void *data) +int nvme_identify_ns_granularity(int fd, void *data) +{ + return nvme_identify13(fd, 0, NVME_ID_CNS_NS_GRANULARITY, 0, data); +} + +int nvme_identify_uuid(int fd, void *data) +{ + return nvme_identify(fd, 0, NVME_ID_CNS_UUID_LIST, data); +} + +int nvme_get_log14(int fd, __u32 nsid, __u8 log_id, __u8 lsp, __u64 lpo, + __u16 lsi, bool rae, __u8 uuid_ix, __u32 data_len, void *data) { struct nvme_admin_cmd cmd = { .opcode = nvme_admin_get_log_page, @@ -400,6 +432,7 @@ int nvme_get_log13(int fd, __u32 nsid, __u8 log_id, __u8 lsp, __u64 lpo, cmd.cdw11 = numdu | (lsi << 16); cmd.cdw12 = lpo; cmd.cdw13 = (lpo >> 32); + cmd.cdw14 = uuid_ix; return nvme_submit_admin_passthru(fd, &cmd); @@ -498,7 +531,7 @@ int nvme_self_test_log(int fd, struct nvme_self_test_log *self_test_log) int nvme_effects_log(int fd, struct nvme_effects_log_page *effects_log) { - return nvme_get_log(fd, 0, NVME_LOG_CMD_EFFECTS, false, + return nvme_get_log(fd, NVME_NSID_ALL, NVME_LOG_CMD_EFFECTS, false, sizeof(*effects_log), effects_log); } @@ -542,77 +575,61 @@ int nvme_set_feature(int fd, __u32 nsid, __u8 fid, __u32 value, __u32 cdw12, cdw12, data_len, data, result); } -static int nvme_property(int fd, __u8 fctype, __le32 off, __le64 *value, __u8 attrib) -{ - int err; - struct nvme_admin_cmd cmd = { - .opcode = nvme_fabrics_command, - .cdw10 = attrib, - .cdw11 = off, - }; - - if (!value) { - errno = EINVAL; - return -errno; - } - - if (fctype == nvme_fabrics_type_property_get){ - cmd.nsid = nvme_fabrics_type_property_get; - } else if(fctype == nvme_fabrics_type_property_set) { - cmd.nsid = nvme_fabrics_type_property_set; - cmd.cdw12 = *value; - } else { - errno = EINVAL; - return -errno; - } - err = nvme_submit_admin_passthru(fd, &cmd); - if (!err && fctype == nvme_fabrics_type_property_get) - *value = cpu_to_le64(cmd.result); - return err; +/* + * Perform the opposite operation of the byte-swapping code at the start of the + * kernel function nvme_user_cmd(). + */ +static void nvme_to_passthru_cmd(struct nvme_passthru_cmd *pcmd, + const struct nvme_command *ncmd) +{ + assert(sizeof(*ncmd) < sizeof(*pcmd)); + memset(pcmd, 0, sizeof(*pcmd)); + pcmd->opcode = ncmd->common.opcode; + pcmd->flags = ncmd->common.flags; + pcmd->rsvd1 = ncmd->common.command_id; + pcmd->nsid = le32_to_cpu(ncmd->common.nsid); + pcmd->cdw2 = le32_to_cpu(ncmd->common.cdw2[0]); + pcmd->cdw3 = le32_to_cpu(ncmd->common.cdw2[1]); + /* Skip metadata and addr */ + pcmd->cdw10 = le32_to_cpu(ncmd->common.cdw10[0]); + pcmd->cdw11 = le32_to_cpu(ncmd->common.cdw10[1]); + pcmd->cdw12 = le32_to_cpu(ncmd->common.cdw10[2]); + pcmd->cdw13 = le32_to_cpu(ncmd->common.cdw10[3]); + pcmd->cdw14 = le32_to_cpu(ncmd->common.cdw10[4]); + pcmd->cdw15 = le32_to_cpu(ncmd->common.cdw10[5]); } -static int get_property_helper(int fd, int offset, void *value, int *advance) +int nvme_get_property(int fd, int offset, uint64_t *value) { - __le64 value64; - int err = -EINVAL; - - switch (offset) { - case NVME_REG_CAP: - case NVME_REG_ASQ: - case NVME_REG_ACQ: - *advance = 8; - break; - default: - *advance = 4; - } - - if (!value) - return err; - - err = nvme_property(fd, nvme_fabrics_type_property_get, - cpu_to_le32(offset), &value64, (*advance == 8)); + struct nvme_passthru_cmd pcmd; + struct nvmf_property_get_command pg = { + .opcode = nvme_fabrics_command, + .fctype = nvme_fabrics_type_property_get, + .offset = cpu_to_le32(offset), + .attrib = is_64bit_reg(offset), + }; + struct nvme_command gcmd; + int err; + gcmd.prop_get = pg; + nvme_to_passthru_cmd(&pcmd, &gcmd); + err = nvme_submit_admin_passthru(fd, &pcmd); if (!err) { - if (*advance == 8) - *((uint64_t *)value) = le64_to_cpu(value64); - else - *((uint32_t *)value) = le32_to_cpu(value64); + /* + * nvme_submit_admin_passthru() stores the lower 32 bits + * of the property value in pcmd.result using CPU endianness. + */ + *value = pcmd.result; } - return err; } -int nvme_get_property(int fd, int offset, uint64_t *value) -{ - int advance; - return get_property_helper(fd, offset, value, &advance); -} - int nvme_get_properties(int fd, void **pbar) { - int offset, advance; - int err, ret = -EINVAL; + int offset; + uint64_t value; + int err; int size = getpagesize(); *pbar = malloc(size); @@ -622,33 +639,42 @@ int nvme_get_properties(int fd, void **pbar) } memset(*pbar, 0xff, size); - for (offset = NVME_REG_CAP; offset <= NVME_REG_CMBSZ; offset += advance) { - err = get_property_helper(fd, offset, *pbar + offset, &advance); - if (!err) - ret = 0; + for (offset = NVME_REG_CAP; offset <= NVME_REG_CMBSZ;) { + err = nvme_get_property(fd, offset, &value); + if (err > 0 && (err & 0xff) == NVME_SC_INVALID_FIELD) { + err = 0; + value = -1; + } else if (err) { + free(*pbar); + break; + } + if (is_64bit_reg(offset)) { + *(uint64_t *)(*pbar + offset) = value; + offset += 8; + } else { + *(uint32_t *)(*pbar + offset) = value; + offset += 4; + } } - return ret; + return err; } -int nvme_set_property(int fd, int offset, int value) +int nvme_set_property(int fd, int offset, uint64_t value) { - __le64 val = cpu_to_le64(value); - __le32 off = cpu_to_le32(offset); - bool is64bit; - - switch (off) { - case NVME_REG_CAP: - case NVME_REG_ASQ: - case NVME_REG_ACQ: - is64bit = true; - break; - default: - is64bit = false; - } + struct nvmf_property_set_command ps = { + .opcode = nvme_fabrics_command, + .fctype = nvme_fabrics_type_property_set, + .offset = cpu_to_le32(offset), + .value = cpu_to_le64(value), + .attrib = is_64bit_reg(offset), + }; + struct nvme_command scmd; + struct nvme_passthru_cmd pcmd; - return nvme_property(fd, nvme_fabrics_type_property_set, - off, &val, is64bit ? 1: 0); + scmd.prop_set = ps; + nvme_to_passthru_cmd(&pcmd, &scmd); + return nvme_submit_admin_passthru(fd, &pcmd); } int nvme_get_feature(int fd, __u32 nsid, __u8 fid, __u8 sel, __u32 cdw11, @@ -675,7 +701,7 @@ int nvme_format(int fd, __u32 nsid, __u8 lbaf, __u8 ses, __u8 pi, } int nvme_ns_create(int fd, __u64 nsze, __u64 ncap, __u8 flbas, - __u8 dps, __u8 nmic, __u32 *result) + __u8 dps, __u8 nmic, __u32 timeout, __u32 *result) { struct nvme_id_ns ns = { .nsze = cpu_to_le64(nsze), @@ -689,6 +715,7 @@ int nvme_ns_create(int fd, __u64 nsze, __u64 ncap, __u8 flbas, .addr = (__u64)(uintptr_t) ((void *)&ns), .cdw10 = 0, .data_len = 0x1000, + .timeout_ms = timeout, }; int err; @@ -698,12 +725,13 @@ int nvme_ns_create(int fd, __u64 nsze, __u64 ncap, __u8 flbas, return err; } -int nvme_ns_delete(int fd, __u32 nsid) +int nvme_ns_delete(int fd, __u32 nsid, __u32 timeout) { struct nvme_admin_cmd cmd = { .opcode = nvme_admin_ns_mgmt, .nsid = nsid, .cdw10 = 1, + .timeout_ms = timeout, }; return nvme_submit_admin_passthru(fd, &cmd); @@ -803,6 +831,21 @@ int nvme_sec_recv(int fd, __u32 nsid, __u8 nssf, __u16 spsp, return err; } +int nvme_get_lba_status(int fd, __u64 slba, __u32 mndw, __u8 atype, __u16 rl, + void *data) +{ + struct nvme_admin_cmd cmd = { + .opcode = nvme_admin_get_lba_status, + .addr = (__u64)(uintptr_t) data, + .cdw10 = slba & 0xffffffff, + .cdw11 = slba >> 32, + .cdw12 = mndw, + .cdw13 = (atype << 24) | rl, + }; + + return nvme_submit_admin_passthru(fd, &cmd); +} + int nvme_dir_send(int fd, __u32 nsid, __u16 dspec, __u8 dtype, __u8 doper, __u32 data_len, __u32 dw12, void *data, __u32 *result) { @@ -867,3 +910,19 @@ int nvme_self_test_start(int fd, __u32 nsid, __u32 cdw10) return nvme_submit_admin_passthru(fd, &cmd); } + +int nvme_virtual_mgmt(int fd, __u32 cdw10, __u32 cdw11, __u32 *result) +{ + struct nvme_admin_cmd cmd = { + .opcode = nvme_admin_virtual_mgmt, + .cdw10 = cdw10, + .cdw11 = cdw11, + }; + int err; + + err = nvme_submit_admin_passthru(fd, &cmd); + if (!err && result) + *result = cmd.result; + + return err; +} diff --git a/libmultipath/nvme/nvme-ioctl.h b/libmultipath/nvme/nvme-ioctl.h index 3fb740c3..565f7648 100644 --- a/libmultipath/nvme/nvme-ioctl.h +++ b/libmultipath/nvme/nvme-ioctl.h @@ -6,6 +6,8 @@ #include "linux/nvme_ioctl.h" #include "nvme.h" +#define NVME_IOCTL_TIMEOUT 120000 /* in milliseconds */ + int nvme_get_nsid(int fd); /* Generic passthrough */ @@ -36,6 +38,9 @@ int nvme_compare(int fd, __u64 slba, __u16 nblocks, __u16 control, __u32 dsmgmt, __u32 reftag, __u16 apptag, __u16 appmask, void *data, void *metadata); +int nvme_verify(int fd, __u32 nsid, __u64 slba, __u16 nblocks, + __u16 control, __u32 reftag, __u16 apptag, __u16 appmask); + /* NVME_IO_CMD */ int nvme_passthru_io(int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, @@ -73,11 +78,22 @@ int nvme_identify_ns_list(int fd, __u32 nsid, bool all, void *data); int nvme_identify_ctrl_list(int fd, __u32 nsid, __u16 cntid, void *data); int nvme_identify_ns_descs(int fd, __u32 nsid, void *data); int nvme_identify_nvmset(int fd, __u16 nvmset_id, void *data); -int nvme_get_log13(int fd, __u32 nsid, __u8 log_id, __u8 lsp, __u64 lpo, - __u16 group_id, bool rae, __u32 data_len, void *data); +int nvme_identify_uuid(int fd, void *data); +int nvme_identify_secondary_ctrl_list(int fd, __u32 nsid, __u16 cntid, void *data); +int nvme_identify_ns_granularity(int fd, void *data); int nvme_get_log(int fd, __u32 nsid, __u8 log_id, bool rae, __u32 data_len, void *data); - +int nvme_get_log14(int fd, __u32 nsid, __u8 log_id, __u8 lsp, __u64 lpo, + __u16 group_id, bool rae, __u8 uuid_ix, + __u32 data_len, void *data); + +static inline int nvme_get_log13(int fd, __u32 nsid, __u8 log_id, __u8 lsp, + __u64 lpo, __u16 lsi, bool rae, __u32 data_len, + void *data) +{ + return nvme_get_log14(fd, nsid, log_id, lsp, lpo, lsi, rae, 0, + data_len, data); +} int nvme_get_telemetry_log(int fd, void *lp, int generate_report, int ctrl_gen, size_t log_page_size, __u64 offset); @@ -105,8 +121,8 @@ int nvme_format(int fd, __u32 nsid, __u8 lbaf, __u8 ses, __u8 pi, __u8 pil, __u8 ms, __u32 timeout); int nvme_ns_create(int fd, __u64 nsze, __u64 ncap, __u8 flbas, - __u8 dps, __u8 nmic, __u32 *result); -int nvme_ns_delete(int fd, __u32 nsid); + __u8 dps, __u8 nmic, __u32 timeout, __u32 *result); +int nvme_ns_delete(int fd, __u32 nsid, __u32 timeout); int nvme_ns_attachment(int fd, __u32 nsid, __u16 num_ctrls, __u16 *ctrlist, bool attach); @@ -125,15 +141,18 @@ int nvme_subsystem_reset(int fd); int nvme_reset_controller(int fd); int nvme_ns_rescan(int fd); +int nvme_get_lba_status(int fd, __u64 slba, __u32 mndw, __u8 atype, __u16 rl, + void *data); int nvme_dir_send(int fd, __u32 nsid, __u16 dspec, __u8 dtype, __u8 doper, __u32 data_len, __u32 dw12, void *data, __u32 *result); int nvme_dir_recv(int fd, __u32 nsid, __u16 dspec, __u8 dtype, __u8 doper, __u32 data_len, __u32 dw12, void *data, __u32 *result); int nvme_get_properties(int fd, void **pbar); -int nvme_set_property(int fd, int offset, int value); +int nvme_set_property(int fd, int offset, uint64_t value); int nvme_get_property(int fd, int offset, uint64_t *value); int nvme_sanitize(int fd, __u8 sanact, __u8 ause, __u8 owpass, __u8 oipbp, __u8 no_dealloc, __u32 ovrpat); int nvme_self_test_start(int fd, __u32 nsid, __u32 cdw10); int nvme_self_test_log(int fd, struct nvme_self_test_log *self_test_log); +int nvme_virtual_mgmt(int fd, __u32 cdw10, __u32 cdw11, __u32 *result); #endif /* _NVME_LIB_H */ diff --git a/libmultipath/nvme/nvme.h b/libmultipath/nvme/nvme.h index 685d1799..7e0278b5 100644 --- a/libmultipath/nvme/nvme.h +++ b/libmultipath/nvme/nvme.h @@ -40,16 +40,16 @@ struct nvme_effects_log_page { }; struct nvme_error_log_page { - __u64 error_count; - __u16 sqid; - __u16 cmdid; - __u16 status_field; - __u16 parm_error_location; - __u64 lba; - __u32 nsid; + __le64 error_count; + __le16 sqid; + __le16 cmdid; + __le16 status_field; + __le16 parm_error_location; + __le64 lba; + __le32 nsid; __u8 vs; __u8 resv[3]; - __u64 cs; + __le64 cs; __u8 resv2[24]; }; @@ -87,13 +87,30 @@ struct nvme_controller_list { __le16 identifier[]; }; +struct nvme_secondary_controller_entry { + __le16 scid; /* Secondary Controller Identifier */ + __le16 pcid; /* Primary Controller Identifier */ + __u8 scs; /* Secondary Controller State */ + __u8 rsvd5[3]; + __le16 vfn; /* Virtual Function Number */ + __le16 nvq; /* Number of VQ Flexible Resources Assigned */ + __le16 nvi; /* Number of VI Flexible Resources Assigned */ + __u8 rsvd14[18]; +}; + +struct nvme_secondary_controllers_list { + __u8 num; + __u8 rsvd[31]; + struct nvme_secondary_controller_entry sc_entry[127]; +}; + struct nvme_bar_cap { __u16 mqes; __u8 ams_cqr; __u8 to; __u16 bps_css_nssrs_dstrd; __u8 mpsmax_mpsmin; - __u8 reserved; + __u8 rsvd_pmrs; }; #ifdef __CHECKER__ @@ -102,19 +119,31 @@ struct nvme_bar_cap { #define __force #endif -#define cpu_to_le16(x) \ - ((__force __le16)htole16(x)) -#define cpu_to_le32(x) \ - ((__force __le32)htole32(x)) -#define cpu_to_le64(x) \ - ((__force __le64)htole64(x)) - -#define le16_to_cpu(x) \ - le16toh((__force __u16)(x)) -#define le32_to_cpu(x) \ - le32toh((__force __u32)(x)) -#define le64_to_cpu(x) \ - le64toh((__force __u64)(x)) +static inline __le16 cpu_to_le16(uint16_t x) +{ + return (__force __le16)htole16(x); +} +static inline __le32 cpu_to_le32(uint32_t x) +{ + return (__force __le32)htole32(x); +} +static inline __le64 cpu_to_le64(uint64_t x) +{ + return (__force __le64)htole64(x); +} + +static inline uint16_t le16_to_cpu(__le16 x) +{ + return le16toh((__force __u16)x); +} +static inline uint32_t le32_to_cpu(__le32 x) +{ + return le32toh((__force __u32)x); +} +static inline uint64_t le64_to_cpu(__le64 x) +{ + return le64toh((__force __u64)x); +} #define MAX_LIST_ITEMS 256 struct list_item { @@ -131,6 +160,10 @@ struct ctrl_list_item { char *transport; char *state; char *ana_state; + char *subsysnqn; + char *traddr; + char *trsvcid; + char *host_traddr; }; struct subsys_list_item { @@ -146,6 +179,26 @@ enum { BINARY, }; +struct connect_args { + char *subsysnqn; + char *transport; + char *traddr; + char *trsvcid; + char *host_traddr; +}; + +#define SYS_NVME "/sys/class/nvme" + +bool ctrl_matches_connectargs(char *name, struct connect_args *args); +char *find_ctrl_with_connectargs(struct connect_args *args); +char *__parse_connect_arg(char *conargs, const char delim, const char *fieldnm); + +extern const char *conarg_nqn; +extern const char *conarg_transport; +extern const char *conarg_traddr; +extern const char *conarg_trsvcid; +extern const char *conarg_host_traddr; + void register_extension(struct plugin *plugin); #include "argconfig.h" @@ -160,4 +213,28 @@ int validate_output_format(char *format); struct subsys_list_item *get_subsys_list(int *subcnt, char *subsysnqn, __u32 nsid); void free_subsys_list(struct subsys_list_item *slist, int n); char *nvme_char_from_block(char *block); + +/* + * is_64bit_reg - It checks whether given offset of the controller register is + * 64bit or not. + * @offset: offset of controller register field in bytes + * + * It gives true if given offset is 64bit register, otherwise it returns false. + * + * Notes: This function does not care about transport so that the offset is + * not going to be checked inside of this function for the unsupported fields + * in a specific transport. For example, BPMBL(Boot Partition Memory Buffer + * Location) register is not supported by fabrics, but it can be chcked here. + */ +static inline bool is_64bit_reg(__u32 offset) +{ + if (offset == NVME_REG_CAP || + offset == NVME_REG_ASQ || + offset == NVME_REG_ACQ || + offset == NVME_REG_BPMBL) + return true; + + return false; +} + #endif /* _NVME_H */ From patchwork Sat Oct 12 21:28:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187097 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 19DE815AB for ; Sat, 12 Oct 2019 21:34:57 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EB42920700 for ; Sat, 12 Oct 2019 21:34:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB42920700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 mx1.redhat.com (Postfix) with ESMTPS id 35BE230BCBA2; Sat, 12 Oct 2019 21:34:56 +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 11D365D9CC; Sat, 12 Oct 2019 21:34:56 +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 CEDDB4EE6A; Sat, 12 Oct 2019 21:34:55 +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 x9CLUgtp006759 for ; Sat, 12 Oct 2019 17:30:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 68C2060C05; Sat, 12 Oct 2019 21:30:42 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B8AC960BF1; Sat, 12 Oct 2019 21:30:39 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 617253C93D; Sat, 12 Oct 2019 21:30:38 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:30:00 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:38 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.13) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hwkqmoG2mI9V+ezHDokl3blSx+6ipsRHVRYIBE4Pq43CxjMA75CVpz7VlT6cbF1mXxGFeI3dAviHt6qGQI9WZMW8cj+Ram1dadHsVZ9l2XNDxeyrG8NQk45uIFf6BO4qd5tMoNstCcmazAa1CGElroIz6mx+K6JwGtCNH2gV87UWF4bh8Y1XrIeVRDc4Kfp8IiO62f0MDTQSiFp+Egl0gDIYp3RY+CM3qFyPDSVqQT7aAhgYjgyiyKaCCSPxGXNscz8uJsSY7h/9KNhGouNXA6zFac6yisbC/+93hmwKnNLClYaQGpMzfipfr+Hx0KDUHJ2kDD+q72Rmc3SfHxx33w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NsOTssjS5AupurRQsoUNtIyw1m3MrEEK2msenUWWuAQ=; b=aY2mBm13WJF/wrqVrbAst0simgM4zgh7gpVf8Dh+Mwtj50fv4AgBV8weqx93zqgSB28l0ezgFnK7WsDxbXTqBMG/ltjKJWczx5oxSVZfS0Hif34p24OKwkX5hOFmtJWWw0aN0395ovdY2JQ4lMh2vaVuNh8ssC7KM+r9CjEqmGAW+8dHbZtmqiQ0x11u0h74ot3yOvAAXxEq0Xti/6ritpiCJDYqZwgXB8fg+OCnxSBuV0bDmukSAoWayU22MJBZj20Mlvh7cAPsvLIaJ05dLna3Tt1Wo1P2c9SB+0UKGN2napVdQDVtGTgHmZv+4aZbLqtswC4n24nAdoPWKBHntA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:34 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:34 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 66/72] multipath-tools: Makefile.inc: fix TEST_CC_OPTION Thread-Index: AQHVgUQPMCA/4ifDbE+SjlQthdBdMw== Date: Sat, 12 Oct 2019 21:28:59 +0000 Message-ID: <20191012212703.12989-67-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 35cf0c6d-a95f-4e61-89a0-08d74f5b3206 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AnJMk9r2kTRqe28dLoUHzzf9xnfiXrFo1HSqfzsmAQYBLfSRQbQ4p4c56i0qyO+6dFul6oFGALcyCwd4GMt7Hju3HjvxuCeqwGjCL0nI4ZSSQjEl7k1N1IMOCBgI/OufZA1vH4vg3ZtrqEvzIuKDPaB33vHbGYqDsB6w/8ieZcMelhNbeEX91vzfxfGW9WVNI87ZRkDORiccrQlIb7vhEzPj+CE44XAz8Kk0ipKkwzGm28hXwVkj9BE6wzvwNtR8Nf399XYs4eOar9yFB0Dw4U/wrw5ubzFWps3R7ammq3pBOMYOSW2cJCqY3Q/ehva04agjjhHt7j3s3GDEzkgxQ/gGmCNWhL3d8BJQJh80Sdru0Abl6L0A/PNlAbVL0zGkWY0WseUC4+KmlomWtkPRItgMr34TLbx2KhRNOuZlTaU= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 35cf0c6d-a95f-4e61-89a0-08d74f5b3206 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:28:59.9240 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oB2KpfBITdN47C3Mh/7DbAYh8S0aU2cJDeTjFy+24tXUm6uA+c/qCtJuWs6Z1Jxv6XIQ6GjpMDDsXvOazm2jpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sat, 12 Oct 2019 21:30:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sat, 12 Oct 2019 21:30:39 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUgtp006759 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 66/72] multipath-tools: Makefile.inc: fix TEST_CC_OPTION 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:34:56 +0000 (UTC) From: Martin Wilck The test works only if the compiler actually errors out for an unsupported warning option, which requires setting -Werror. Signed-off-by: Martin Wilck --- Makefile.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc index 0c800ab3..d4d08fe9 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -81,7 +81,8 @@ INSTALL_PROGRAM = install # Test if the C compiler supports the option. # Evaluates to "option" if yes, and "fallback" otherwise. TEST_CC_OPTION = $(shell \ - if echo 'int main(void){return 0;}' | $(CC) -o /dev/null -c "$(1)" -xc - >/dev/null 2>&1; \ + if echo 'int main(void){return 0;}' | \ + $(CC) -o /dev/null -c -Werror "$(1)" -xc - >/dev/null 2>&1; \ then \ echo "$(1)"; \ else \ From patchwork Sat Oct 12 21:29:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187101 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 3766514E5 for ; Sat, 12 Oct 2019 21:35:18 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 14D1420700 for ; Sat, 12 Oct 2019 21:35:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14D1420700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 mx1.redhat.com (Postfix) with ESMTPS id 5125E308C21D; Sat, 12 Oct 2019 21:35:17 +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 2B9BA5DA8D; Sat, 12 Oct 2019 21:35:17 +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 E5BFF4EE6D; Sat, 12 Oct 2019 21:35:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUhbX006778 for ; Sat, 12 Oct 2019 17:30:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id CBDC65D71C; Sat, 12 Oct 2019 21:30:43 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C0BFD5D6A3; Sat, 12 Oct 2019 21:30:43 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ABE0C87630; Sat, 12 Oct 2019 21:30:42 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:30:04 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:39 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.11) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IDDqcBEAF05RbFp17afeu/ciM/TV2ny4ZZA2kBzNp9tT98TEOqf0bFHNVEVbXo2Bi59r07OLQssY4trtSYEFLRKWV1roVvesT+QDu7e632sNfuQGfFp6ZiWlHHg9/Mm9dXO4WVWE2g2PDuLZZiaoQj9zo6Wd3FrcO6nR4ApjEeSQuuSlp79T+t3zFYiC3lT1lMaMaMr8snQp+DPasoyXiQilZYQXpdMLxg0T4rK/dFp7MA1XvOFD/LK/E4wljwCkFCHZM9eDm2UaaPcYctz0UDyvUiSvTSwCKVEUQMQpZZXYJU3KBMaF50rxLd8eHeOxkvqqd94InsTyLnhEDGwX6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N94FX26rRr2GXdnndxIHYSnWb8yXjVhJt+OEbOshW5I=; b=IfOO2o6Mb5vDm0lthpJyaZWfKCy1YVtxE9HNhlipX3VZm+mhWy8JVsfHPSjxD9mrAIxiy+uEwQDVAgs4XAd96u31Q4zenoRx9/DHcHbJu6TDn44t5YdhLw0oLG4mxUyJxpjYCJ0l1qomCziNY3KyAr4Fx2fwTES3ChuhdqlQO5NBh6bS3SROZRof5TiBBJFc2dcl4YbG9blHRaFEyvyHkZpfnOy1ZQyviijMjSWF01rA2DQT9U1bBsxmnuNdbADXKhfVUIpMa2JHvkwBK1BUMq/LXdVaGTt1O9+cZvGE8IceA8d/8NvSGx4pDft6lP8EOseeE0WcgVsCG4kFwAoOdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:34 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:34 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 67/72] multipath-tools: Makefile.inc: use -Wp,... for compiling only Thread-Index: AQHVgUQQrs8Dqva3Z0a4xAGFDisHnw== Date: Sat, 12 Oct 2019 21:29:01 +0000 Message-ID: <20191012212703.12989-68-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7eb49f36-3349-4019-b487-08d74f5b32cd x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1923; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(979002)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: u9w5o/M1ZznrChwpi2PB+5GzpVHJ7C7Uaxq00VbrrsVDjsDHzN3iieYQbjkC3L/VbY1W6mo0sF3lmTIlZHKxFegYq954eN2pLGIeLGPp7vzM7Fn0KeSTXKX8F7YbXL+/dB3e2I7kj1zPf7sZJY/ZNug+7WEbF0MbcjtBrWjKCgpWd+ktk8F1PgQ8XUNvdS4tqSx4bVCXnokIF97c4c7kQeZG/CC6Bokf+jVyPuGTpjP3trDWOt8KwnZhl2FWYID9pHr1nyG1TpKGkYu5ycI5FNFCuyRohuojn7pKH/ZP/Dr0PojLcx1l81tPSoKZ/uq6sXXfxGDWIUP1KCGpqMAhYHfsjV2ufQfvmrMvVBDODqM8ZaBNBe1C3bEAD3GMEyVawf5WkDPs6bvHo3OrlwJIlxQr36EWsK8mezSRMlzRPpc= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 7eb49f36-3349-4019-b487-08d74f5b32cd X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:29:01.2063 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 697Ov7vzWEGuDIeGG6dA+gKqz04JOy6KZ32yKB8iQegbccd9BJMoTQFnSxEds7cooj1EF7c4Z45Uav1gAJmF/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 12 Oct 2019 21:30:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 12 Oct 2019 21:30:43 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUhbX006778 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 67/72] multipath-tools: Makefile.inc: use -Wp, ... for compiling only 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sat, 12 Oct 2019 21:35:17 +0000 (UTC) From: Martin Wilck clang-3.9 errors out if -Wp,... preprocessor flags are used in the linking stage. Signed-off-by: Martin Wilck --- Makefile.inc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile.inc b/Makefile.inc index d4d08fe9..f309a274 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -96,9 +96,8 @@ OPTFLAGS = -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \ -Werror=implicit-function-declaration -Werror=format-security \ -Wno-clobbered \ -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ - -Wp,-D_FORTIFY_SOURCE=2 $(STACKPROT) \ - --param=ssp-buffer-size=4 - + $(STACKPROT) --param=ssp-buffer-size=4 +CPPFLAGS := -Wp,-D_FORTIFY_SOURCE=2 CFLAGS := $(OPTFLAGS) -DBIN_DIR=\"$(bindir)\" -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" \ -MMD -MP $(CFLAGS) BIN_CFLAGS = -fPIE -DPIE @@ -135,4 +134,4 @@ check_file = $(shell \ %.o: %.c @echo building $@ because of $? - $(CC) $(CFLAGS) -c -o $@ $< + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< From patchwork Sat Oct 12 21:29:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187063 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 7E4911668 for ; Sat, 12 Oct 2019 21:32:50 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 59F8D20700 for ; Sat, 12 Oct 2019 21:32:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 59F8D20700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 A97EB309DEEE; Sat, 12 Oct 2019 21:32:49 +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 7FFB460C4B; Sat, 12 Oct 2019 21:32:49 +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 49C9C4EE70; Sat, 12 Oct 2019 21:32:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9CLUn1Z006826 for ; Sat, 12 Oct 2019 17:30:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id B5F3F5C22F; Sat, 12 Oct 2019 21:30:49 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 723F05C226; Sat, 12 Oct 2019 21:30:47 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1EAF83098442; Sat, 12 Oct 2019 21:30:46 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:30:07 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:39 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.13) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YwGiTdPf2nU40V/xKijO4O8+hyCb/fCI8PFEg3r9a+amW3fyLRH+Evdy/aJMAB5o9hn5WrULNShSf9WDHTC3qapYFTu5e5OCqwihTjMY1lQWQPL0wwUODWr7hxuupNy8L78+VpuugaLE63GPr7Wmw8zYIdMZ1ce/YlcI9kXAEITtoIRTye6rkWskgPbE9jz+3MHSJ4H8h4uf9UJL9ZLaKVJYiMq+PGaZx8c/tCplNvFE+fs1yMCRQ4ic8AHIguSfBz+gTFKqItkDbJrUSfOosh+aWryQ7mL9FS6VKcp3sXs86DjcNOclUgvULNL6tCldWDfVeAUb5X6NFy9d6BUmWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LsURi/K5TvmNV2xGSHdFiyN/0KxdeKvqdz5tmpkaqvg=; b=feWzI5wAa9AVzIUAbh/uxN8TnxzKVDZEEE5HDV3Y8u+oCzagNSmUaskEsT23ShGiRgs/X+Sg2VrX4nHV4KpZ7GfAmI1VY8hJQ2QxEjCJRzG78JeOsOdG6BhiiNN+2qZgulj7U3Wkl1OEG1lut3+VfHLDiPzHA5ILlOaSzCc2RYeC4QWg6t5BxH+QzVpgMgTgybUhanu7umqgKC5ZjDMJxtKdwB72iF0KVojwh8K28UWY4Yhjh+aLzKTOVnG8gMjFmeMwybARPxeQ9ze/KEJ9bok3GlbnOAL0lDXgdXmH9e2hAhO58XntdWDf9tOffYPF/cxKX+IDj4QGgoqULeOWHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:35 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:35 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 68/72] multipath-tools: Makefile: use proper directory recursion Thread-Index: AQHVgUQRcBpHmz+TBEO/0nWdaG/Dag== Date: Sat, 12 Oct 2019 21:29:02 +0000 Message-ID: <20191012212703.12989-69-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dc40615c-8b43-4cba-5d79-08d74f5b3391 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3631; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7E7nr2wJ2qaXffp+NL4DecDOk7TQxrme/7Ou/0jeH4yACVgSX3qvPrr3CBklsV/dR1l8bwQzJHFh/EqBbniWyG/Nc+yW6SXIo2o9LvpUGF/ltjgw+45r8ss6RhCBJfXTzbxAaZ0gjKwxrA5dZNY819n+jVdP6ofMgJGQwepiFCgyBkeG7IMup09ts/ZKzmsO76C2QTWvdLZ1HOl6dSQEuYceUVva0WBG10V5OKVu4Wkpung1DHUbTWXJbfq2NFr8fvq7jNCIqApezCnpHNBbuGvSYC5fSbq12Vxuqb7fHWbafhCQPCVxmruxxJaR3zZvTXH8O0DLo3O0z2rnSx66rBUGwpAGPBG0hvzPtWX9j4Wd77DiFOlw5F7YJS+Xi02mQojB6xpdHPAGinF32lA0J1eJN8G354PLqUik/gxjM6A= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: dc40615c-8b43-4cba-5d79-08d74f5b3391 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:29:02.3836 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cWy3J3fTorFz4auflN5u7hQcgvcak7MkJAAjo+vQjxdIWTlGAl9XKI8VAyQL0/jCyws+jqeVncA14v1vMXpVfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 12 Oct 2019 21:30:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 12 Oct 2019 21:30:46 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUn1Z006826 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 68/72] multipath-tools: Makefile: use proper directory recursion 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.45]); Sat, 12 Oct 2019 21:32:50 +0000 (UTC) From: Martin Wilck "make -k" didn't work with the Makefile's subdirectory handling. Do it the proper "make" way. Signed-off-by: Martin Wilck --- Makefile | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 4b145c59..1dee3680 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Copyright (C) 2003 Christophe Varoqui, # -BUILDDIRS = \ +BUILDDIRS := \ libmpathcmd \ libmultipath \ libmultipath/prioritizers \ @@ -19,32 +19,30 @@ BUILDDIRS += \ libdmmp endif -all: recurse +BUILDDIRS.clean := $(BUILDDIRS:=.clean) tests.clean -recurse: - @for dir in $(BUILDDIRS); do $(MAKE) -C $$dir || exit $?; done +.PHONY: $(BUILDDIRS) $(BUILDDIRS:=.uninstall) $(BUILDDIRS:=.install) $(BUILDDIRS.clean) -recurse_clean: - @for dir in $(BUILDDIRS); do \ - $(MAKE) -C $$dir clean || exit $?; \ - done - $(MAKE) -C tests clean +all: $(BUILDDIRS) -recurse_install: - @for dir in $(BUILDDIRS); do \ - $(MAKE) -C $$dir install || exit $?; \ - done +$(BUILDDIRS): + $(MAKE) -C $@ -recurse_uninstall: - @for dir in $(BUILDDIRS); do \ - $(MAKE) -C $$dir uninstall || exit $?; \ - done +multipath multipathd mpathpersist: libmultipath +mpathpersist: libmpathpersist -clean: recurse_clean +$(BUILDDIRS.clean): + $(MAKE) -C ${@:.clean=} clean -install: recurse_install +$(BUILDDIRS:=.install): + $(MAKE) -C ${@:.install=} install -uninstall: recurse_uninstall +$(BUILDDIRS:=.uninstall): + $(MAKE) -C ${@:.uninstall=} uninstall + +clean: $(BUILDDIRS.clean) +install: $(BUILDDIRS:=.install) +uninstall: $(BUILDDIRS:=.uninstall) test: all $(MAKE) -C tests From patchwork Sat Oct 12 21:29:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187109 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 10320112B for ; Sat, 12 Oct 2019 21:36:00 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E0BC120700 for ; Sat, 12 Oct 2019 21:35:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E0BC120700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 20F7B3172D8A; Sat, 12 Oct 2019 21:35:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE05E60BF4; Sat, 12 Oct 2019 21:35:58 +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 A818B1803518; Sat, 12 Oct 2019 21:35:58 +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 x9CLUpVX006839 for ; Sat, 12 Oct 2019 17:30:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7877260BF4; Sat, 12 Oct 2019 21:30:51 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 52FD260BF1; Sat, 12 Oct 2019 21:30:51 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C66DF2BF73; Sat, 12 Oct 2019 21:30:49 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:30:11 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:40 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.8.13) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m8rJ5HQRh6VSE9pxwX31+TFW5oKmaPenbJV+ufCaZUpc7Bpjx0IweKV3ncw1vQwjbI3JUcWXhW1aHo/5kPo7Ou82r9YNWHdYyL86EuzA346i0Io93nV7bCcWs+xyMfIXXV1hHzqvQWDYz2rVcNbh7z8KN6ANbsGoS4KjYOQHNA7RRsXve1x7WhX3i35UwmrHPNkOl8vJVuGDj7ryIzZw6rTBBNnAKhZJPTM2AW9juViIZ5+rx2ZCmFo9OVMYEt9J+V/bwv65nTVv1f6RWTjZ96AvkIYgM2qarvYeQzTERl9WUiezevlQWOUaJev9qfFbAvswK1GSBUrGoypwir0TRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QJbbniqy4o/nUsfaYSkX7jG2kuRLpEY1s/VPB2Cr1Yk=; b=lC/dFYmw1nKKokRg+0zsILzSWadpFPT4pRCghz0SdxHglgMqOqFMAQgXwVCAe7pLfErtkFYlhLvGfKPUR70XmRSvFlxiXsOafkHCFcmmrc1Hd3aNokaTs3TihY+LtfnAVlhPGmbpP5BLTG7UYuKCjiSRIyLqRssBHTv+eO6oKvAXQRg1Nc/LT0koLX4U1IYb94uNStenJGKnmBC0c78hA2CxejRd1OA55J9qzKC/mmacD8zx6qwTX5+N7lrjQtR30gULiUmzSpGC2ejkmvTLSVlthxcnBnqKxzTqY6MjJWEanc6s21RS9lYi9Dq/Bw0BjvNAM8mzuuOOv9DhI0mb0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:35 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:35 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 69/72] multipath tests: Makefile: fix "clean" target Thread-Index: AQHVgUQRf+mc7Ilui0GOsPSLuetprA== Date: Sat, 12 Oct 2019 21:29:03 +0000 Message-ID: <20191012212703.12989-70-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ecb5611b-d859-417f-9ad8-08d74f5b3447 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:296; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hE444oIbXNidqZTdwj8FSBSzdLYF6LgsITESsKuiYOJpJO/zI4lpw97fBNForRGz9wDZWnxy59FO5YQrygOoOohTNZFS6NUGVJ5+yhKmEFatYtWbICFVFA4mPhOKZXG0EaxV4RmNvZ1PtUsXnypMSmkQ6IkiCPv4vM84yssb4OkT6aLnhSp/wDOZJ/hLN4QjSh245P+KNSkrh6XRDAlVZdpzhh91bGQdhnBx0/6FxCWnIQfr5nWpQiVpwicNn1xl8py7OuktGCwlO1em3NZwXe7foE+RjaeK6OcAe/aG8OsZXYWaCcj2lg9hZgN+Gh3C8ugE+Eh3ZMw33t4cx/iYqJ1r/bMJRUqaDIN9h218PTDLnswXg2X4dM1q0goeRIj6DQS25JR0jHSxstR035XduzjeEmY9uL1KgvY3AfyO2sQ= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ecb5611b-d859-417f-9ad8-08d74f5b3447 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:29:03.6509 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gkkx/5gNKtg6clzKfjcKSwsEPvf/YkTdp+rMByMkdoRWVR9pzRgK4cllH4gdrY2YrPDAPOfmQD+PUMzbk47MDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sat, 12 Oct 2019 21:30:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sat, 12 Oct 2019 21:30:50 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUpVX006839 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 69/72] multipath tests: Makefile: fix "clean" target 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.41]); Sat, 12 Oct 2019 21:35:59 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- tests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index 60338f14..c70b8399 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -42,7 +42,7 @@ lib/libchecktur.so: OBJS = $(TESTS:%=%.o) test-lib.o clean: dep_clean - $(RM) $(TESTS:%=%-test) $(TESTS:%=%.out) $(OBJS) + $(RM) $(TESTS:%=%-test) $(TESTS:%=%.out) $(OBJS) *.o.wrap $(RM) -rf lib .SECONDARY: $(OBJS) From patchwork Sat Oct 12 21:29:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187071 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 3EB4C1709 for ; Sat, 12 Oct 2019 21:33:11 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1BBE32089C for ; Sat, 12 Oct 2019 21:33:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1BBE32089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 536AC883850; Sat, 12 Oct 2019 21:33:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D57E6017E; Sat, 12 Oct 2019 21:33:10 +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 EA6301803517; Sat, 12 Oct 2019 21:33:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.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 x9CLUwwT006886 for ; Sat, 12 Oct 2019 17:30:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6FCBE10016EB; Sat, 12 Oct 2019 21:30:58 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D6C5510013D9; Sat, 12 Oct 2019 21:30:55 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A35DE30BBE88; Sat, 12 Oct 2019 21:30:53 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:30:15 +0000 Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:40 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.124.72.12) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B0Js+yE7Qx2Wi1KuVaV9LqEK87hHrkH+a6yAurk3g56Ym96YzF8BoVIs4fgPW8T/SwpCr+NuXJCFMjPCNZ1jyLlLQJCd0gLsCHW2HgguQLGw6xTMTkbJqyBkC7l9qcIpv+PregXOR55yOGEmFFOllZ65w8JFCW+2vsI0ypnyeqm5aH7WvE/Tk4bx1SqJdRigg4CYLYhc/6EFT6mDEzqtqOCtuf50Wdk73N+OVE4sYV5Ib3lvyUkiAlAdgUQaswmshOn3APaHfm10sCGT0OsdRkRcNRCsMY0pJooJPvZfZO5bVn2YZwaXXIMXEMvKf1DoeMrI73Nj9ve9jnWUabFtew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KdlVaK3eWcuuRvKbZxWDnJEq6mN/6l4hVhgcANi/sxw=; b=Fej1IjUgf3DQM5cBWviK+ZCxj9zHK03n4KNa5G8rEgOvj29/0+bgS3gvfT922cKRINIe+teCTjKug0WhQwO/YtaLmjCrRiTrlwLYayB+bm88l+3/2ZRDO0YLnmJtrW0c4pz6NjCgoKyExVg/rHx5Z9hsZ6HD8FfV2I9IDvRmnvBdPe95y5FUPsVKT6WlyVtE/t4MWCsS2UGV+3TuhW3tQaBDZw43As/eak+hvYkBj9dyZ46szbsGHCKs8NynxdSaKdQ/xZn4dpUMUuulSt15UMk0HixZdrim+Owc70tYLYetMkE0ozJ6JfQnCmwyL6pAmPXkDY9812Kerh1Qfd+NDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:36 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:36 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 70/72] multipath tests: Makefile: avoid gcc 4.8 missing initializers failure Thread-Index: AQHVgUQSZdY5u0U9D0K+yC1ayXyCZQ== Date: Sat, 12 Oct 2019 21:29:04 +0000 Message-ID: <20191012212703.12989-71-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1e0099c5-947a-4130-0ff9-08d74f5b3508 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:224; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hskX2bhz6++DVO/R0P70r03QhkFnTeciA2Fjywp9opqHR/HYu/2Ph/WIEj6um+fFy2dzT/2zmlGAi4zAEaKwZycIb7HcV6jEba5R0vtCe8oXkgvEJwlV+d38p7dQFCRYibi52ieYFrYfNV7CH0vIJM9M/XeCBCVSLETgnrqzztxDcUl3jyD35yQpwHIKvPeEIb4uaqtS2cPkpU8Psd43tt7QzZXpuVdZZvtyoF3rfKtGKQKREl6Azlz62SAZ0K6jv7tFSGhWyzjcEYc/iv6VRJws1eXrfSERKCT8GA0w938d4MpmLJP9/u1mhIJdiywrNbIoGWzTTO+fp9+8OX8K6XDeL9AFaE5bQ4NgYnGAsy7fHl+1gHtqLPkGJvMIU2r3f1/YLlCOpuR1cN+anwvuVZBrXjVf9ajJauORU1WdMCI= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 1e0099c5-947a-4130-0ff9-08d74f5b3508 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:29:04.8152 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: MLMopK1s85g6UM3ZZt4UjKLNTBoWMkJ5VSk2Jwq8VG+H/+IXoaXfI4a4ShUq/AO8r448IOLI5SVTOeNnCuLQJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:30:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 12 Oct 2019 21:30:54 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUwwT006886 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 70/72] multipath tests: Makefile: avoid gcc 4.8 missing initializers failure 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Sat, 12 Oct 2019 21:33:10 +0000 (UTC) From: Martin Wilck With -Wmissing-field-initializers (implied by our current compiler flags), gcc 4.8 errors out if nested initializers are missing: struct A { int a, b; }; struct B { struct A a; int c; } b = { .a.a = 1; } Later gcc versions and clang accept it just fine. Add a test to tests/Makefile and use -Wno-missing-initializers if gcc 4.8 behavior is detected. Signed-off-by: Martin Wilck --- tests/Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index c70b8399..c9406e75 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,6 +1,15 @@ include ../Makefile.inc -CFLAGS += $(BIN_CFLAGS) -I$(multipathdir) -I$(mpathcmddir) -Wno-unused-parameter +# Test special behavior of gcc 4.8 with nested initializers +# gcc 4.8 compiles blacklist.c only with -Wno-missing-field-initializers +TEST_MISSING_INITIALIZERS = $(shell \ + echo 'struct A {int a, b;}; struct B {struct A a; int b;} b = {.a.a=1};' | \ + $(CC) -c -Werror -Wmissing-field-initializers -o /dev/null -xc - >/dev/null 2>&1 \ + || echo -Wno-missing-field-initializers) +W_MISSING_INITIALIZERS := $(call TEST_MISSING_INITIALIZERS) + +CFLAGS += $(BIN_CFLAGS) -I$(multipathdir) -I$(mpathcmddir) \ + -Wno-unused-parameter $(W_MISSING_INITIALIZERS) LIBDEPS += -L$(multipathdir) -lmultipath -lcmocka TESTS := uevent parser util dmevents hwtable blacklist unaligned vpd pgpolicy alias From patchwork Sat Oct 12 21:29:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187111 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 63292112B for ; Sat, 12 Oct 2019 21:36:05 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4108820700 for ; Sat, 12 Oct 2019 21:36:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4108820700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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 6FCCC10DCCA9; Sat, 12 Oct 2019 21:36:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4386D60BFB; Sat, 12 Oct 2019 21:36:04 +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 0E6261803518; Sat, 12 Oct 2019 21:36:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.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 x9CLUxO7006896 for ; Sat, 12 Oct 2019 17:30:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9B3D310016EB; Sat, 12 Oct 2019 21:30:59 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx30.extmail.prod.ext.phx2.redhat.com [10.5.110.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8DDA910013D9; Sat, 12 Oct 2019 21:30:59 +0000 (UTC) Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3454020FF; Sat, 12 Oct 2019 21:30:58 +0000 (UTC) Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:30:19 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:41 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.14) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EhAHxQZN5Pu88OdclAbt+gCGH8BLlejJabuZgGM3QYO02noRONWp8GzTYmBGy0wAcTL980ZrUcFa0xxI3aOH5Oay6NcVgzOI/9Nv1dUXmPtzC2ZmggKZmQOT9dzFQpNJQ3l0PlgA8hv7/PpgU4ynlVMDMx2zRj+g0S0T59UZGFvkVuaXgsV6EZa8r8vkbjo19rU+aSuFlIyCMecafaLud/SbOxGa/Rw6maaDToDFPL8lGy5SzH5uEEjgTvUaf07SFTxrO+Ej9bnQltFyru5QI7L/N6wr30m/idlAeAeJNvFmmS3SMgrbe42HuQdTWzMmAL8OI4bnWAhcsuXS6cmBgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V20jRtZgbUnOh6SC8o5cN0of/MxBTFtJsCaySxtgwLM=; b=LELjiAhw5EwnRTXwUCVywqoLd/CygjOKR6ek2Va1gqa7tTwxkRq7Ss/Eb43yqYSFdW0c6INCKpTK53ys7DMd7OV/486EApsxPlxYudN7mw7vepSu0IHgdSjgOYQfgOrlB1vAyFgi8CSe9dWFCvWZCx5LLDGaQuFPKqp8G8XbixkLglx3fuxBCOyJrovukoEQNvn2aS7ySMNk/ELu2bC1qvwoNnYKdJgVVliI5MNjG6xFaHsfliEAT4OUjTmbUtrcQVFCdXgzkNW/ekPwVNTyteigxUlXj2+dVZLhiImFpEOX2lU1ECLHFOUOC6BkfL3MlutJ57RUYx3Th7ni1deX2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:36 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:36 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 71/72] multipath-tools: Makefile.inc: enable -Werror Thread-Index: AQHVgUQTwdrZptoPV0OIgAhExPQLTQ== Date: Sat, 12 Oct 2019 21:29:06 +0000 Message-ID: <20191012212703.12989-72-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3cc42597-8cfe-452b-33c1-08d74f5b35b8 x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:215; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mvrJyvOION4M9RPlv0bAjsV+qkaff+RAHzpCF7sR+OArFbxXfSqsS/YhyERsYUnd/IINPNl7COSe1hnzEYFV/Dr9bMGKWlcviGEgzx7Loi0CruWk2tjdzNQDaJwC4nLN5gHeJu6LhKg5QIPRUyV94ewmkm9aS6Zh8DVKc5GJnf5XLbawePp0xeDBi74MnNCbsFWtfnNQFQxZr3IufRW1F43jssJ1x3KosVsQ6CmXIRFI4KJLZR4x3rnrwvOXLuFg//myoBhii6dk9HRR1KwGXaRr0Insbx+X4Vh4l103LgVcz2IzwNC5xT/00Jam53GHp6V9dX08eY8ZLWgGj944dOOQQqbSsLO69f91+4VUBEktWFzQtaG/4NoFdOEKxZsRHRm8I6lIUKwg2xr4bGI29bXKuZske7Qc/JuSrDpAdk0= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 3cc42597-8cfe-452b-33c1-08d74f5b35b8 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:29:06.5402 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rWRuc3PqS/9EZcPY4pqCgBIutZSkmHYJz3R6cq8XGMatsOJDI+Rm+7b3JmCZ5KGcUe8zMA2+hR1+iKLB9uXO2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Sat, 12 Oct 2019 21:30:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Sat, 12 Oct 2019 21:30:58 +0000 (UTC) for IP:'15.124.64.68' DOMAIN:'m9a0003g.houston.softwaregrp.com' HELO:'m9a0003g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.68 m9a0003g.houston.softwaregrp.com 15.124.64.68 m9a0003g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.71 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUxO7006896 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 71/72] multipath-tools: Makefile.inc: enable -Werror 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.6.2 (mx1.redhat.com [10.5.110.64]); Sat, 12 Oct 2019 21:36:04 +0000 (UTC) From: Martin Wilck Signed-off-by: Martin Wilck --- Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc index f309a274..59a36cd3 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -92,7 +92,7 @@ TEST_CC_OPTION = $(shell \ STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector) ERROR_DISCARDED_QUALIFIERS := $(call TEST_CC_OPTION,-Werror=discarded-qualifiers,) -OPTFLAGS = -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \ +OPTFLAGS = -O2 -g -pipe -Werror -Wall -Wextra -Wformat=2 -Werror=implicit-int \ -Werror=implicit-function-declaration -Werror=format-security \ -Wno-clobbered \ -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ From patchwork Sat Oct 12 21:29:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11187107 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 30392112B for ; Sat, 12 Oct 2019 21:35:44 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D57820700 for ; Sat, 12 Oct 2019 21:35:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D57820700 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 50BD63091740; Sat, 12 Oct 2019 21:35:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 292B810016EB; Sat, 12 Oct 2019 21:35:43 +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 E8B2E1803518; Sat, 12 Oct 2019 21:35:42 +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 x9CLUtEd006871 for ; Sat, 12 Oct 2019 17:30:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4C33A60BF4; Sat, 12 Oct 2019 21:30:55 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 406AC60BF1; Sat, 12 Oct 2019 21:30:55 +0000 (UTC) Received: from m9a0001g.houston.softwaregrp.com (m9a0001g.houston.softwaregrp.com [15.124.64.66]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 68C7EC08E2B0; Sat, 12 Oct 2019 21:30:53 +0000 (UTC) Received: FROM m9a0001g.houston.softwaregrp.com (15.121.0.190) BY m9a0001g.houston.softwaregrp.com WITH ESMTP; Sat, 12 Oct 2019 21:30:09 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 12 Oct 2019 21:29:41 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (15.124.8.14) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Sat, 12 Oct 2019 21:29:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AitRiiEpBK8WbsmOJcHlAllw8iSniiilQcxnwGkco7ayqyljMrSTh+YyoY+SuVOEkFadVaOYRvjCmJRD6vYjyOHLUeTcSO1uEBENsq0zm8YnXY14Qw3NK/rxuwFygRsv0E33uZSUSpm2cdXZTX8vDbe2qdwb8Avqlaj1xc5Do5kpHRyVHFXztw+P6WF5K3hqeQoHEMcjJd7AYClcxAxLcenC8L+ZM4VFWW40faonUKe5ejUuw0W2fmTHBrNtojfgPqtdt31W5rM6HBobexmabbpm8LikSk3M8lwJ7YIlKaJsCQWAoMHMX3QEK8Aonk6+fqXK/7I4o2DZo/kIDVnzpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nVOG1NdvQtDogdxN9SYOxB+eDFlG+1hX78AEJwJITGk=; b=azd1DYBlurm64L/UfOpMfS60wt4aM/Hh9+zeaq0p4iiYqQ0O9z6O8vPg5pV8xGhzrzKpnnn1rLkUMUnbzSt4ioW8RBkpt9lGF5V+LbYtmrBOdPdyqp+CiZKCBpPLA8qp+md87U4OzTqmhzSlM0A4ICRrvGCpc9AoWLFpTpKLIVmqwxhcvt62jIYy+iXFJnrOrWa/Yrq4br2LtR33qjn/CYJZe/l/4I02KZzJlStJdLdaAAroS6G9M8O41kwgKUzmy8MzaZE2JnGP8h65K5ud42VubLeG0QRJMwxX7o1cDQdoxbRJMb+nMyBY4Ky/uxBZyRTSTQFzHHQyXToNx3vHTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from CH2PR18MB3349.namprd18.prod.outlook.com (52.132.245.83) by CH2PR18MB3317.namprd18.prod.outlook.com (52.132.245.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Sat, 12 Oct 2019 21:29:36 +0000 Received: from CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985]) by CH2PR18MB3349.namprd18.prod.outlook.com ([fe80::1075:2453:9278:e985%5]) with mapi id 15.20.2347.021; Sat, 12 Oct 2019 21:29:36 +0000 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Thread-Topic: [PATCH 72/72] multipath-tools: Makefile.inc: test for -Wno-clobbered support Thread-Index: AQHVgUQUVITbEeq6XUCzXREs5jQlzA== Date: Sat, 12 Oct 2019 21:29:07 +0000 Message-ID: <20191012212703.12989-73-martin.wilck@suse.com> References: <20191012212703.12989-1-martin.wilck@suse.com> In-Reply-To: <20191012212703.12989-1-martin.wilck@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR02CA0045.eurprd02.prod.outlook.com (2603:10a6:208:d2::22) To CH2PR18MB3349.namprd18.prod.outlook.com (2603:10b6:610:28::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Martin.Wilck@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2.203.223.119] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 91f738ef-3c66-4723-6b9e-08d74f5b36bf x-ms-traffictypediagnostic: CH2PR18MB3317: x-ld-processed: 856b813c-16e5-49a5-85ec-6f081e13b527,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:233; x-forefront-prvs: 0188D66E61 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(189003)(199004)(446003)(6512007)(11346002)(4326008)(8676002)(476003)(6666004)(81156014)(71200400001)(71190400001)(99286004)(14454004)(8936002)(66066001)(107886003)(2616005)(486006)(81166006)(54906003)(256004)(14444005)(86362001)(110136005)(44832011)(50226002)(25786009)(316002)(6436002)(478600001)(26005)(102836004)(386003)(6506007)(5660300002)(1076003)(52116002)(305945005)(36756003)(2906002)(6116002)(76176011)(4744005)(66446008)(6486002)(7736002)(66946007)(64756008)(66556008)(186003)(66476007)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CH2PR18MB3317; H:CH2PR18MB3349.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZfpHvVRqSaHsLiOig2hWcEKBs1TRki0W2p+Zgl4kAqFrqQ46/QBmv3bpJ2nCsoRixtvrIlifryhRbOO9gtQIT7MSLANXpAZG8/2HYfS7PXtxnDSz9WBzSUBf4ysaQ1mC7u8t6RCSb59K1uzqH5jMAvPoxJ8yLqrCT88QGdfNRnm0lHdIO+/M5JCR1uoSsK1r0vjppZTnrLr6gNuTm0jaGjQ0mSAre+hZBeRrBQ1Up6r/Sf0cPFXZ7VEg2IILEQVKQ3iN+omu9T29cWl7VyZ6ZpDs1yYnxQ2w1sbWMnufohNGzuUzzaF3zHHOI36XgWd98T7pbc7jT0Av6wdKVsvZJCk6m41Qqag10xV2g48Jfa6q/RdgiQ2l10XaGe5IVWLVBRiDbMaFgI4mqYJtXWVRDDmnHbLYsmjiArNsdJGv4+I= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 91f738ef-3c66-4723-6b9e-08d74f5b36bf X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2019 21:29:07.7895 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: P7kDDa57TaS7yPdoxKdZL9O3TCzZCryzVlJfqtghEfhi7CHpDx+rjgiJtTOhcpkIDyYwD/mEoU8QYtzcEKBbHA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR18MB3317 X-OriginatorOrg: suse.com X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:30:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 12 Oct 2019 21:30:54 +0000 (UTC) for IP:'15.124.64.66' DOMAIN:'m9a0001g.houston.softwaregrp.com' HELO:'m9a0001g.houston.softwaregrp.com' FROM:'Martin.Wilck@suse.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY) 15.124.64.66 m9a0001g.houston.softwaregrp.com 15.124.64.66 m9a0001g.houston.softwaregrp.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x9CLUtEd006871 X-loop: dm-devel@redhat.com Cc: "dm-devel@redhat.com" , Martin Wilck Subject: [dm-devel] [PATCH 72/72] multipath-tools: Makefile.inc: test for -Wno-clobbered support 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 12 Oct 2019 21:35:43 +0000 (UTC) From: Martin Wilck clang doesn't support this option. Signed-off-by: Martin Wilck --- Makefile.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc index 59a36cd3..d4d1e0dd 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -91,10 +91,11 @@ TEST_CC_OPTION = $(shell \ STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector) ERROR_DISCARDED_QUALIFIERS := $(call TEST_CC_OPTION,-Werror=discarded-qualifiers,) +WNOCLOBBERED := $(call TEST_CC_OPTION,-Wno-clobbered,) OPTFLAGS = -O2 -g -pipe -Werror -Wall -Wextra -Wformat=2 -Werror=implicit-int \ -Werror=implicit-function-declaration -Werror=format-security \ - -Wno-clobbered \ + $(WNOCLOBBERED) \ -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ $(STACKPROT) --param=ssp-buffer-size=4 CPPFLAGS := -Wp,-D_FORTIFY_SOURCE=2