diff options
31 files changed, 261 insertions, 3904 deletions
diff --git a/meta-oe/recipes-support/multipath-tools/files/0001-multipath-tools-add-RDAC-SUN-ArrayStorage-to-hwtable.patch b/meta-oe/recipes-support/multipath-tools/files/0001-multipath-tools-add-RDAC-SUN-ArrayStorage-to-hwtable.patch deleted file mode 100644 index 1d983e978f..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0001-multipath-tools-add-RDAC-SUN-ArrayStorage-to-hwtable.patch +++ /dev/null | |||
| @@ -1,42 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 3 | Date: Wed, 11 Apr 2018 15:14:13 +0200 | ||
| 4 | Subject: [PATCH] multipath-tools: add RDAC SUN/ArrayStorage to hwtable | ||
| 5 | |||
| 6 | Already in scsi_dh: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/scsi/scsi_dh.c#n70 | ||
| 7 | |||
| 8 | Cc: NetApp RDAC team <ng-eseries-upstream-maintainers@netapp.com> | ||
| 9 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
| 10 | Cc: DM ML <dm-devel@redhat.com> | ||
| 11 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 12 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 13 | --- | ||
| 14 | libmultipath/hwtable.c | 12 ++++++++++++ | ||
| 15 | 1 file changed, 12 insertions(+) | ||
| 16 | |||
| 17 | diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c | ||
| 18 | index 88b4700..827e899 100644 | ||
| 19 | --- a/libmultipath/hwtable.c | ||
| 20 | +++ b/libmultipath/hwtable.c | ||
| 21 | @@ -890,6 +890,18 @@ static struct hwentry default_hw[] = { | ||
| 22 | .no_path_retry = 30, | ||
| 23 | }, | ||
| 24 | { | ||
| 25 | + .vendor = "SUN", | ||
| 26 | + .product = "ArrayStorage", | ||
| 27 | + .bl_product = "Universal Xport", | ||
| 28 | + .pgpolicy = GROUP_BY_PRIO, | ||
| 29 | + .checker_name = RDAC, | ||
| 30 | + .features = "2 pg_init_retries 50", | ||
| 31 | + .hwhandler = "1 rdac", | ||
| 32 | + .prio_name = PRIO_RDAC, | ||
| 33 | + .pgfailback = -FAILBACK_IMMEDIATE, | ||
| 34 | + .no_path_retry = 30, | ||
| 35 | + }, | ||
| 36 | + { | ||
| 37 | /* ZFS Storage Appliances */ | ||
| 38 | .vendor = "SUN", | ||
| 39 | .product = "(Sun Storage|ZFS Storage|COMSTAR)", | ||
| 40 | -- | ||
| 41 | 2.7.4 | ||
| 42 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0002-multipath-tools-remove-c-from-__cpluscplus-misspelle.patch b/meta-oe/recipes-support/multipath-tools/files/0002-multipath-tools-remove-c-from-__cpluscplus-misspelle.patch deleted file mode 100644 index 73f000aca2..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0002-multipath-tools-remove-c-from-__cpluscplus-misspelle.patch +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 3 | Date: Tue, 24 Apr 2018 15:03:40 +0200 | ||
| 4 | Subject: [PATCH] multipath-tools: remove "c" from __cpluscplus, misspelled | ||
| 5 | |||
| 6 | found by cppcheck(http://cppcheck.sf.net/): | ||
| 7 | [libmpathcmd/mpath_cmd.h:24]: (error) Invalid number of character '{' when these macros are defined: '__cpluscplus'. | ||
| 8 | |||
| 9 | Cc: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 10 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
| 11 | Cc: DM ML <dm-devel@redhat.com> | ||
| 12 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 13 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 14 | --- | ||
| 15 | libmpathcmd/mpath_cmd.h | 2 +- | ||
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/libmpathcmd/mpath_cmd.h b/libmpathcmd/mpath_cmd.h | ||
| 19 | index aaa8da9..df9d938 100644 | ||
| 20 | --- a/libmpathcmd/mpath_cmd.h | ||
| 21 | +++ b/libmpathcmd/mpath_cmd.h | ||
| 22 | @@ -20,7 +20,7 @@ | ||
| 23 | #ifndef LIB_MPATH_CMD_H | ||
| 24 | #define LIB_MPATH_CMD_H | ||
| 25 | |||
| 26 | -#ifdef __cpluscplus | ||
| 27 | +#ifdef __cplusplus | ||
| 28 | extern "C" { | ||
| 29 | #endif | ||
| 30 | |||
| 31 | -- | ||
| 32 | 2.7.4 | ||
| 33 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0003-multipath-tools-remove-emacs-autoconfig-of-kpartx-gp.patch b/meta-oe/recipes-support/multipath-tools/files/0003-multipath-tools-remove-emacs-autoconfig-of-kpartx-gp.patch deleted file mode 100644 index 7358e1ae97..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0003-multipath-tools-remove-emacs-autoconfig-of-kpartx-gp.patch +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 3 | Date: Thu, 12 Apr 2018 18:17:13 +0200 | ||
| 4 | Subject: [PATCH] multipath-tools: remove emacs autoconfig of kpartx/gpt.h | ||
| 5 | |||
| 6 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
| 7 | Cc: DM ML <dm-devel@redhat.com> | ||
| 8 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 9 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 10 | --- | ||
| 11 | kpartx/gpt.h | 19 ------------------- | ||
| 12 | 1 file changed, 19 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/kpartx/gpt.h b/kpartx/gpt.h | ||
| 15 | index 66ce8f1..7bb54b7 100644 | ||
| 16 | --- a/kpartx/gpt.h | ||
| 17 | +++ b/kpartx/gpt.h | ||
| 18 | @@ -109,22 +109,3 @@ int read_gpt_pt (int fd, struct slice all, struct slice *sp, int ns); | ||
| 19 | |||
| 20 | |||
| 21 | #endif | ||
| 22 | - | ||
| 23 | -/* | ||
| 24 | - * Overrides for Emacs so that we follow Linus's tabbing style. | ||
| 25 | - * Emacs will notice this stuff at the end of the file and automatically | ||
| 26 | - * adjust the settings for this buffer only. This must remain at the end | ||
| 27 | - * of the file. | ||
| 28 | - * --------------------------------------------------------------------------- | ||
| 29 | - * Local variables: | ||
| 30 | - * c-indent-level: 4 | ||
| 31 | - * c-brace-imaginary-offset: 0 | ||
| 32 | - * c-brace-offset: -4 | ||
| 33 | - * c-argdecl-indent: 4 | ||
| 34 | - * c-label-offset: -4 | ||
| 35 | - * c-continued-statement-offset: 4 | ||
| 36 | - * c-continued-brace-offset: 0 | ||
| 37 | - * indent-tabs-mode: nil | ||
| 38 | - * tab-width: 8 | ||
| 39 | - * End: | ||
| 40 | - */ | ||
| 41 | -- | ||
| 42 | 2.7.4 | ||
| 43 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0004-multipath-tools-replace-FSF-address-with-a-www-point.patch b/meta-oe/recipes-support/multipath-tools/files/0004-multipath-tools-replace-FSF-address-with-a-www-point.patch deleted file mode 100644 index 13f18b5761..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0004-multipath-tools-replace-FSF-address-with-a-www-point.patch +++ /dev/null | |||
| @@ -1,191 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 3 | Date: Fri, 11 May 2018 15:42:43 +0200 | ||
| 4 | Subject: [PATCH] multipath-tools: replace FSF address with a www pointer | ||
| 5 | |||
| 6 | Less prone to future modifications, new FSF licences | ||
| 7 | point exactly to this url: <http://www.gnu.org/licenses/>. | ||
| 8 | And sending a smail to FSF is outdated. | ||
| 9 | |||
| 10 | First clean up was done in 5619a39c433ac3d10a88079593cec1aa6472cbeb | ||
| 11 | |||
| 12 | Cc: Martin Wilck <mwilck@suse.com> | ||
| 13 | Cc: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 14 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
| 15 | Cc: DM ML <dm-devel@redhat.com> | ||
| 16 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 17 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 18 | --- | ||
| 19 | libmultipath/dm-generic.c | 4 +--- | ||
| 20 | libmultipath/dm-generic.h | 4 +--- | ||
| 21 | libmultipath/foreign.c | 4 +--- | ||
| 22 | libmultipath/foreign.h | 4 +--- | ||
| 23 | libmultipath/foreign/nvme.c | 4 +--- | ||
| 24 | libmultipath/generic.c | 4 +--- | ||
| 25 | libmultipath/generic.h | 4 +--- | ||
| 26 | tests/dmevents.c | 2 +- | ||
| 27 | tests/parser.c | 2 +- | ||
| 28 | tests/uevent.c | 2 +- | ||
| 29 | tests/util.c | 2 +- | ||
| 30 | 11 files changed, 11 insertions(+), 25 deletions(-) | ||
| 31 | |||
| 32 | diff --git a/libmultipath/dm-generic.c b/libmultipath/dm-generic.c | ||
| 33 | index bdc9ca0..d752991 100644 | ||
| 34 | --- a/libmultipath/dm-generic.c | ||
| 35 | +++ b/libmultipath/dm-generic.c | ||
| 36 | @@ -12,9 +12,7 @@ | ||
| 37 | GNU General Public License for more details. | ||
| 38 | |||
| 39 | You should have received a copy of the GNU General Public License | ||
| 40 | - along with this program; if not, write to the Free Software | ||
| 41 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
| 42 | - USA. | ||
| 43 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 44 | */ | ||
| 45 | |||
| 46 | #include <stdint.h> | ||
| 47 | diff --git a/libmultipath/dm-generic.h b/libmultipath/dm-generic.h | ||
| 48 | index 5d59724..986429f 100644 | ||
| 49 | --- a/libmultipath/dm-generic.h | ||
| 50 | +++ b/libmultipath/dm-generic.h | ||
| 51 | @@ -12,9 +12,7 @@ | ||
| 52 | GNU General Public License for more details. | ||
| 53 | |||
| 54 | You should have received a copy of the GNU General Public License | ||
| 55 | - along with this program; if not, write to the Free Software | ||
| 56 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
| 57 | - USA. | ||
| 58 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 59 | */ | ||
| 60 | #ifndef _DM_GENERIC_H | ||
| 61 | #define _DM_GENERIC_H | ||
| 62 | diff --git a/libmultipath/foreign.c b/libmultipath/foreign.c | ||
| 63 | index 7217184..80b399b 100644 | ||
| 64 | --- a/libmultipath/foreign.c | ||
| 65 | +++ b/libmultipath/foreign.c | ||
| 66 | @@ -12,9 +12,7 @@ | ||
| 67 | GNU General Public License for more details. | ||
| 68 | |||
| 69 | You should have received a copy of the GNU General Public License | ||
| 70 | - along with this program; if not, write to the Free Software | ||
| 71 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
| 72 | - USA. | ||
| 73 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 74 | */ | ||
| 75 | |||
| 76 | #include <sys/sysmacros.h> | ||
| 77 | diff --git a/libmultipath/foreign.h b/libmultipath/foreign.h | ||
| 78 | index 973f368..697f12f 100644 | ||
| 79 | --- a/libmultipath/foreign.h | ||
| 80 | +++ b/libmultipath/foreign.h | ||
| 81 | @@ -12,9 +12,7 @@ | ||
| 82 | GNU General Public License for more details. | ||
| 83 | |||
| 84 | You should have received a copy of the GNU General Public License | ||
| 85 | - along with this program; if not, write to the Free Software | ||
| 86 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
| 87 | - USA. | ||
| 88 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 89 | */ | ||
| 90 | #ifndef _FOREIGN_H | ||
| 91 | #define _FOREIGN_H | ||
| 92 | diff --git a/libmultipath/foreign/nvme.c b/libmultipath/foreign/nvme.c | ||
| 93 | index 235f75d..280b6bd 100644 | ||
| 94 | --- a/libmultipath/foreign/nvme.c | ||
| 95 | +++ b/libmultipath/foreign/nvme.c | ||
| 96 | @@ -12,9 +12,7 @@ | ||
| 97 | GNU General Public License for more details. | ||
| 98 | |||
| 99 | You should have received a copy of the GNU General Public License | ||
| 100 | - along with this program; if not, write to the Free Software | ||
| 101 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
| 102 | - USA. | ||
| 103 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 104 | */ | ||
| 105 | |||
| 106 | #include <sys/sysmacros.h> | ||
| 107 | diff --git a/libmultipath/generic.c b/libmultipath/generic.c | ||
| 108 | index 6f7a2cd..0d1e632 100644 | ||
| 109 | --- a/libmultipath/generic.c | ||
| 110 | +++ b/libmultipath/generic.c | ||
| 111 | @@ -12,9 +12,7 @@ | ||
| 112 | GNU General Public License for more details. | ||
| 113 | |||
| 114 | You should have received a copy of the GNU General Public License | ||
| 115 | - along with this program; if not, write to the Free Software | ||
| 116 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
| 117 | - USA. | ||
| 118 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 119 | */ | ||
| 120 | |||
| 121 | |||
| 122 | diff --git a/libmultipath/generic.h b/libmultipath/generic.h | ||
| 123 | index 7f7fe66..6346ffe 100644 | ||
| 124 | --- a/libmultipath/generic.h | ||
| 125 | +++ b/libmultipath/generic.h | ||
| 126 | @@ -12,9 +12,7 @@ | ||
| 127 | GNU General Public License for more details. | ||
| 128 | |||
| 129 | You should have received a copy of the GNU General Public License | ||
| 130 | - along with this program; if not, write to the Free Software | ||
| 131 | - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
| 132 | - USA. | ||
| 133 | + along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 134 | */ | ||
| 135 | #ifndef _GENERIC_H | ||
| 136 | #define _GENERIC_H | ||
| 137 | diff --git a/tests/dmevents.c b/tests/dmevents.c | ||
| 138 | index bba51dc..3399c81 100644 | ||
| 139 | --- a/tests/dmevents.c | ||
| 140 | +++ b/tests/dmevents.c | ||
| 141 | @@ -12,7 +12,7 @@ | ||
| 142 | * GNU General Public License for more details. | ||
| 143 | * | ||
| 144 | * You should have received a copy of the GNU General Public License | ||
| 145 | - * along with this program; if not, write to the Free Software | ||
| 146 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 147 | * | ||
| 148 | */ | ||
| 149 | |||
| 150 | diff --git a/tests/parser.c b/tests/parser.c | ||
| 151 | index a7e7598..29859da 100644 | ||
| 152 | --- a/tests/parser.c | ||
| 153 | +++ b/tests/parser.c | ||
| 154 | @@ -12,7 +12,7 @@ | ||
| 155 | * GNU General Public License for more details. | ||
| 156 | * | ||
| 157 | * You should have received a copy of the GNU General Public License | ||
| 158 | - * along with this program; if not, write to the Free Software | ||
| 159 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 160 | * | ||
| 161 | */ | ||
| 162 | |||
| 163 | diff --git a/tests/uevent.c b/tests/uevent.c | ||
| 164 | index acfcb14..b0d0bfd 100644 | ||
| 165 | --- a/tests/uevent.c | ||
| 166 | +++ b/tests/uevent.c | ||
| 167 | @@ -12,7 +12,7 @@ | ||
| 168 | * GNU General Public License for more details. | ||
| 169 | * | ||
| 170 | * You should have received a copy of the GNU General Public License | ||
| 171 | - * along with this program; if not, write to the Free Software | ||
| 172 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 173 | * | ||
| 174 | */ | ||
| 175 | |||
| 176 | diff --git a/tests/util.c b/tests/util.c | ||
| 177 | index 113b134..839effd 100644 | ||
| 178 | --- a/tests/util.c | ||
| 179 | +++ b/tests/util.c | ||
| 180 | @@ -12,7 +12,7 @@ | ||
| 181 | * GNU General Public License for more details. | ||
| 182 | * | ||
| 183 | * You should have received a copy of the GNU General Public License | ||
| 184 | - * along with this program; if not, write to the Free Software | ||
| 185 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| 186 | * | ||
| 187 | */ | ||
| 188 | |||
| 189 | -- | ||
| 190 | 2.7.4 | ||
| 191 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0005-multipath-tools-Remove-trailing-leading-whitespaces-.patch b/meta-oe/recipes-support/multipath-tools/files/0005-multipath-tools-Remove-trailing-leading-whitespaces-.patch deleted file mode 100644 index 953e739efa..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0005-multipath-tools-Remove-trailing-leading-whitespaces-.patch +++ /dev/null | |||
| @@ -1,156 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 3 | Date: Fri, 11 May 2018 15:43:11 +0200 | ||
| 4 | Subject: [PATCH] multipath-tools: Remove trailing/leading whitespaces and | ||
| 5 | reformat code | ||
| 6 | |||
| 7 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
| 8 | Cc: device-mapper development <dm-devel@redhat.com> | ||
| 9 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 10 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 11 | --- | ||
| 12 | Makefile.inc | 23 +++++++++++------------ | ||
| 13 | kpartx/mac.h | 2 +- | ||
| 14 | kpartx/test-kpartx | 2 +- | ||
| 15 | libmpathcmd/Makefile | 2 +- | ||
| 16 | libmultipath/hwtable.c | 14 +++++++------- | ||
| 17 | libmultipath/print.h | 2 +- | ||
| 18 | multipathd/main.h | 6 +++--- | ||
| 19 | 7 files changed, 25 insertions(+), 26 deletions(-) | ||
| 20 | |||
| 21 | diff --git a/Makefile.inc b/Makefile.inc | ||
| 22 | index 57a1835..af2f5ba 100644 | ||
| 23 | --- a/Makefile.inc | ||
| 24 | +++ b/Makefile.inc | ||
| 25 | @@ -103,21 +103,20 @@ LDFLAGS = -Wl,-z,relro -Wl,-z,now | ||
| 26 | BIN_LDFLAGS = -pie | ||
| 27 | |||
| 28 | # Check whether a function with name $1 has been declared in header file $2. | ||
| 29 | -check_func = \ | ||
| 30 | - $(shell \ | ||
| 31 | +check_func = $(shell \ | ||
| 32 | if grep -Eq "^[^[:blank:]]+[[:blank:]]+$1[[:blank:]]*(.*)*" "$2"; then \ | ||
| 33 | - found=1; \ | ||
| 34 | - status="yes"; \ | ||
| 35 | - else \ | ||
| 36 | - found=0; \ | ||
| 37 | - status="no"; \ | ||
| 38 | - fi; \ | ||
| 39 | - echo 1>&2 "Checking for $1 in $2 ... $$status"; \ | ||
| 40 | - echo "$$found" \ | ||
| 41 | - ) | ||
| 42 | + found=1; \ | ||
| 43 | + status="yes"; \ | ||
| 44 | + else \ | ||
| 45 | + found=0; \ | ||
| 46 | + status="no"; \ | ||
| 47 | + fi; \ | ||
| 48 | + echo 1>&2 "Checking for $1 in $2 ... $$status"; \ | ||
| 49 | + echo "$$found" \ | ||
| 50 | + ) | ||
| 51 | |||
| 52 | # Checker whether a file with name $1 exists | ||
| 53 | -check_file = $(shell \ | ||
| 54 | +check_file = $(shell \ | ||
| 55 | if [ -f "$1" ]; then \ | ||
| 56 | found=1; \ | ||
| 57 | status="yes"; \ | ||
| 58 | diff --git a/kpartx/mac.h b/kpartx/mac.h | ||
| 59 | index a44cf38..55c3ec9 100644 | ||
| 60 | --- a/kpartx/mac.h | ||
| 61 | +++ b/kpartx/mac.h | ||
| 62 | @@ -24,7 +24,7 @@ struct mac_driver_desc { | ||
| 63 | uint16_t signature; /* expected to be MAC_DRIVER_MAGIC */ | ||
| 64 | uint16_t block_size; | ||
| 65 | uint32_t block_count; | ||
| 66 | - /* ... more stuff */ | ||
| 67 | + /* ... more stuff */ | ||
| 68 | }; | ||
| 69 | |||
| 70 | #endif | ||
| 71 | diff --git a/kpartx/test-kpartx b/kpartx/test-kpartx | ||
| 72 | index 9cee20f..d2001dc 100755 | ||
| 73 | --- a/kpartx/test-kpartx | ||
| 74 | +++ b/kpartx/test-kpartx | ||
| 75 | @@ -131,7 +131,7 @@ step "create DM devices (spans)" | ||
| 76 | # They also serve as DM devices to test partition removal on those. | ||
| 77 | |||
| 78 | TABLE="\ | ||
| 79 | -0 $((SIZE/SECTSIZ-OFFS)) linear $DEV1 $OFFS | ||
| 80 | +0 $((SIZE/SECTSIZ-OFFS)) linear $DEV1 $OFFS | ||
| 81 | $((SIZE/SECTSIZ-OFFS)) $((SIZE/SECTSIZ-OFFS)) linear $DEV2 $OFFS" | ||
| 82 | |||
| 83 | SPAN1=kpt | ||
| 84 | diff --git a/libmpathcmd/Makefile b/libmpathcmd/Makefile | ||
| 85 | index 53c0899..0f6b816 100644 | ||
| 86 | --- a/libmpathcmd/Makefile | ||
| 87 | +++ b/libmpathcmd/Makefile | ||
| 88 | @@ -27,7 +27,7 @@ uninstall: | ||
| 89 | $(RM) $(DESTDIR)$(includedir)/mpath_cmd.h | ||
| 90 | |||
| 91 | clean: dep_clean | ||
| 92 | - $(RM) core *.a *.o *.so *.so.* *.gz | ||
| 93 | + $(RM) core *.a *.o *.so *.so.* *.gz | ||
| 94 | |||
| 95 | include $(wildcard $(OBJS:.o=.d)) | ||
| 96 | |||
| 97 | diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c | ||
| 98 | index 827e899..2ca6888 100644 | ||
| 99 | --- a/libmultipath/hwtable.c | ||
| 100 | +++ b/libmultipath/hwtable.c | ||
| 101 | @@ -78,13 +78,13 @@ | ||
| 102 | #endif | ||
| 103 | |||
| 104 | static struct hwentry default_hw[] = { | ||
| 105 | - /* | ||
| 106 | - * Generic NVMe | ||
| 107 | - * | ||
| 108 | - * Due to the parsing logic in find_hwe(), generic entries | ||
| 109 | - * have to be put on top of this list, and more specific ones | ||
| 110 | - * below. | ||
| 111 | - */ | ||
| 112 | + /* | ||
| 113 | + * Generic NVMe devices | ||
| 114 | + * | ||
| 115 | + * Due to the parsing logic in find_hwe(), generic entries | ||
| 116 | + * have to be put on top of this list, and more specific ones | ||
| 117 | + * below. | ||
| 118 | + */ | ||
| 119 | { | ||
| 120 | .vendor = "NVME", | ||
| 121 | .product = ".*", | ||
| 122 | diff --git a/libmultipath/print.h b/libmultipath/print.h | ||
| 123 | index 7ba6438..9b5a23a 100644 | ||
| 124 | --- a/libmultipath/print.h | ||
| 125 | +++ b/libmultipath/print.h | ||
| 126 | @@ -113,7 +113,7 @@ int _snprint_multipath (const struct gen_multipath *, char *, int, | ||
| 127 | const char *, int); | ||
| 128 | #define snprint_multipath(buf, len, fmt, mp, v) \ | ||
| 129 | _snprint_multipath(dm_multipath_to_gen(mp), buf, len, fmt, v) | ||
| 130 | -int _snprint_multipath_topology (const struct gen_multipath *, char *, int, | ||
| 131 | +int _snprint_multipath_topology (const struct gen_multipath *, char *, int, | ||
| 132 | int verbosity); | ||
| 133 | #define snprint_multipath_topology(buf, len, mpp, v) \ | ||
| 134 | _snprint_multipath_topology (dm_multipath_to_gen(mpp), buf, len, v) | ||
| 135 | diff --git a/multipathd/main.h b/multipathd/main.h | ||
| 136 | index af39558..8fd426b 100644 | ||
| 137 | --- a/multipathd/main.h | ||
| 138 | +++ b/multipathd/main.h | ||
| 139 | @@ -29,11 +29,11 @@ int ev_remove_map (char *, char *, int, struct vectors *); | ||
| 140 | int set_config_state(enum daemon_status); | ||
| 141 | void * mpath_alloc_prin_response(int prin_sa); | ||
| 142 | int prin_do_scsi_ioctl(char *, int rq_servact, struct prin_resp * resp, | ||
| 143 | - int noisy); | ||
| 144 | + int noisy); | ||
| 145 | void dumpHex(const char * , int len, int no_ascii); | ||
| 146 | int prout_do_scsi_ioctl(char * , int rq_servact, int rq_scope, | ||
| 147 | - unsigned int rq_type, struct prout_param_descriptor *param, | ||
| 148 | - int noisy); | ||
| 149 | + unsigned int rq_type, | ||
| 150 | + struct prout_param_descriptor *param, int noisy); | ||
| 151 | int mpath_pr_event_handle(struct path *pp); | ||
| 152 | void * mpath_pr_event_handler_fn (void * ); | ||
| 153 | int update_map_pr(struct multipath *mpp); | ||
| 154 | -- | ||
| 155 | 2.7.4 | ||
| 156 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0006-multipath-tools-fix-compilation-with-musl-libc.patch b/meta-oe/recipes-support/multipath-tools/files/0006-multipath-tools-fix-compilation-with-musl-libc.patch deleted file mode 100644 index c6fd5b4cfb..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0006-multipath-tools-fix-compilation-with-musl-libc.patch +++ /dev/null | |||
| @@ -1,58 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 3 | Date: Fri, 11 May 2018 18:39:44 +0200 | ||
| 4 | Subject: [PATCH] multipath-tools: fix compilation with musl libc | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | In file included from alias.c:15: | ||
| 10 | file.h:9:47: error: unknown type name ‘mode_t’; did you mean ‘time_t’? | ||
| 11 | int ensure_directories_exist(const char *str, mode_t dir_mode); | ||
| 12 | ^~~~~~ | ||
| 13 | time_t | ||
| 14 | |||
| 15 | sysfs.c: In function ‘sysfs_is_multipathed’: | ||
| 16 | sysfs.c:304:15: error: ‘PATH_MAX’ undeclared (first use in this function); did you mean ‘PATH_UP’? | ||
| 17 | char pathbuf[PATH_MAX]; | ||
| 18 | ^~~~~~~~ | ||
| 19 | PATH_UP | ||
| 20 | |||
| 21 | Cc: Martin Wilck <mwilck@suse.com> | ||
| 22 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
| 23 | Cc: DM ML <dm-devel@redhat.com> | ||
| 24 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 25 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 26 | --- | ||
| 27 | libmultipath/file.h | 2 ++ | ||
| 28 | libmultipath/sysfs.c | 1 + | ||
| 29 | 2 files changed, 3 insertions(+) | ||
| 30 | |||
| 31 | diff --git a/libmultipath/file.h b/libmultipath/file.h | ||
| 32 | index 29520c7..3c75c90 100644 | ||
| 33 | --- a/libmultipath/file.h | ||
| 34 | +++ b/libmultipath/file.h | ||
| 35 | @@ -5,6 +5,8 @@ | ||
| 36 | #ifndef _FILE_H | ||
| 37 | #define _FILE_H | ||
| 38 | |||
| 39 | +#include <sys/stat.h> | ||
| 40 | + | ||
| 41 | #define FILE_TIMEOUT 30 | ||
| 42 | int ensure_directories_exist(const char *str, mode_t dir_mode); | ||
| 43 | int open_file(const char *file, int *can_write, const char *header); | ||
| 44 | diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c | ||
| 45 | index ee72e6a..16e0a73 100644 | ||
| 46 | --- a/libmultipath/sysfs.c | ||
| 47 | +++ b/libmultipath/sysfs.c | ||
| 48 | @@ -28,6 +28,7 @@ | ||
| 49 | #include <dirent.h> | ||
| 50 | #include <libudev.h> | ||
| 51 | #include <fnmatch.h> | ||
| 52 | +#include <limits.h> | ||
| 53 | |||
| 54 | #include "checkers.h" | ||
| 55 | #include "vector.h" | ||
| 56 | -- | ||
| 57 | 2.7.4 | ||
| 58 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0007-multipath-tools-add-x-to-doc-preclean.pl-and-split-m.patch b/meta-oe/recipes-support/multipath-tools/files/0007-multipath-tools-add-x-to-doc-preclean.pl-and-split-m.patch deleted file mode 100644 index 9e608e16ff..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0007-multipath-tools-add-x-to-doc-preclean.pl-and-split-m.patch +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 3 | Date: Sun, 13 May 2018 00:39:41 +0200 | ||
| 4 | Subject: [PATCH] multipath-tools: add +x to doc-preclean.pl and split-man.pl | ||
| 5 | |||
| 6 | It is not strictly necessary, but it helps identify bin files. | ||
| 7 | |||
| 8 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
| 9 | Cc: DM ML <dm-devel@redhat.com> | ||
| 10 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 11 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 12 | --- | ||
| 13 | libdmmp/docs/doc-preclean.pl | 0 | ||
| 14 | libdmmp/docs/split-man.pl | 0 | ||
| 15 | 2 files changed, 0 insertions(+), 0 deletions(-) | ||
| 16 | mode change 100644 => 100755 libdmmp/docs/doc-preclean.pl | ||
| 17 | mode change 100644 => 100755 libdmmp/docs/split-man.pl | ||
| 18 | |||
| 19 | diff --git a/libdmmp/docs/doc-preclean.pl b/libdmmp/docs/doc-preclean.pl | ||
| 20 | old mode 100644 | ||
| 21 | new mode 100755 | ||
| 22 | diff --git a/libdmmp/docs/split-man.pl b/libdmmp/docs/split-man.pl | ||
| 23 | old mode 100644 | ||
| 24 | new mode 100755 | ||
| 25 | -- | ||
| 26 | 2.7.4 | ||
| 27 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0008-multipath-tools-refresh-kernel-doc-from-kernel-sourc.patch b/meta-oe/recipes-support/multipath-tools/files/0008-multipath-tools-refresh-kernel-doc-from-kernel-sourc.patch deleted file mode 100644 index 3752158704..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0008-multipath-tools-refresh-kernel-doc-from-kernel-sourc.patch +++ /dev/null | |||
| @@ -1,784 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 3 | Date: Sun, 13 May 2018 00:39:42 +0200 | ||
| 4 | Subject: [PATCH] multipath-tools: refresh kernel-doc from kernel sources | ||
| 5 | |||
| 6 | Cc: Gris Ge <fge@redhat.com> | ||
| 7 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
| 8 | Cc: device-mapper development <dm-devel@redhat.com> | ||
| 9 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 10 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 11 | --- | ||
| 12 | libdmmp/docs/kernel-doc | 671 ++++++++++++++++++++++++++---------------------- | ||
| 13 | 1 file changed, 368 insertions(+), 303 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/libdmmp/docs/kernel-doc b/libdmmp/docs/kernel-doc | ||
| 16 | index fee8952..0057d8e 100755 | ||
| 17 | --- a/libdmmp/docs/kernel-doc | ||
| 18 | +++ b/libdmmp/docs/kernel-doc | ||
| 19 | @@ -1,4 +1,5 @@ | ||
| 20 | #!/usr/bin/env perl | ||
| 21 | +# SPDX-License-Identifier: GPL-2.0 | ||
| 22 | |||
| 23 | use warnings; | ||
| 24 | use strict; | ||
| 25 | @@ -328,13 +329,15 @@ my $lineprefix=""; | ||
| 26 | use constant { | ||
| 27 | STATE_NORMAL => 0, # normal code | ||
| 28 | STATE_NAME => 1, # looking for function name | ||
| 29 | - STATE_FIELD => 2, # scanning field start | ||
| 30 | - STATE_PROTO => 3, # scanning prototype | ||
| 31 | - STATE_DOCBLOCK => 4, # documentation block | ||
| 32 | - STATE_INLINE => 5, # gathering documentation outside main block | ||
| 33 | + STATE_BODY_MAYBE => 2, # body - or maybe more description | ||
| 34 | + STATE_BODY => 3, # the body of the comment | ||
| 35 | + STATE_PROTO => 4, # scanning prototype | ||
| 36 | + STATE_DOCBLOCK => 5, # documentation block | ||
| 37 | + STATE_INLINE => 6, # gathering documentation outside main block | ||
| 38 | }; | ||
| 39 | my $state; | ||
| 40 | my $in_doc_sect; | ||
| 41 | +my $leading_space; | ||
| 42 | |||
| 43 | # Inline documentation state | ||
| 44 | use constant { | ||
| 45 | @@ -363,7 +366,7 @@ my $doc_sect = $doc_com . | ||
| 46 | my $doc_content = $doc_com_body . '(.*)'; | ||
| 47 | my $doc_block = $doc_com . 'DOC:\s*(.*)?'; | ||
| 48 | my $doc_inline_start = '^\s*/\*\*\s*$'; | ||
| 49 | -my $doc_inline_sect = '\s*\*\s*(@[\w\s]+):(.*)'; | ||
| 50 | +my $doc_inline_sect = '\s*\*\s*(@\s*[\w][\w\.]*\s*):(.*)'; | ||
| 51 | my $doc_inline_end = '^\s*\*/\s*$'; | ||
| 52 | my $doc_inline_oneline = '^\s*/\*\*\s*(@[\w\s]+):\s*(.*)\s*\*/\s*$'; | ||
| 53 | my $export_symbol = '^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*;'; | ||
| 54 | @@ -553,10 +556,9 @@ sub output_highlight { | ||
| 55 | } | ||
| 56 | if ($line eq ""){ | ||
| 57 | if (! $output_preformatted) { | ||
| 58 | - print $lineprefix, local_unescape($blankline); | ||
| 59 | + print $lineprefix, $blankline; | ||
| 60 | } | ||
| 61 | } else { | ||
| 62 | - $line =~ s/\\\\\\/\&/g; | ||
| 63 | if ($output_mode eq "man" && substr($line, 0, 1) eq ".") { | ||
| 64 | print "\\&$line"; | ||
| 65 | } else { | ||
| 66 | @@ -747,17 +749,73 @@ sub output_blockhead_rst(%) { | ||
| 67 | } | ||
| 68 | } | ||
| 69 | |||
| 70 | -sub output_highlight_rst { | ||
| 71 | - my $contents = join "\n",@_; | ||
| 72 | - my $line; | ||
| 73 | - | ||
| 74 | - # undo the evil effects of xml_escape() earlier | ||
| 75 | - $contents = xml_unescape($contents); | ||
| 76 | - | ||
| 77 | +# | ||
| 78 | +# Apply the RST highlights to a sub-block of text. | ||
| 79 | +# | ||
| 80 | +sub highlight_block($) { | ||
| 81 | + # The dohighlight kludge requires the text be called $contents | ||
| 82 | + my $contents = shift; | ||
| 83 | eval $dohighlight; | ||
| 84 | die $@ if $@; | ||
| 85 | + return $contents; | ||
| 86 | +} | ||
| 87 | |||
| 88 | - foreach $line (split "\n", $contents) { | ||
| 89 | +# | ||
| 90 | +# Regexes used only here. | ||
| 91 | +# | ||
| 92 | +my $sphinx_literal = '^[^.].*::$'; | ||
| 93 | +my $sphinx_cblock = '^\.\.\ +code-block::'; | ||
| 94 | + | ||
| 95 | +sub output_highlight_rst { | ||
| 96 | + my $input = join "\n",@_; | ||
| 97 | + my $output = ""; | ||
| 98 | + my $line; | ||
| 99 | + my $in_literal = 0; | ||
| 100 | + my $litprefix; | ||
| 101 | + my $block = ""; | ||
| 102 | + | ||
| 103 | + foreach $line (split "\n",$input) { | ||
| 104 | + # | ||
| 105 | + # If we're in a literal block, see if we should drop out | ||
| 106 | + # of it. Otherwise pass the line straight through unmunged. | ||
| 107 | + # | ||
| 108 | + if ($in_literal) { | ||
| 109 | + if (! ($line =~ /^\s*$/)) { | ||
| 110 | + # | ||
| 111 | + # If this is the first non-blank line in a literal | ||
| 112 | + # block we need to figure out what the proper indent is. | ||
| 113 | + # | ||
| 114 | + if ($litprefix eq "") { | ||
| 115 | + $line =~ /^(\s*)/; | ||
| 116 | + $litprefix = '^' . $1; | ||
| 117 | + $output .= $line . "\n"; | ||
| 118 | + } elsif (! ($line =~ /$litprefix/)) { | ||
| 119 | + $in_literal = 0; | ||
| 120 | + } else { | ||
| 121 | + $output .= $line . "\n"; | ||
| 122 | + } | ||
| 123 | + } else { | ||
| 124 | + $output .= $line . "\n"; | ||
| 125 | + } | ||
| 126 | + } | ||
| 127 | + # | ||
| 128 | + # Not in a literal block (or just dropped out) | ||
| 129 | + # | ||
| 130 | + if (! $in_literal) { | ||
| 131 | + $block .= $line . "\n"; | ||
| 132 | + if (($line =~ /$sphinx_literal/) || ($line =~ /$sphinx_cblock/)) { | ||
| 133 | + $in_literal = 1; | ||
| 134 | + $litprefix = ""; | ||
| 135 | + $output .= highlight_block($block); | ||
| 136 | + $block = "" | ||
| 137 | + } | ||
| 138 | + } | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + if ($block) { | ||
| 142 | + $output .= highlight_block($block); | ||
| 143 | + } | ||
| 144 | + foreach $line (split "\n", $output) { | ||
| 145 | print $lineprefix . $line . "\n"; | ||
| 146 | } | ||
| 147 | } | ||
| 148 | @@ -1062,7 +1120,7 @@ sub dump_struct($$) { | ||
| 149 | # Handle bitmaps | ||
| 150 | $arg =~ s/:\s*\d+\s*//g; | ||
| 151 | # Handle arrays | ||
| 152 | - $arg =~ s/\[\S+\]//g; | ||
| 153 | + $arg =~ s/\[.*\]//g; | ||
| 154 | # The type may have multiple words, | ||
| 155 | # and multiple IDs can be defined, like: | ||
| 156 | # const struct foo, *bar, foobar | ||
| 157 | @@ -1422,8 +1480,6 @@ sub push_parameter($$$$) { | ||
| 158 | } | ||
| 159 | } | ||
| 160 | |||
| 161 | - $param = xml_escape($param); | ||
| 162 | - | ||
| 163 | # strip spaces from $param so that it is one continuous string | ||
| 164 | # on @parameterlist; | ||
| 165 | # this fixes a problem where check_sections() cannot find | ||
| 166 | @@ -1522,6 +1578,7 @@ sub dump_function($$) { | ||
| 167 | $prototype =~ s/__meminit +//; | ||
| 168 | $prototype =~ s/__must_check +//; | ||
| 169 | $prototype =~ s/__weak +//; | ||
| 170 | + $prototype =~ s/__sched +//; | ||
| 171 | my $define = $prototype =~ s/^#\s*define\s+//; #ak added | ||
| 172 | $prototype =~ s/__attribute__\s*\(\( | ||
| 173 | (?: | ||
| 174 | @@ -1748,47 +1805,6 @@ sub process_proto_type($$) { | ||
| 175 | } | ||
| 176 | } | ||
| 177 | |||
| 178 | -# xml_escape: replace <, >, and & in the text stream; | ||
| 179 | -# | ||
| 180 | -# however, formatting controls that are generated internally/locally in the | ||
| 181 | -# kernel-doc script are not escaped here; instead, they begin life like | ||
| 182 | -# $blankline_html (4 of '\' followed by a mnemonic + ':'), then these strings | ||
| 183 | -# are converted to their mnemonic-expected output, without the 4 * '\' & ':', | ||
| 184 | -# just before actual output; (this is done by local_unescape()) | ||
| 185 | -sub xml_escape($) { | ||
| 186 | - my $text = shift; | ||
| 187 | - if ($output_mode eq "man") { | ||
| 188 | - return $text; | ||
| 189 | - } | ||
| 190 | - $text =~ s/\&/\\\\\\amp;/g; | ||
| 191 | - $text =~ s/\</\\\\\\lt;/g; | ||
| 192 | - $text =~ s/\>/\\\\\\gt;/g; | ||
| 193 | - return $text; | ||
| 194 | -} | ||
| 195 | - | ||
| 196 | -# xml_unescape: reverse the effects of xml_escape | ||
| 197 | -sub xml_unescape($) { | ||
| 198 | - my $text = shift; | ||
| 199 | - if ($output_mode eq "man") { | ||
| 200 | - return $text; | ||
| 201 | - } | ||
| 202 | - $text =~ s/\\\\\\amp;/\&/g; | ||
| 203 | - $text =~ s/\\\\\\lt;/</g; | ||
| 204 | - $text =~ s/\\\\\\gt;/>/g; | ||
| 205 | - return $text; | ||
| 206 | -} | ||
| 207 | - | ||
| 208 | -# convert local escape strings to html | ||
| 209 | -# local escape strings look like: '\\\\menmonic:' (that's 4 backslashes) | ||
| 210 | -sub local_unescape($) { | ||
| 211 | - my $text = shift; | ||
| 212 | - if ($output_mode eq "man") { | ||
| 213 | - return $text; | ||
| 214 | - } | ||
| 215 | - $text =~ s/\\\\\\\\lt:/</g; | ||
| 216 | - $text =~ s/\\\\\\\\gt:/>/g; | ||
| 217 | - return $text; | ||
| 218 | -} | ||
| 219 | |||
| 220 | sub map_filename($) { | ||
| 221 | my $file; | ||
| 222 | @@ -1826,15 +1842,291 @@ sub process_export_file($) { | ||
| 223 | close(IN); | ||
| 224 | } | ||
| 225 | |||
| 226 | -sub process_file($) { | ||
| 227 | - my $file; | ||
| 228 | +# | ||
| 229 | +# Parsers for the various processing states. | ||
| 230 | +# | ||
| 231 | +# STATE_NORMAL: looking for the /** to begin everything. | ||
| 232 | +# | ||
| 233 | +sub process_normal() { | ||
| 234 | + if (/$doc_start/o) { | ||
| 235 | + $state = STATE_NAME; # next line is always the function name | ||
| 236 | + $in_doc_sect = 0; | ||
| 237 | + $declaration_start_line = $. + 1; | ||
| 238 | + } | ||
| 239 | +} | ||
| 240 | + | ||
| 241 | +# | ||
| 242 | +# STATE_NAME: Looking for the "name - description" line | ||
| 243 | +# | ||
| 244 | +sub process_name($$) { | ||
| 245 | + my $file = shift; | ||
| 246 | my $identifier; | ||
| 247 | - my $func; | ||
| 248 | my $descr; | ||
| 249 | - my $in_purpose = 0; | ||
| 250 | + | ||
| 251 | + if (/$doc_block/o) { | ||
| 252 | + $state = STATE_DOCBLOCK; | ||
| 253 | + $contents = ""; | ||
| 254 | + $new_start_line = $. + 1; | ||
| 255 | + | ||
| 256 | + if ( $1 eq "" ) { | ||
| 257 | + $section = $section_intro; | ||
| 258 | + } else { | ||
| 259 | + $section = $1; | ||
| 260 | + } | ||
| 261 | + } | ||
| 262 | + elsif (/$doc_decl/o) { | ||
| 263 | + $identifier = $1; | ||
| 264 | + if (/\s*([\w\s]+?)(\(\))?\s*-/) { | ||
| 265 | + $identifier = $1; | ||
| 266 | + } | ||
| 267 | + | ||
| 268 | + $state = STATE_BODY; | ||
| 269 | + # if there's no @param blocks need to set up default section | ||
| 270 | + # here | ||
| 271 | + $contents = ""; | ||
| 272 | + $section = $section_default; | ||
| 273 | + $new_start_line = $. + 1; | ||
| 274 | + if (/-(.*)/) { | ||
| 275 | + # strip leading/trailing/multiple spaces | ||
| 276 | + $descr= $1; | ||
| 277 | + $descr =~ s/^\s*//; | ||
| 278 | + $descr =~ s/\s*$//; | ||
| 279 | + $descr =~ s/\s+/ /g; | ||
| 280 | + $declaration_purpose = $descr; | ||
| 281 | + $state = STATE_BODY_MAYBE; | ||
| 282 | + } else { | ||
| 283 | + $declaration_purpose = ""; | ||
| 284 | + } | ||
| 285 | + | ||
| 286 | + if (($declaration_purpose eq "") && $verbose) { | ||
| 287 | + print STDERR "${file}:$.: warning: missing initial short description on line:\n"; | ||
| 288 | + print STDERR $_; | ||
| 289 | + ++$warnings; | ||
| 290 | + } | ||
| 291 | + | ||
| 292 | + if ($identifier =~ m/^struct/) { | ||
| 293 | + $decl_type = 'struct'; | ||
| 294 | + } elsif ($identifier =~ m/^union/) { | ||
| 295 | + $decl_type = 'union'; | ||
| 296 | + } elsif ($identifier =~ m/^enum/) { | ||
| 297 | + $decl_type = 'enum'; | ||
| 298 | + } elsif ($identifier =~ m/^typedef/) { | ||
| 299 | + $decl_type = 'typedef'; | ||
| 300 | + } else { | ||
| 301 | + $decl_type = 'function'; | ||
| 302 | + } | ||
| 303 | + | ||
| 304 | + if ($verbose) { | ||
| 305 | + print STDERR "${file}:$.: info: Scanning doc for $identifier\n"; | ||
| 306 | + } | ||
| 307 | + } else { | ||
| 308 | + print STDERR "${file}:$.: warning: Cannot understand $_ on line $.", | ||
| 309 | + " - I thought it was a doc line\n"; | ||
| 310 | + ++$warnings; | ||
| 311 | + $state = STATE_NORMAL; | ||
| 312 | + } | ||
| 313 | +} | ||
| 314 | + | ||
| 315 | + | ||
| 316 | +# | ||
| 317 | +# STATE_BODY and STATE_BODY_MAYBE: the bulk of a kerneldoc comment. | ||
| 318 | +# | ||
| 319 | +sub process_body($$) { | ||
| 320 | + my $file = shift; | ||
| 321 | + | ||
| 322 | + if (/$doc_sect/i) { # case insensitive for supported section names | ||
| 323 | + $newsection = $1; | ||
| 324 | + $newcontents = $2; | ||
| 325 | + | ||
| 326 | + # map the supported section names to the canonical names | ||
| 327 | + if ($newsection =~ m/^description$/i) { | ||
| 328 | + $newsection = $section_default; | ||
| 329 | + } elsif ($newsection =~ m/^context$/i) { | ||
| 330 | + $newsection = $section_context; | ||
| 331 | + } elsif ($newsection =~ m/^returns?$/i) { | ||
| 332 | + $newsection = $section_return; | ||
| 333 | + } elsif ($newsection =~ m/^\@return$/) { | ||
| 334 | + # special: @return is a section, not a param description | ||
| 335 | + $newsection = $section_return; | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + if (($contents ne "") && ($contents ne "\n")) { | ||
| 339 | + if (!$in_doc_sect && $verbose) { | ||
| 340 | + print STDERR "${file}:$.: warning: contents before sections\n"; | ||
| 341 | + ++$warnings; | ||
| 342 | + } | ||
| 343 | + dump_section($file, $section, $contents); | ||
| 344 | + $section = $section_default; | ||
| 345 | + } | ||
| 346 | + | ||
| 347 | + $in_doc_sect = 1; | ||
| 348 | + $state = STATE_BODY; | ||
| 349 | + $contents = $newcontents; | ||
| 350 | + $new_start_line = $.; | ||
| 351 | + while (substr($contents, 0, 1) eq " ") { | ||
| 352 | + $contents = substr($contents, 1); | ||
| 353 | + } | ||
| 354 | + if ($contents ne "") { | ||
| 355 | + $contents .= "\n"; | ||
| 356 | + } | ||
| 357 | + $section = $newsection; | ||
| 358 | + $leading_space = undef; | ||
| 359 | + } elsif (/$doc_end/) { | ||
| 360 | + if (($contents ne "") && ($contents ne "\n")) { | ||
| 361 | + dump_section($file, $section, $contents); | ||
| 362 | + $section = $section_default; | ||
| 363 | + $contents = ""; | ||
| 364 | + } | ||
| 365 | + # look for doc_com + <text> + doc_end: | ||
| 366 | + if ($_ =~ m'\s*\*\s*[a-zA-Z_0-9:\.]+\*/') { | ||
| 367 | + print STDERR "${file}:$.: warning: suspicious ending line: $_"; | ||
| 368 | + ++$warnings; | ||
| 369 | + } | ||
| 370 | + | ||
| 371 | + $prototype = ""; | ||
| 372 | + $state = STATE_PROTO; | ||
| 373 | + $brcount = 0; | ||
| 374 | + } elsif (/$doc_content/) { | ||
| 375 | + # miguel-style comment kludge, look for blank lines after | ||
| 376 | + # @parameter line to signify start of description | ||
| 377 | + if ($1 eq "") { | ||
| 378 | + if ($section =~ m/^@/ || $section eq $section_context) { | ||
| 379 | + dump_section($file, $section, $contents); | ||
| 380 | + $section = $section_default; | ||
| 381 | + $contents = ""; | ||
| 382 | + $new_start_line = $.; | ||
| 383 | + } else { | ||
| 384 | + $contents .= "\n"; | ||
| 385 | + } | ||
| 386 | + $state = STATE_BODY; | ||
| 387 | + } elsif ($state == STATE_BODY_MAYBE) { | ||
| 388 | + # Continued declaration purpose | ||
| 389 | + chomp($declaration_purpose); | ||
| 390 | + $declaration_purpose .= " " . $1; | ||
| 391 | + $declaration_purpose =~ s/\s+/ /g; | ||
| 392 | + } else { | ||
| 393 | + my $cont = $1; | ||
| 394 | + if ($section =~ m/^@/ || $section eq $section_context) { | ||
| 395 | + if (!defined $leading_space) { | ||
| 396 | + if ($cont =~ m/^(\s+)/) { | ||
| 397 | + $leading_space = $1; | ||
| 398 | + } else { | ||
| 399 | + $leading_space = ""; | ||
| 400 | + } | ||
| 401 | + } | ||
| 402 | + $cont =~ s/^$leading_space//; | ||
| 403 | + } | ||
| 404 | + $contents .= $cont . "\n"; | ||
| 405 | + } | ||
| 406 | + } else { | ||
| 407 | + # i dont know - bad line? ignore. | ||
| 408 | + print STDERR "${file}:$.: warning: bad line: $_"; | ||
| 409 | + ++$warnings; | ||
| 410 | + } | ||
| 411 | +} | ||
| 412 | + | ||
| 413 | + | ||
| 414 | +# | ||
| 415 | +# STATE_PROTO: reading a function/whatever prototype. | ||
| 416 | +# | ||
| 417 | +sub process_proto($$) { | ||
| 418 | + my $file = shift; | ||
| 419 | + | ||
| 420 | + if (/$doc_inline_oneline/) { | ||
| 421 | + $section = $1; | ||
| 422 | + $contents = $2; | ||
| 423 | + if ($contents ne "") { | ||
| 424 | + $contents .= "\n"; | ||
| 425 | + dump_section($file, $section, $contents); | ||
| 426 | + $section = $section_default; | ||
| 427 | + $contents = ""; | ||
| 428 | + } | ||
| 429 | + } elsif (/$doc_inline_start/) { | ||
| 430 | + $state = STATE_INLINE; | ||
| 431 | + $inline_doc_state = STATE_INLINE_NAME; | ||
| 432 | + } elsif ($decl_type eq 'function') { | ||
| 433 | + process_proto_function($_, $file); | ||
| 434 | + } else { | ||
| 435 | + process_proto_type($_, $file); | ||
| 436 | + } | ||
| 437 | +} | ||
| 438 | + | ||
| 439 | +# | ||
| 440 | +# STATE_DOCBLOCK: within a DOC: block. | ||
| 441 | +# | ||
| 442 | +sub process_docblock($$) { | ||
| 443 | + my $file = shift; | ||
| 444 | + | ||
| 445 | + if (/$doc_end/) { | ||
| 446 | + dump_doc_section($file, $section, $contents); | ||
| 447 | + $section = $section_default; | ||
| 448 | + $contents = ""; | ||
| 449 | + $function = ""; | ||
| 450 | + %parameterdescs = (); | ||
| 451 | + %parametertypes = (); | ||
| 452 | + @parameterlist = (); | ||
| 453 | + %sections = (); | ||
| 454 | + @sectionlist = (); | ||
| 455 | + $prototype = ""; | ||
| 456 | + $state = STATE_NORMAL; | ||
| 457 | + } elsif (/$doc_content/) { | ||
| 458 | + if ( $1 eq "" ) { | ||
| 459 | + $contents .= $blankline; | ||
| 460 | + } else { | ||
| 461 | + $contents .= $1 . "\n"; | ||
| 462 | + } | ||
| 463 | + } | ||
| 464 | +} | ||
| 465 | + | ||
| 466 | +# | ||
| 467 | +# STATE_INLINE: docbook comments within a prototype. | ||
| 468 | +# | ||
| 469 | +sub process_inline($$) { | ||
| 470 | + my $file = shift; | ||
| 471 | + | ||
| 472 | + # First line (state 1) needs to be a @parameter | ||
| 473 | + if ($inline_doc_state == STATE_INLINE_NAME && /$doc_inline_sect/o) { | ||
| 474 | + $section = $1; | ||
| 475 | + $contents = $2; | ||
| 476 | + $new_start_line = $.; | ||
| 477 | + if ($contents ne "") { | ||
| 478 | + while (substr($contents, 0, 1) eq " ") { | ||
| 479 | + $contents = substr($contents, 1); | ||
| 480 | + } | ||
| 481 | + $contents .= "\n"; | ||
| 482 | + } | ||
| 483 | + $inline_doc_state = STATE_INLINE_TEXT; | ||
| 484 | + # Documentation block end */ | ||
| 485 | + } elsif (/$doc_inline_end/) { | ||
| 486 | + if (($contents ne "") && ($contents ne "\n")) { | ||
| 487 | + dump_section($file, $section, $contents); | ||
| 488 | + $section = $section_default; | ||
| 489 | + $contents = ""; | ||
| 490 | + } | ||
| 491 | + $state = STATE_PROTO; | ||
| 492 | + $inline_doc_state = STATE_INLINE_NA; | ||
| 493 | + # Regular text | ||
| 494 | + } elsif (/$doc_content/) { | ||
| 495 | + if ($inline_doc_state == STATE_INLINE_TEXT) { | ||
| 496 | + $contents .= $1 . "\n"; | ||
| 497 | + # nuke leading blank lines | ||
| 498 | + if ($contents =~ /^\s*$/) { | ||
| 499 | + $contents = ""; | ||
| 500 | + } | ||
| 501 | + } elsif ($inline_doc_state == STATE_INLINE_NAME) { | ||
| 502 | + $inline_doc_state = STATE_INLINE_ERROR; | ||
| 503 | + print STDERR "${file}:$.: warning: "; | ||
| 504 | + print STDERR "Incorrect use of kernel-doc format: $_"; | ||
| 505 | + ++$warnings; | ||
| 506 | + } | ||
| 507 | + } | ||
| 508 | +} | ||
| 509 | + | ||
| 510 | + | ||
| 511 | +sub process_file($) { | ||
| 512 | + my $file; | ||
| 513 | my $initial_section_counter = $section_counter; | ||
| 514 | my ($orig_file) = @_; | ||
| 515 | - my $leading_space; | ||
| 516 | |||
| 517 | $file = map_filename($orig_file); | ||
| 518 | |||
| 519 | @@ -1853,250 +2145,23 @@ sub process_file($) { | ||
| 520 | } | ||
| 521 | # Replace tabs by spaces | ||
| 522 | while ($_ =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {}; | ||
| 523 | + # Hand this line to the appropriate state handler | ||
| 524 | if ($state == STATE_NORMAL) { | ||
| 525 | - if (/$doc_start/o) { | ||
| 526 | - $state = STATE_NAME; # next line is always the function name | ||
| 527 | - $in_doc_sect = 0; | ||
| 528 | - $declaration_start_line = $. + 1; | ||
| 529 | - } | ||
| 530 | - } elsif ($state == STATE_NAME) {# this line is the function name (always) | ||
| 531 | - if (/$doc_block/o) { | ||
| 532 | - $state = STATE_DOCBLOCK; | ||
| 533 | - $contents = ""; | ||
| 534 | - $new_start_line = $. + 1; | ||
| 535 | - | ||
| 536 | - if ( $1 eq "" ) { | ||
| 537 | - $section = $section_intro; | ||
| 538 | - } else { | ||
| 539 | - $section = $1; | ||
| 540 | - } | ||
| 541 | - } | ||
| 542 | - elsif (/$doc_decl/o) { | ||
| 543 | - $identifier = $1; | ||
| 544 | - if (/\s*([\w\s]+?)\s*-/) { | ||
| 545 | - $identifier = $1; | ||
| 546 | - } | ||
| 547 | - | ||
| 548 | - $state = STATE_FIELD; | ||
| 549 | - # if there's no @param blocks need to set up default section | ||
| 550 | - # here | ||
| 551 | - $contents = ""; | ||
| 552 | - $section = $section_default; | ||
| 553 | - $new_start_line = $. + 1; | ||
| 554 | - if (/-(.*)/) { | ||
| 555 | - # strip leading/trailing/multiple spaces | ||
| 556 | - $descr= $1; | ||
| 557 | - $descr =~ s/^\s*//; | ||
| 558 | - $descr =~ s/\s*$//; | ||
| 559 | - $descr =~ s/\s+/ /g; | ||
| 560 | - $declaration_purpose = xml_escape($descr); | ||
| 561 | - $in_purpose = 1; | ||
| 562 | - } else { | ||
| 563 | - $declaration_purpose = ""; | ||
| 564 | - } | ||
| 565 | - | ||
| 566 | - if (($declaration_purpose eq "") && $verbose) { | ||
| 567 | - print STDERR "${file}:$.: warning: missing initial short description on line:\n"; | ||
| 568 | - print STDERR $_; | ||
| 569 | - ++$warnings; | ||
| 570 | - } | ||
| 571 | - | ||
| 572 | - if ($identifier =~ m/^struct/) { | ||
| 573 | - $decl_type = 'struct'; | ||
| 574 | - } elsif ($identifier =~ m/^union/) { | ||
| 575 | - $decl_type = 'union'; | ||
| 576 | - } elsif ($identifier =~ m/^enum/) { | ||
| 577 | - $decl_type = 'enum'; | ||
| 578 | - } elsif ($identifier =~ m/^typedef/) { | ||
| 579 | - $decl_type = 'typedef'; | ||
| 580 | - } else { | ||
| 581 | - $decl_type = 'function'; | ||
| 582 | - } | ||
| 583 | - | ||
| 584 | - if ($verbose) { | ||
| 585 | - print STDERR "${file}:$.: info: Scanning doc for $identifier\n"; | ||
| 586 | - } | ||
| 587 | - } else { | ||
| 588 | - print STDERR "${file}:$.: warning: Cannot understand $_ on line $.", | ||
| 589 | - " - I thought it was a doc line\n"; | ||
| 590 | - ++$warnings; | ||
| 591 | - $state = STATE_NORMAL; | ||
| 592 | - } | ||
| 593 | - } elsif ($state == STATE_FIELD) { # look for head: lines, and include content | ||
| 594 | - if (/$doc_sect/i) { # case insensitive for supported section names | ||
| 595 | - $newsection = $1; | ||
| 596 | - $newcontents = $2; | ||
| 597 | - | ||
| 598 | - # map the supported section names to the canonical names | ||
| 599 | - if ($newsection =~ m/^description$/i) { | ||
| 600 | - $newsection = $section_default; | ||
| 601 | - } elsif ($newsection =~ m/^context$/i) { | ||
| 602 | - $newsection = $section_context; | ||
| 603 | - } elsif ($newsection =~ m/^returns?$/i) { | ||
| 604 | - $newsection = $section_return; | ||
| 605 | - } elsif ($newsection =~ m/^\@return$/) { | ||
| 606 | - # special: @return is a section, not a param description | ||
| 607 | - $newsection = $section_return; | ||
| 608 | - } | ||
| 609 | - | ||
| 610 | - if (($contents ne "") && ($contents ne "\n")) { | ||
| 611 | - if (!$in_doc_sect && $verbose) { | ||
| 612 | - print STDERR "${file}:$.: warning: contents before sections\n"; | ||
| 613 | - ++$warnings; | ||
| 614 | - } | ||
| 615 | - dump_section($file, $section, xml_escape($contents)); | ||
| 616 | - $section = $section_default; | ||
| 617 | - } | ||
| 618 | - | ||
| 619 | - $in_doc_sect = 1; | ||
| 620 | - $in_purpose = 0; | ||
| 621 | - $contents = $newcontents; | ||
| 622 | - $new_start_line = $.; | ||
| 623 | - while (substr($contents, 0, 1) eq " ") { | ||
| 624 | - $contents = substr($contents, 1); | ||
| 625 | - } | ||
| 626 | - if ($contents ne "") { | ||
| 627 | - $contents .= "\n"; | ||
| 628 | - } | ||
| 629 | - $section = $newsection; | ||
| 630 | - $leading_space = undef; | ||
| 631 | - } elsif (/$doc_end/) { | ||
| 632 | - if (($contents ne "") && ($contents ne "\n")) { | ||
| 633 | - dump_section($file, $section, xml_escape($contents)); | ||
| 634 | - $section = $section_default; | ||
| 635 | - $contents = ""; | ||
| 636 | - } | ||
| 637 | - # look for doc_com + <text> + doc_end: | ||
| 638 | - if ($_ =~ m'\s*\*\s*[a-zA-Z_0-9:\.]+\*/') { | ||
| 639 | - print STDERR "${file}:$.: warning: suspicious ending line: $_"; | ||
| 640 | - ++$warnings; | ||
| 641 | - } | ||
| 642 | - | ||
| 643 | - $prototype = ""; | ||
| 644 | - $state = STATE_PROTO; | ||
| 645 | - $brcount = 0; | ||
| 646 | -# print STDERR "end of doc comment, looking for prototype\n"; | ||
| 647 | - } elsif (/$doc_content/) { | ||
| 648 | - # miguel-style comment kludge, look for blank lines after | ||
| 649 | - # @parameter line to signify start of description | ||
| 650 | - if ($1 eq "") { | ||
| 651 | - if ($section =~ m/^@/ || $section eq $section_context) { | ||
| 652 | - dump_section($file, $section, xml_escape($contents)); | ||
| 653 | - $section = $section_default; | ||
| 654 | - $contents = ""; | ||
| 655 | - $new_start_line = $.; | ||
| 656 | - } else { | ||
| 657 | - $contents .= "\n"; | ||
| 658 | - } | ||
| 659 | - $in_purpose = 0; | ||
| 660 | - } elsif ($in_purpose == 1) { | ||
| 661 | - # Continued declaration purpose | ||
| 662 | - chomp($declaration_purpose); | ||
| 663 | - $declaration_purpose .= " " . xml_escape($1); | ||
| 664 | - $declaration_purpose =~ s/\s+/ /g; | ||
| 665 | - } else { | ||
| 666 | - my $cont = $1; | ||
| 667 | - if ($section =~ m/^@/ || $section eq $section_context) { | ||
| 668 | - if (!defined $leading_space) { | ||
| 669 | - if ($cont =~ m/^(\s+)/) { | ||
| 670 | - $leading_space = $1; | ||
| 671 | - } else { | ||
| 672 | - $leading_space = ""; | ||
| 673 | - } | ||
| 674 | - } | ||
| 675 | - | ||
| 676 | - $cont =~ s/^$leading_space//; | ||
| 677 | - } | ||
| 678 | - $contents .= $cont . "\n"; | ||
| 679 | - } | ||
| 680 | - } else { | ||
| 681 | - # i dont know - bad line? ignore. | ||
| 682 | - print STDERR "${file}:$.: warning: bad line: $_"; | ||
| 683 | - ++$warnings; | ||
| 684 | - } | ||
| 685 | + process_normal(); | ||
| 686 | + } elsif ($state == STATE_NAME) { | ||
| 687 | + process_name($file, $_); | ||
| 688 | + } elsif ($state == STATE_BODY || $state == STATE_BODY_MAYBE) { | ||
| 689 | + process_body($file, $_); | ||
| 690 | } elsif ($state == STATE_INLINE) { # scanning for inline parameters | ||
| 691 | - # First line (state 1) needs to be a @parameter | ||
| 692 | - if ($inline_doc_state == STATE_INLINE_NAME && /$doc_inline_sect/o) { | ||
| 693 | - $section = $1; | ||
| 694 | - $contents = $2; | ||
| 695 | - $new_start_line = $.; | ||
| 696 | - if ($contents ne "") { | ||
| 697 | - while (substr($contents, 0, 1) eq " ") { | ||
| 698 | - $contents = substr($contents, 1); | ||
| 699 | - } | ||
| 700 | - $contents .= "\n"; | ||
| 701 | - } | ||
| 702 | - $inline_doc_state = STATE_INLINE_TEXT; | ||
| 703 | - # Documentation block end */ | ||
| 704 | - } elsif (/$doc_inline_end/) { | ||
| 705 | - if (($contents ne "") && ($contents ne "\n")) { | ||
| 706 | - dump_section($file, $section, xml_escape($contents)); | ||
| 707 | - $section = $section_default; | ||
| 708 | - $contents = ""; | ||
| 709 | - } | ||
| 710 | - $state = STATE_PROTO; | ||
| 711 | - $inline_doc_state = STATE_INLINE_NA; | ||
| 712 | - # Regular text | ||
| 713 | - } elsif (/$doc_content/) { | ||
| 714 | - if ($inline_doc_state == STATE_INLINE_TEXT) { | ||
| 715 | - $contents .= $1 . "\n"; | ||
| 716 | - # nuke leading blank lines | ||
| 717 | - if ($contents =~ /^\s*$/) { | ||
| 718 | - $contents = ""; | ||
| 719 | - } | ||
| 720 | - } elsif ($inline_doc_state == STATE_INLINE_NAME) { | ||
| 721 | - $inline_doc_state = STATE_INLINE_ERROR; | ||
| 722 | - print STDERR "${file}:$.: warning: "; | ||
| 723 | - print STDERR "Incorrect use of kernel-doc format: $_"; | ||
| 724 | - ++$warnings; | ||
| 725 | - } | ||
| 726 | - } | ||
| 727 | - } elsif ($state == STATE_PROTO) { # scanning for function '{' (end of prototype) | ||
| 728 | - if (/$doc_inline_oneline/) { | ||
| 729 | - $section = $1; | ||
| 730 | - $contents = $2; | ||
| 731 | - if ($contents ne "") { | ||
| 732 | - $contents .= "\n"; | ||
| 733 | - dump_section($file, $section, xml_escape($contents)); | ||
| 734 | - $section = $section_default; | ||
| 735 | - $contents = ""; | ||
| 736 | - } | ||
| 737 | - } elsif (/$doc_inline_start/) { | ||
| 738 | - $state = STATE_INLINE; | ||
| 739 | - $inline_doc_state = STATE_INLINE_NAME; | ||
| 740 | - } elsif ($decl_type eq 'function') { | ||
| 741 | - process_proto_function($_, $file); | ||
| 742 | - } else { | ||
| 743 | - process_proto_type($_, $file); | ||
| 744 | - } | ||
| 745 | + process_inline($file, $_); | ||
| 746 | + } elsif ($state == STATE_PROTO) { | ||
| 747 | + process_proto($file, $_); | ||
| 748 | } elsif ($state == STATE_DOCBLOCK) { | ||
| 749 | - if (/$doc_end/) | ||
| 750 | - { | ||
| 751 | - dump_doc_section($file, $section, xml_escape($contents)); | ||
| 752 | - $section = $section_default; | ||
| 753 | - $contents = ""; | ||
| 754 | - $function = ""; | ||
| 755 | - %parameterdescs = (); | ||
| 756 | - %parametertypes = (); | ||
| 757 | - @parameterlist = (); | ||
| 758 | - %sections = (); | ||
| 759 | - @sectionlist = (); | ||
| 760 | - $prototype = ""; | ||
| 761 | - $state = STATE_NORMAL; | ||
| 762 | - } | ||
| 763 | - elsif (/$doc_content/) | ||
| 764 | - { | ||
| 765 | - if ( $1 eq "" ) | ||
| 766 | - { | ||
| 767 | - $contents .= $blankline; | ||
| 768 | - } | ||
| 769 | - else | ||
| 770 | - { | ||
| 771 | - $contents .= $1 . "\n"; | ||
| 772 | - } | ||
| 773 | - } | ||
| 774 | + process_docblock($file, $_); | ||
| 775 | } | ||
| 776 | } | ||
| 777 | + | ||
| 778 | + # Make sure we got something interesting. | ||
| 779 | if ($initial_section_counter == $section_counter) { | ||
| 780 | if ($output_mode ne "none") { | ||
| 781 | print STDERR "${file}:1: warning: no structured comments found\n"; | ||
| 782 | -- | ||
| 783 | 2.7.4 | ||
| 784 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0009-multipath-tools-configure-hitachi-ams2000-and-hus100.patch b/meta-oe/recipes-support/multipath-tools/files/0009-multipath-tools-configure-hitachi-ams2000-and-hus100.patch deleted file mode 100644 index 2cae0750ba..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0009-multipath-tools-configure-hitachi-ams2000-and-hus100.patch +++ /dev/null | |||
| @@ -1,56 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 3 | Date: Mon, 14 May 2018 17:30:17 +0200 | ||
| 4 | Subject: [PATCH] multipath-tools: configure hitachi ams2000 and hus100 as full | ||
| 5 | active arrays | ||
| 6 | |||
| 7 | AMS2000 and HUS100 families are active/active arrays. | ||
| 8 | |||
| 9 | Based on https://support.hitachivantara.com/download/epcra/df818913.pdf | ||
| 10 | and internal hitachi docs. | ||
| 11 | |||
| 12 | Cc: Matthias Rudolph <Matthias.Rudolph@hitachivantara.com> | ||
| 13 | Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> | ||
| 14 | Cc: DM-DEV ML <dm-devel@redhat.com> | ||
| 15 | Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> | ||
| 16 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 17 | --- | ||
| 18 | libmultipath/hwtable.c | 10 ++++++++-- | ||
| 19 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
| 20 | |||
| 21 | diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c | ||
| 22 | index 2ca6888..148f0ba 100644 | ||
| 23 | --- a/libmultipath/hwtable.c | ||
| 24 | +++ b/libmultipath/hwtable.c | ||
| 25 | @@ -398,13 +398,13 @@ static struct hwentry default_hw[] = { | ||
| 26 | * Mail : matthias.rudolph@hds.com | ||
| 27 | */ | ||
| 28 | { | ||
| 29 | - /* USP-V, HUS VM, VSP, VSP G1X00 and VSP GX00 families */ | ||
| 30 | + /* USP-V, HUS VM, VSP, VSP G1X00 and VSP GX00 families / HP XP */ | ||
| 31 | .vendor = "(HITACHI|HP)", | ||
| 32 | .product = "^OPEN-", | ||
| 33 | .pgpolicy = MULTIBUS, | ||
| 34 | }, | ||
| 35 | { | ||
| 36 | - /* AMS 2000 and HUS 100 families */ | ||
| 37 | + /* AMS other than AMS 2000 */ | ||
| 38 | .vendor = "HITACHI", | ||
| 39 | .product = "^DF", | ||
| 40 | .no_path_retry = NO_PATH_RETRY_QUEUE, | ||
| 41 | @@ -412,6 +412,12 @@ static struct hwentry default_hw[] = { | ||
| 42 | .pgfailback = -FAILBACK_IMMEDIATE, | ||
| 43 | .prio_name = PRIO_HDS, | ||
| 44 | }, | ||
| 45 | + { | ||
| 46 | + /* AMS 2000 and HUS 100 families */ | ||
| 47 | + .vendor = "HITACHI", | ||
| 48 | + .product = "^DF600F", | ||
| 49 | + .pgpolicy = MULTIBUS, | ||
| 50 | + }, | ||
| 51 | /* | ||
| 52 | * IBM | ||
| 53 | * | ||
| 54 | -- | ||
| 55 | 2.7.4 | ||
| 56 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0010-libmultipath-don-t-reject-maps-with-undefined-prio.patch b/meta-oe/recipes-support/multipath-tools/files/0010-libmultipath-don-t-reject-maps-with-undefined-prio.patch deleted file mode 100644 index 2dda2edae5..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0010-libmultipath-don-t-reject-maps-with-undefined-prio.patch +++ /dev/null | |||
| @@ -1,42 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Martin Wilck <mwilck@suse.com> | ||
| 3 | Date: Wed, 21 Mar 2018 10:34:18 +0100 | ||
| 4 | Subject: [PATCH] libmultipath: don't reject maps with undefined prio | ||
| 5 | |||
| 6 | libmultipath's prio routines can deal with pp->priority == PRIO_UNDEF | ||
| 7 | just fine. PRIO_UNDEF is just a very low priority. So there's | ||
| 8 | no reason to reject setting up a multipath map because paths have | ||
| 9 | undefined priority. | ||
| 10 | |||
| 11 | Signed-off-by: Martin Wilck <mwilck@suse.com> | ||
| 12 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 13 | --- | ||
| 14 | libmultipath/configure.c | 5 ----- | ||
| 15 | 1 file changed, 5 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/libmultipath/configure.c b/libmultipath/configure.c | ||
| 18 | index 5796683..5c54f9b 100644 | ||
| 19 | --- a/libmultipath/configure.c | ||
| 20 | +++ b/libmultipath/configure.c | ||
| 21 | @@ -1063,9 +1063,6 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, | ||
| 22 | continue; | ||
| 23 | } | ||
| 24 | |||
| 25 | - if (pp1->priority == PRIO_UNDEF) | ||
| 26 | - mpp->action = ACT_REJECT; | ||
| 27 | - | ||
| 28 | if (!mpp->paths) { | ||
| 29 | condlog(0, "%s: skip coalesce (no paths)", mpp->alias); | ||
| 30 | remove_map(mpp, vecs, 0); | ||
| 31 | @@ -1091,8 +1088,6 @@ int coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, | ||
| 32 | mpp->size); | ||
| 33 | mpp->action = ACT_REJECT; | ||
| 34 | } | ||
| 35 | - if (pp2->priority == PRIO_UNDEF) | ||
| 36 | - mpp->action = ACT_REJECT; | ||
| 37 | } | ||
| 38 | verify_paths(mpp, vecs); | ||
| 39 | |||
| 40 | -- | ||
| 41 | 2.7.4 | ||
| 42 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0011-multipathd-handle-errors-in-uxlsnr-as-fatal.patch b/meta-oe/recipes-support/multipath-tools/files/0011-multipathd-handle-errors-in-uxlsnr-as-fatal.patch deleted file mode 100644 index 96a814ff8b..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0011-multipathd-handle-errors-in-uxlsnr-as-fatal.patch +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Martin Wilck <mwilck@suse.com> | ||
| 3 | Date: Wed, 21 Mar 2018 10:34:19 +0100 | ||
| 4 | Subject: [PATCH] multipathd: handle errors in uxlsnr as fatal | ||
| 5 | |||
| 6 | The ppoll() calls of the uxlsnr thread are vital for proper functioning of | ||
| 7 | multipathd. If the uxlsnr thread can't open the socket or fails to call ppoll() | ||
| 8 | for other reasons, quit the daemon. If we don't do that, multipathd may | ||
| 9 | hang in a state where it can't be terminated any more, because the uxlsnr | ||
| 10 | thread is responsible for handling all signals. This happens e.g. if | ||
| 11 | systemd's multipathd.socket is running in and multipathd is started from | ||
| 12 | outside systemd. | ||
| 13 | |||
| 14 | 24f2844 "multipathd: fix signal blocking logic" has made this problem more | ||
| 15 | severe. Before that patch, the signals weren't actually blocked in any thread. | ||
| 16 | That's not to say 24f2844 was wrong. I still think it's correct, we just | ||
| 17 | need this one on top. | ||
| 18 | |||
| 19 | Signed-off-by: Martin Wilck <mwilck@suse.com> | ||
| 20 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 21 | --- | ||
| 22 | multipathd/uxlsnr.c | 5 +++-- | ||
| 23 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c | ||
| 26 | index cdafd82..6f66666 100644 | ||
| 27 | --- a/multipathd/uxlsnr.c | ||
| 28 | +++ b/multipathd/uxlsnr.c | ||
| 29 | @@ -178,7 +178,7 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, void * trigger_data) | ||
| 30 | |||
| 31 | if (ux_sock == -1) { | ||
| 32 | condlog(1, "could not create uxsock: %d", errno); | ||
| 33 | - return NULL; | ||
| 34 | + exit_daemon(); | ||
| 35 | } | ||
| 36 | |||
| 37 | pthread_cleanup_push(uxsock_cleanup, (void *)ux_sock); | ||
| 38 | @@ -187,7 +187,7 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, void * trigger_data) | ||
| 39 | polls = (struct pollfd *)MALLOC((MIN_POLLS + 1) * sizeof(struct pollfd)); | ||
| 40 | if (!polls) { | ||
| 41 | condlog(0, "uxsock: failed to allocate poll fds"); | ||
| 42 | - return NULL; | ||
| 43 | + exit_daemon(); | ||
| 44 | } | ||
| 45 | sigfillset(&mask); | ||
| 46 | sigdelset(&mask, SIGINT); | ||
| 47 | @@ -249,6 +249,7 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, void * trigger_data) | ||
| 48 | |||
| 49 | /* something went badly wrong! */ | ||
| 50 | condlog(0, "uxsock: poll failed with %d", errno); | ||
| 51 | + exit_daemon(); | ||
| 52 | break; | ||
| 53 | } | ||
| 54 | |||
| 55 | -- | ||
| 56 | 2.7.4 | ||
| 57 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0012-libmultipath-fix-error-parsing-find_multipaths-stric.patch b/meta-oe/recipes-support/multipath-tools/files/0012-libmultipath-fix-error-parsing-find_multipaths-stric.patch deleted file mode 100644 index 8ce2431d60..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0012-libmultipath-fix-error-parsing-find_multipaths-stric.patch +++ /dev/null | |||
| @@ -1,36 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Martin Wilck <mwilck@suse.com> | ||
| 3 | Date: Tue, 15 May 2018 14:32:44 +0200 | ||
| 4 | Subject: [PATCH] libmultipath: fix error parsing "find_multipaths strict" | ||
| 5 | |||
| 6 | If "find_multipaths strict" is set in multipath.conf, the error message | ||
| 7 | "illegal value for find_multipaths: strict" is printed. This causes no | ||
| 8 | functional problem, as "strict" happens to be the default, fallback | ||
| 9 | value. It should be fixed nonetheless. FIND_MULTIPATHS_STRICT, having | ||
| 10 | the highest numeric value, must be last in the enum. | ||
| 11 | |||
| 12 | Fixes: c36f2f42 "libmultipath: change find_multipaths option to multi-value" | ||
| 13 | Signed-off-by: Martin Wilck <mwilck@suse.com> | ||
| 14 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 15 | --- | ||
| 16 | libmultipath/structs.h | 2 +- | ||
| 17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 18 | |||
| 19 | diff --git a/libmultipath/structs.h b/libmultipath/structs.h | ||
| 20 | index eb6a178..e424b15 100644 | ||
| 21 | --- a/libmultipath/structs.h | ||
| 22 | +++ b/libmultipath/structs.h | ||
| 23 | @@ -122,9 +122,9 @@ enum find_multipaths_states { | ||
| 24 | FIND_MULTIPATHS_UNDEF = YNU_UNDEF, | ||
| 25 | FIND_MULTIPATHS_OFF = YNU_NO, | ||
| 26 | FIND_MULTIPATHS_ON = _FIND_MULTIPATHS_F, | ||
| 27 | - FIND_MULTIPATHS_STRICT = _FIND_MULTIPATHS_F|_FIND_MULTIPATHS_N, | ||
| 28 | FIND_MULTIPATHS_GREEDY = _FIND_MULTIPATHS_I, | ||
| 29 | FIND_MULTIPATHS_SMART = _FIND_MULTIPATHS_F|_FIND_MULTIPATHS_I, | ||
| 30 | + FIND_MULTIPATHS_STRICT = _FIND_MULTIPATHS_F|_FIND_MULTIPATHS_N, | ||
| 31 | __FIND_MULTIPATHS_LAST, | ||
| 32 | }; | ||
| 33 | |||
| 34 | -- | ||
| 35 | 2.7.4 | ||
| 36 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0013-libmultipath-print-correct-default-for-delay_-_check.patch b/meta-oe/recipes-support/multipath-tools/files/0013-libmultipath-print-correct-default-for-delay_-_check.patch deleted file mode 100644 index c767804d1a..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0013-libmultipath-print-correct-default-for-delay_-_check.patch +++ /dev/null | |||
| @@ -1,40 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 3 | Date: Mon, 7 May 2018 17:16:05 -0500 | ||
| 4 | Subject: [PATCH] libmultipath: print correct default for delay_*_checks | ||
| 5 | |||
| 6 | These options default to "no", so they should display that when the | ||
| 7 | config is printed. | ||
| 8 | |||
| 9 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 10 | --- | ||
| 11 | libmultipath/dict.c | 6 ++++-- | ||
| 12 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/libmultipath/dict.c b/libmultipath/dict.c | ||
| 15 | index 4040611..3e7c5d6 100644 | ||
| 16 | --- a/libmultipath/dict.c | ||
| 17 | +++ b/libmultipath/dict.c | ||
| 18 | @@ -1115,7 +1115,8 @@ print_off_int_undef(char * buff, int len, long v) | ||
| 19 | } | ||
| 20 | |||
| 21 | declare_def_handler(delay_watch_checks, set_off_int_undef) | ||
| 22 | -declare_def_snprint(delay_watch_checks, print_off_int_undef) | ||
| 23 | +declare_def_snprint_defint(delay_watch_checks, print_off_int_undef, | ||
| 24 | + DEFAULT_DELAY_CHECKS) | ||
| 25 | declare_ovr_handler(delay_watch_checks, set_off_int_undef) | ||
| 26 | declare_ovr_snprint(delay_watch_checks, print_off_int_undef) | ||
| 27 | declare_hw_handler(delay_watch_checks, set_off_int_undef) | ||
| 28 | @@ -1123,7 +1124,8 @@ declare_hw_snprint(delay_watch_checks, print_off_int_undef) | ||
| 29 | declare_mp_handler(delay_watch_checks, set_off_int_undef) | ||
| 30 | declare_mp_snprint(delay_watch_checks, print_off_int_undef) | ||
| 31 | declare_def_handler(delay_wait_checks, set_off_int_undef) | ||
| 32 | -declare_def_snprint(delay_wait_checks, print_off_int_undef) | ||
| 33 | +declare_def_snprint_defint(delay_wait_checks, print_off_int_undef, | ||
| 34 | + DEFAULT_DELAY_CHECKS) | ||
| 35 | declare_ovr_handler(delay_wait_checks, set_off_int_undef) | ||
| 36 | declare_ovr_snprint(delay_wait_checks, print_off_int_undef) | ||
| 37 | declare_hw_handler(delay_wait_checks, set_off_int_undef) | ||
| 38 | -- | ||
| 39 | 2.7.4 | ||
| 40 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0014-multipath.conf.5-clarify-property-whitelist-handling.patch b/meta-oe/recipes-support/multipath-tools/files/0014-multipath.conf.5-clarify-property-whitelist-handling.patch deleted file mode 100644 index 0ab4e06733..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0014-multipath.conf.5-clarify-property-whitelist-handling.patch +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 3 | Date: Wed, 9 May 2018 14:32:59 -0500 | ||
| 4 | Subject: [PATCH] multipath.conf.5: clarify property whitelist handling | ||
| 5 | |||
| 6 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 7 | --- | ||
| 8 | multipath/multipath.conf.5 | 7 +++---- | ||
| 9 | 1 file changed, 3 insertions(+), 4 deletions(-) | ||
| 10 | |||
| 11 | diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 | ||
| 12 | index f689795..96d1b66 100644 | ||
| 13 | --- a/multipath/multipath.conf.5 | ||
| 14 | +++ b/multipath/multipath.conf.5 | ||
| 15 | @@ -1181,10 +1181,9 @@ and | ||
| 16 | keywords. For a full description of these keywords please see the \fIdevices\fR | ||
| 17 | section description. | ||
| 18 | .LP | ||
| 19 | -The \fIproperty\fR blacklist and whitelist handling is different from the usual | ||
| 20 | -handling in the sense that the whitelist \fIhas\fR to be set, otherwise the | ||
| 21 | -device will be blacklisted. In these cases the message \fIblacklisted, udev | ||
| 22 | -property missing\fR will be displayed. | ||
| 23 | +The \fIproperty\fR whitelist handling is different from the usual | ||
| 24 | +handling in the sense that the device \fIhas\fR to have a udev property that | ||
| 25 | +matches the whitelist, otherwise the device will be blacklisted. In these cases the message \fIblacklisted, udev property missing\fR will be displayed. | ||
| 26 | . | ||
| 27 | . | ||
| 28 | .\" ---------------------------------------------------------------------------- | ||
| 29 | -- | ||
| 30 | 2.7.4 | ||
| 31 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0015-mpathpersist-add-all_tg_pt-option.patch b/meta-oe/recipes-support/multipath-tools/files/0015-mpathpersist-add-all_tg_pt-option.patch deleted file mode 100644 index be2681d70e..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0015-mpathpersist-add-all_tg_pt-option.patch +++ /dev/null | |||
| @@ -1,317 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 3 | Date: Thu, 31 May 2018 17:47:11 -0500 | ||
| 4 | Subject: [PATCH] mpathpersist: add all_tg_pt option | ||
| 5 | |||
| 6 | Some arrays, such as the EMC VNX, don't follow the scsi persistent | ||
| 7 | reservations spec in making key registrations per I_T NEXUS. Instead, | ||
| 8 | the registration is shared by all target ports connected to a given | ||
| 9 | host. This causes mpathpersist to fail whenever it tries to register a | ||
| 10 | key, since it will receive a registration conflict on some of the paths. | ||
| 11 | |||
| 12 | To deal with this, mpathpersist needs to track the hosts that it has | ||
| 13 | done a registration on, and only register once per host. The new | ||
| 14 | "all_tg_pt" multipath.conf option is used to set which arrays need this | ||
| 15 | feature. I currently don't know if all EMC VNX arrays handle persistent | ||
| 16 | reservations like this, or if it is configurable. A future patch will | ||
| 17 | update the VNX built-in config, if this is indeed their default (or | ||
| 18 | only) setting. | ||
| 19 | |||
| 20 | Multipathd doesn't need to worry about this. It is often the case that | ||
| 21 | when a path device comes back, it will still have the keys registered to | ||
| 22 | it. Because of this, multipathd uses register-and-ignore, which means | ||
| 23 | that it won't cause an error if the registration has already happened | ||
| 24 | down a different target port. | ||
| 25 | |||
| 26 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 27 | --- | ||
| 28 | libmpathpersist/mpath_persist.c | 28 ++++++++++++++++++++++------ | ||
| 29 | libmultipath/config.c | 2 ++ | ||
| 30 | libmultipath/config.h | 2 ++ | ||
| 31 | libmultipath/defaults.h | 1 + | ||
| 32 | libmultipath/dict.c | 10 ++++++++++ | ||
| 33 | libmultipath/propsel.c | 15 +++++++++++++++ | ||
| 34 | libmultipath/propsel.h | 1 + | ||
| 35 | libmultipath/structs.h | 7 +++++++ | ||
| 36 | multipath/multipath.conf.5 | 11 +++++++++++ | ||
| 37 | 9 files changed, 71 insertions(+), 6 deletions(-) | ||
| 38 | |||
| 39 | diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c | ||
| 40 | index 907a17c..ca91c55 100644 | ||
| 41 | --- a/libmpathpersist/mpath_persist.c | ||
| 42 | +++ b/libmpathpersist/mpath_persist.c | ||
| 43 | @@ -335,6 +335,7 @@ int mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, | ||
| 44 | |||
| 45 | conf = get_multipath_config(); | ||
| 46 | select_reservation_key(conf, mpp); | ||
| 47 | + select_all_tg_pt(conf, mpp); | ||
| 48 | put_multipath_config(conf); | ||
| 49 | |||
| 50 | memcpy(&prkey, paramp->sa_key, 8); | ||
| 51 | @@ -456,7 +457,7 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope, | ||
| 52 | unsigned int rq_type, struct prout_param_descriptor * paramp, int noisy) | ||
| 53 | { | ||
| 54 | |||
| 55 | - int i, j; | ||
| 56 | + int i, j, k; | ||
| 57 | struct pathgroup *pgp = NULL; | ||
| 58 | struct path *pp = NULL; | ||
| 59 | int rollback = 0; | ||
| 60 | @@ -481,11 +482,13 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope, | ||
| 61 | } | ||
| 62 | |||
| 63 | struct threadinfo thread[active_pathcount]; | ||
| 64 | + int hosts[active_pathcount]; | ||
| 65 | |||
| 66 | memset(thread, 0, sizeof(thread)); | ||
| 67 | |||
| 68 | /* init thread parameter */ | ||
| 69 | for (i =0; i< active_pathcount; i++){ | ||
| 70 | + hosts[i] = -1; | ||
| 71 | thread[i].param.rq_servact = rq_servact; | ||
| 72 | thread[i].param.rq_scope = rq_scope; | ||
| 73 | thread[i].param.rq_type = rq_type; | ||
| 74 | @@ -514,6 +517,17 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope, | ||
| 75 | condlog (1, "%s: %s path not up. Skip.", mpp->wwid, pp->dev); | ||
| 76 | continue; | ||
| 77 | } | ||
| 78 | + if (mpp->all_tg_pt == ALL_TG_PT_ON && | ||
| 79 | + pp->sg_id.host_no != -1) { | ||
| 80 | + for (k = 0; k < count; k++) { | ||
| 81 | + if (pp->sg_id.host_no == hosts[k]) { | ||
| 82 | + condlog(3, "%s: %s host %d matches skip.", pp->wwid, pp->dev, pp->sg_id.host_no); | ||
| 83 | + break; | ||
| 84 | + } | ||
| 85 | + } | ||
| 86 | + if (k < count) | ||
| 87 | + continue; | ||
| 88 | + } | ||
| 89 | strncpy(thread[count].param.dev, pp->dev, | ||
| 90 | FILE_NAME_SIZE - 1); | ||
| 91 | |||
| 92 | @@ -531,10 +545,12 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope, | ||
| 93 | condlog (0, "%s: failed to create thread %d", mpp->wwid, rc); | ||
| 94 | thread[count].param.status = MPATH_PR_THREAD_ERROR; | ||
| 95 | } | ||
| 96 | + else | ||
| 97 | + hosts[count] = pp->sg_id.host_no; | ||
| 98 | count = count + 1; | ||
| 99 | } | ||
| 100 | } | ||
| 101 | - for( i=0; i < active_pathcount ; i++){ | ||
| 102 | + for( i=0; i < count ; i++){ | ||
| 103 | if (thread[i].param.status != MPATH_PR_THREAD_ERROR) { | ||
| 104 | rc = pthread_join(thread[i].id, NULL); | ||
| 105 | if (rc){ | ||
| 106 | @@ -557,7 +573,7 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope, | ||
| 107 | } | ||
| 108 | if (rollback && ((rq_servact == MPATH_PROUT_REG_SA) && sa_key != 0 )){ | ||
| 109 | condlog (3, "%s: ERROR: initiating pr out rollback", mpp->wwid); | ||
| 110 | - for( i=0 ; i < active_pathcount ; i++){ | ||
| 111 | + for( i=0 ; i < count ; i++){ | ||
| 112 | if(thread[i].param.status == MPATH_PR_SUCCESS) { | ||
| 113 | memcpy(&thread[i].param.paramp->key, &thread[i].param.paramp->sa_key, 8); | ||
| 114 | memset(&thread[i].param.paramp->sa_key, 0, 8); | ||
| 115 | @@ -571,7 +587,7 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope, | ||
| 116 | } else | ||
| 117 | thread[i].param.status = MPATH_PR_SKIP; | ||
| 118 | } | ||
| 119 | - for(i=0; i < active_pathcount ; i++){ | ||
| 120 | + for(i=0; i < count ; i++){ | ||
| 121 | if (thread[i].param.status != MPATH_PR_SKIP && | ||
| 122 | thread[i].param.status != MPATH_PR_THREAD_ERROR) { | ||
| 123 | rc = pthread_join(thread[i].id, NULL); | ||
| 124 | @@ -720,7 +736,7 @@ int mpath_prout_rel(struct multipath *mpp,int rq_servact, int rq_scope, | ||
| 125 | } | ||
| 126 | } | ||
| 127 | pthread_attr_destroy (&attr); | ||
| 128 | - for (i = 0; i < active_pathcount; i++){ | ||
| 129 | + for (i = 0; i < count; i++){ | ||
| 130 | if (thread[i].param.status != MPATH_PR_THREAD_ERROR) { | ||
| 131 | rc = pthread_join (thread[i].id, NULL); | ||
| 132 | if (rc){ | ||
| 133 | @@ -729,7 +745,7 @@ int mpath_prout_rel(struct multipath *mpp,int rq_servact, int rq_scope, | ||
| 134 | } | ||
| 135 | } | ||
| 136 | |||
| 137 | - for (i = 0; i < active_pathcount; i++){ | ||
| 138 | + for (i = 0; i < count; i++){ | ||
| 139 | /* check thread status here and return the status */ | ||
| 140 | |||
| 141 | if (thread[i].param.status == MPATH_PR_RESERV_CONFLICT) | ||
| 142 | diff --git a/libmultipath/config.c b/libmultipath/config.c | ||
| 143 | index 085a3e1..5872927 100644 | ||
| 144 | --- a/libmultipath/config.c | ||
| 145 | +++ b/libmultipath/config.c | ||
| 146 | @@ -352,6 +352,7 @@ merge_hwe (struct hwentry * dst, struct hwentry * src) | ||
| 147 | merge_num(skip_kpartx); | ||
| 148 | merge_num(max_sectors_kb); | ||
| 149 | merge_num(ghost_delay); | ||
| 150 | + merge_num(all_tg_pt); | ||
| 151 | |||
| 152 | snprintf(id, sizeof(id), "%s/%s", dst->vendor, dst->product); | ||
| 153 | reconcile_features_with_options(id, &dst->features, | ||
| 154 | @@ -622,6 +623,7 @@ load_config (char * file) | ||
| 155 | conf->disable_changed_wwids = DEFAULT_DISABLE_CHANGED_WWIDS; | ||
| 156 | conf->remove_retries = 0; | ||
| 157 | conf->ghost_delay = DEFAULT_GHOST_DELAY; | ||
| 158 | + conf->all_tg_pt = DEFAULT_ALL_TG_PT; | ||
| 159 | |||
| 160 | /* | ||
| 161 | * preload default hwtable | ||
| 162 | diff --git a/libmultipath/config.h b/libmultipath/config.h | ||
| 163 | index 6e69a37..1bf708a 100644 | ||
| 164 | --- a/libmultipath/config.h | ||
| 165 | +++ b/libmultipath/config.h | ||
| 166 | @@ -82,6 +82,7 @@ struct hwentry { | ||
| 167 | int skip_kpartx; | ||
| 168 | int max_sectors_kb; | ||
| 169 | int ghost_delay; | ||
| 170 | + int all_tg_pt; | ||
| 171 | char * bl_product; | ||
| 172 | }; | ||
| 173 | |||
| 174 | @@ -194,6 +195,7 @@ struct config { | ||
| 175 | char * partition_delim; | ||
| 176 | char * config_dir; | ||
| 177 | int prkey_source; | ||
| 178 | + int all_tg_pt; | ||
| 179 | struct be64 reservation_key; | ||
| 180 | |||
| 181 | vector keywords; | ||
| 182 | diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h | ||
| 183 | index d7b87b4..f076b4b 100644 | ||
| 184 | --- a/libmultipath/defaults.h | ||
| 185 | +++ b/libmultipath/defaults.h | ||
| 186 | @@ -43,6 +43,7 @@ | ||
| 187 | #define DEFAULT_GHOST_DELAY GHOST_DELAY_OFF | ||
| 188 | #define DEFAULT_FIND_MULTIPATHS_TIMEOUT -10 | ||
| 189 | #define DEFAULT_UNKNOWN_FIND_MULTIPATHS_TIMEOUT 1 | ||
| 190 | +#define DEFAULT_ALL_TG_PT ALL_TG_PT_OFF | ||
| 191 | |||
| 192 | #define DEFAULT_CHECKINT 5 | ||
| 193 | #define MAX_CHECKINT(a) (a << 2) | ||
| 194 | diff --git a/libmultipath/dict.c b/libmultipath/dict.c | ||
| 195 | index 3e7c5d6..2557b8a 100644 | ||
| 196 | --- a/libmultipath/dict.c | ||
| 197 | +++ b/libmultipath/dict.c | ||
| 198 | @@ -1178,6 +1178,13 @@ declare_hw_snprint(ghost_delay, print_off_int_undef) | ||
| 199 | declare_mp_handler(ghost_delay, set_off_int_undef) | ||
| 200 | declare_mp_snprint(ghost_delay, print_off_int_undef) | ||
| 201 | |||
| 202 | +declare_def_handler(all_tg_pt, set_yes_no_undef) | ||
| 203 | +declare_def_snprint_defint(all_tg_pt, print_yes_no_undef, DEFAULT_ALL_TG_PT) | ||
| 204 | +declare_ovr_handler(all_tg_pt, set_yes_no_undef) | ||
| 205 | +declare_ovr_snprint(all_tg_pt, print_yes_no_undef) | ||
| 206 | +declare_hw_handler(all_tg_pt, set_yes_no_undef) | ||
| 207 | +declare_hw_snprint(all_tg_pt, print_yes_no_undef) | ||
| 208 | + | ||
| 209 | |||
| 210 | static int | ||
| 211 | def_uxsock_timeout_handler(struct config *conf, vector strvec) | ||
| 212 | @@ -1509,6 +1516,7 @@ init_keywords(vector keywords) | ||
| 213 | install_keyword("prkeys_file", &def_prkeys_file_handler, &snprint_def_prkeys_file); | ||
| 214 | install_keyword("log_checker_err", &def_log_checker_err_handler, &snprint_def_log_checker_err); | ||
| 215 | install_keyword("reservation_key", &def_reservation_key_handler, &snprint_def_reservation_key); | ||
| 216 | + install_keyword("all_tg_pt", &def_all_tg_pt_handler, &snprint_def_all_tg_pt); | ||
| 217 | install_keyword("retain_attached_hw_handler", &def_retain_hwhandler_handler, &snprint_def_retain_hwhandler); | ||
| 218 | install_keyword("detect_prio", &def_detect_prio_handler, &snprint_def_detect_prio); | ||
| 219 | install_keyword("detect_checker", &def_detect_checker_handler, &snprint_def_detect_checker); | ||
| 220 | @@ -1618,6 +1626,7 @@ init_keywords(vector keywords) | ||
| 221 | install_keyword("skip_kpartx", &hw_skip_kpartx_handler, &snprint_hw_skip_kpartx); | ||
| 222 | install_keyword("max_sectors_kb", &hw_max_sectors_kb_handler, &snprint_hw_max_sectors_kb); | ||
| 223 | install_keyword("ghost_delay", &hw_ghost_delay_handler, &snprint_hw_ghost_delay); | ||
| 224 | + install_keyword("all_tg_pt", &hw_all_tg_pt_handler, &snprint_hw_all_tg_pt); | ||
| 225 | install_sublevel_end(); | ||
| 226 | |||
| 227 | install_keyword_root("overrides", &overrides_handler); | ||
| 228 | @@ -1654,6 +1663,7 @@ init_keywords(vector keywords) | ||
| 229 | install_keyword("skip_kpartx", &ovr_skip_kpartx_handler, &snprint_ovr_skip_kpartx); | ||
| 230 | install_keyword("max_sectors_kb", &ovr_max_sectors_kb_handler, &snprint_ovr_max_sectors_kb); | ||
| 231 | install_keyword("ghost_delay", &ovr_ghost_delay_handler, &snprint_ovr_ghost_delay); | ||
| 232 | + install_keyword("all_tg_pt", &ovr_all_tg_pt_handler, &snprint_ovr_all_tg_pt); | ||
| 233 | |||
| 234 | install_keyword_root("multipaths", &multipaths_handler); | ||
| 235 | install_keyword_multi("multipath", &multipath_handler, NULL); | ||
| 236 | diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c | ||
| 237 | index 627d366..9ca1355 100644 | ||
| 238 | --- a/libmultipath/propsel.c | ||
| 239 | +++ b/libmultipath/propsel.c | ||
| 240 | @@ -978,3 +978,18 @@ out: | ||
| 241 | pp->dev, pp->find_multipaths_timeout, origin); | ||
| 242 | return 0; | ||
| 243 | } | ||
| 244 | + | ||
| 245 | +int select_all_tg_pt (struct config *conf, struct multipath * mp) | ||
| 246 | +{ | ||
| 247 | + const char *origin; | ||
| 248 | + | ||
| 249 | + mp_set_ovr(all_tg_pt); | ||
| 250 | + mp_set_hwe(all_tg_pt); | ||
| 251 | + mp_set_conf(all_tg_pt); | ||
| 252 | + mp_set_default(all_tg_pt, DEFAULT_ALL_TG_PT); | ||
| 253 | +out: | ||
| 254 | + condlog(3, "%s: all_tg_pt = %s %s", mp->alias, | ||
| 255 | + (mp->all_tg_pt == ALL_TG_PT_ON)? "yes" : "no", | ||
| 256 | + origin); | ||
| 257 | + return 0; | ||
| 258 | +} | ||
| 259 | diff --git a/libmultipath/propsel.h b/libmultipath/propsel.h | ||
| 260 | index a022bee..ae99b92 100644 | ||
| 261 | --- a/libmultipath/propsel.h | ||
| 262 | +++ b/libmultipath/propsel.h | ||
| 263 | @@ -34,3 +34,4 @@ int select_ghost_delay(struct config *conf, struct multipath * mp); | ||
| 264 | void reconcile_features_with_options(const char *id, char **features, | ||
| 265 | int* no_path_retry, | ||
| 266 | int *retain_hwhandler); | ||
| 267 | +int select_all_tg_pt (struct config *conf, struct multipath * mp); | ||
| 268 | diff --git a/libmultipath/structs.h b/libmultipath/structs.h | ||
| 269 | index e424b15..0194b1e 100644 | ||
| 270 | --- a/libmultipath/structs.h | ||
| 271 | +++ b/libmultipath/structs.h | ||
| 272 | @@ -217,6 +217,12 @@ enum prkey_sources { | ||
| 273 | PRKEY_SOURCE_FILE, | ||
| 274 | }; | ||
| 275 | |||
| 276 | +enum all_tg_pt_states { | ||
| 277 | + ALL_TG_PT_UNDEF = YNU_UNDEF, | ||
| 278 | + ALL_TG_PT_OFF = YNU_NO, | ||
| 279 | + ALL_TG_PT_ON = YNU_YES, | ||
| 280 | +}; | ||
| 281 | + | ||
| 282 | struct sg_id { | ||
| 283 | int host_no; | ||
| 284 | int channel; | ||
| 285 | @@ -362,6 +368,7 @@ struct multipath { | ||
| 286 | int prkey_source; | ||
| 287 | struct be64 reservation_key; | ||
| 288 | unsigned char prflag; | ||
| 289 | + int all_tg_pt; | ||
| 290 | struct gen_multipath generic_mp; | ||
| 291 | }; | ||
| 292 | |||
| 293 | diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 | ||
| 294 | index 96d1b66..0c1f174 100644 | ||
| 295 | --- a/multipath/multipath.conf.5 | ||
| 296 | +++ b/multipath/multipath.conf.5 | ||
| 297 | @@ -743,6 +743,17 @@ The default is: \fB<unset>\fR | ||
| 298 | . | ||
| 299 | . | ||
| 300 | .TP | ||
| 301 | +.B all_tg_pt | ||
| 302 | +This must be set to \fByes\fR to successfully use mpathpersist on arrays that | ||
| 303 | +automatically set and clear registration keys on all target ports from a | ||
| 304 | +host, instead of per target port per host. | ||
| 305 | +.RS | ||
| 306 | +.TP | ||
| 307 | +The default is: \fBno\fR | ||
| 308 | +.RE | ||
| 309 | +. | ||
| 310 | +. | ||
| 311 | +.TP | ||
| 312 | .B retain_attached_hw_handler | ||
| 313 | (Obsolete for kernels >= 4.3) If set to | ||
| 314 | .I yes | ||
| 315 | -- | ||
| 316 | 2.7.4 | ||
| 317 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0016-libmultipath-remove-rbd-code.patch b/meta-oe/recipes-support/multipath-tools/files/0016-libmultipath-remove-rbd-code.patch deleted file mode 100644 index 8d1954725c..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0016-libmultipath-remove-rbd-code.patch +++ /dev/null | |||
| @@ -1,1093 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 3 | Date: Fri, 1 Jun 2018 16:30:44 -0500 | ||
| 4 | Subject: [PATCH] libmultipath: remove rbd code | ||
| 5 | |||
| 6 | The Ceph tean has asked to drop support for multipathed rbd, since it | ||
| 7 | was running into data corruption issues. There was never an upstream | ||
| 8 | Ceph release based on it, and because of the corruption, there should be | ||
| 9 | no users of this code. This patch simply reverts all the rbd code from | ||
| 10 | multipath. | ||
| 11 | |||
| 12 | Cc: Michael Christie <mchristi@redhat.com> | ||
| 13 | Cc: Jason Dillaman <dillaman@redhat.com> | ||
| 14 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 15 | --- | ||
| 16 | libmultipath/checkers.c | 22 -- | ||
| 17 | libmultipath/checkers.h | 6 - | ||
| 18 | libmultipath/checkers/Makefile | 7 - | ||
| 19 | libmultipath/checkers/cciss_tur.c | 5 - | ||
| 20 | libmultipath/checkers/directio.c | 5 - | ||
| 21 | libmultipath/checkers/emc_clariion.c | 5 - | ||
| 22 | libmultipath/checkers/hp_sw.c | 5 - | ||
| 23 | libmultipath/checkers/rbd.c | 653 ----------------------------------- | ||
| 24 | libmultipath/checkers/rdac.c | 5 - | ||
| 25 | libmultipath/checkers/readsector0.c | 5 - | ||
| 26 | libmultipath/checkers/tur.c | 5 - | ||
| 27 | libmultipath/discovery.c | 70 ---- | ||
| 28 | libmultipath/hwtable.c | 12 - | ||
| 29 | multipath/multipath.conf.5 | 3 - | ||
| 30 | multipathd/main.c | 11 - | ||
| 31 | 15 files changed, 819 deletions(-) | ||
| 32 | delete mode 100644 libmultipath/checkers/rbd.c | ||
| 33 | |||
| 34 | diff --git a/libmultipath/checkers.c b/libmultipath/checkers.c | ||
| 35 | index 08cdfc3..0bacc86 100644 | ||
| 36 | --- a/libmultipath/checkers.c | ||
| 37 | +++ b/libmultipath/checkers.c | ||
| 38 | @@ -141,13 +141,6 @@ struct checker * add_checker (char *multipath_dir, char * name) | ||
| 39 | if (!c->free) | ||
| 40 | goto out; | ||
| 41 | |||
| 42 | - c->repair = (void (*)(struct checker *)) dlsym(c->handle, | ||
| 43 | - "libcheck_repair"); | ||
| 44 | - errstr = dlerror(); | ||
| 45 | - if (errstr != NULL) | ||
| 46 | - condlog(0, "A dynamic linking error occurred: (%s)", errstr); | ||
| 47 | - if (!c->repair) | ||
| 48 | - goto out; | ||
| 49 | done: | ||
| 50 | c->fd = -1; | ||
| 51 | c->sync = 1; | ||
| 52 | @@ -222,20 +215,6 @@ void checker_put (struct checker * dst) | ||
| 53 | free_checker(src); | ||
| 54 | } | ||
| 55 | |||
| 56 | -void checker_repair (struct checker * c) | ||
| 57 | -{ | ||
| 58 | - if (!checker_selected(c)) | ||
| 59 | - return; | ||
| 60 | - | ||
| 61 | - c->message[0] = '\0'; | ||
| 62 | - if (c->disable) { | ||
| 63 | - MSG(c, "checker disabled"); | ||
| 64 | - return; | ||
| 65 | - } | ||
| 66 | - if (c->repair) | ||
| 67 | - c->repair(c); | ||
| 68 | -} | ||
| 69 | - | ||
| 70 | int checker_check (struct checker * c, int path_state) | ||
| 71 | { | ||
| 72 | int r; | ||
| 73 | @@ -310,7 +289,6 @@ void checker_get (char *multipath_dir, struct checker * dst, char * name) | ||
| 74 | dst->sync = src->sync; | ||
| 75 | strncpy(dst->name, src->name, CHECKER_NAME_LEN); | ||
| 76 | strncpy(dst->message, src->message, CHECKER_MSG_LEN); | ||
| 77 | - dst->repair = src->repair; | ||
| 78 | dst->check = src->check; | ||
| 79 | dst->init = src->init; | ||
| 80 | dst->free = src->free; | ||
| 81 | diff --git a/libmultipath/checkers.h b/libmultipath/checkers.h | ||
| 82 | index 52154ca..7b18a1a 100644 | ||
| 83 | --- a/libmultipath/checkers.h | ||
| 84 | +++ b/libmultipath/checkers.h | ||
| 85 | @@ -86,7 +86,6 @@ enum path_check_state { | ||
| 86 | #define READSECTOR0 "readsector0" | ||
| 87 | #define CCISS_TUR "cciss_tur" | ||
| 88 | #define NONE "none" | ||
| 89 | -#define RBD "rbd" | ||
| 90 | |||
| 91 | #define ASYNC_TIMEOUT_SEC 30 | ||
| 92 | |||
| 93 | @@ -113,9 +112,6 @@ struct checker { | ||
| 94 | multipath-wide. Use MALLOC if | ||
| 95 | you want to stuff data in. */ | ||
| 96 | int (*check)(struct checker *); | ||
| 97 | - void (*repair)(struct checker *); /* called if check returns | ||
| 98 | - PATH_DOWN to bring path into | ||
| 99 | - usable state */ | ||
| 100 | int (*init)(struct checker *); /* to allocate the context */ | ||
| 101 | void (*free)(struct checker *); /* to free the context */ | ||
| 102 | }; | ||
| 103 | @@ -136,7 +132,6 @@ void checker_set_async (struct checker *); | ||
| 104 | void checker_set_fd (struct checker *, int); | ||
| 105 | void checker_enable (struct checker *); | ||
| 106 | void checker_disable (struct checker *); | ||
| 107 | -void checker_repair (struct checker *); | ||
| 108 | int checker_check (struct checker *, int); | ||
| 109 | int checker_selected (struct checker *); | ||
| 110 | char * checker_name (struct checker *); | ||
| 111 | @@ -148,6 +143,5 @@ void checker_get (char *, struct checker *, char *); | ||
| 112 | int libcheck_check(struct checker *); | ||
| 113 | int libcheck_init(struct checker *); | ||
| 114 | void libcheck_free(struct checker *); | ||
| 115 | -void libcheck_repair(struct checker *); | ||
| 116 | |||
| 117 | #endif /* _CHECKERS_H */ | ||
| 118 | diff --git a/libmultipath/checkers/Makefile b/libmultipath/checkers/Makefile | ||
| 119 | index 87c15bd..02caea6 100644 | ||
| 120 | --- a/libmultipath/checkers/Makefile | ||
| 121 | +++ b/libmultipath/checkers/Makefile | ||
| 122 | @@ -15,15 +15,8 @@ LIBS= \ | ||
| 123 | libcheckhp_sw.so \ | ||
| 124 | libcheckrdac.so | ||
| 125 | |||
| 126 | -ifneq ($(call check_file,/usr/include/rados/librados.h),0) | ||
| 127 | -LIBS += libcheckrbd.so | ||
| 128 | -endif | ||
| 129 | - | ||
| 130 | all: $(LIBS) | ||
| 131 | |||
| 132 | -libcheckrbd.so: rbd.o | ||
| 133 | - $(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^ -lrados -ludev | ||
| 134 | - | ||
| 135 | libcheckdirectio.so: libsg.o directio.o | ||
| 136 | $(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^ -laio | ||
| 137 | |||
| 138 | diff --git a/libmultipath/checkers/cciss_tur.c b/libmultipath/checkers/cciss_tur.c | ||
| 139 | index 436470c..1cab201 100644 | ||
| 140 | --- a/libmultipath/checkers/cciss_tur.c | ||
| 141 | +++ b/libmultipath/checkers/cciss_tur.c | ||
| 142 | @@ -59,11 +59,6 @@ void libcheck_free (struct checker * c) | ||
| 143 | return; | ||
| 144 | } | ||
| 145 | |||
| 146 | -void libcheck_repair (struct checker * c) | ||
| 147 | -{ | ||
| 148 | - return; | ||
| 149 | -} | ||
| 150 | - | ||
| 151 | int libcheck_check(struct checker * c) | ||
| 152 | { | ||
| 153 | int rc; | ||
| 154 | diff --git a/libmultipath/checkers/directio.c b/libmultipath/checkers/directio.c | ||
| 155 | index ce60e4c..a80848d 100644 | ||
| 156 | --- a/libmultipath/checkers/directio.c | ||
| 157 | +++ b/libmultipath/checkers/directio.c | ||
| 158 | @@ -118,11 +118,6 @@ void libcheck_free (struct checker * c) | ||
| 159 | free(ct); | ||
| 160 | } | ||
| 161 | |||
| 162 | -void libcheck_repair (struct checker * c) | ||
| 163 | -{ | ||
| 164 | - return; | ||
| 165 | -} | ||
| 166 | - | ||
| 167 | static int | ||
| 168 | check_state(int fd, struct directio_context *ct, int sync, int timeout_secs) | ||
| 169 | { | ||
| 170 | diff --git a/libmultipath/checkers/emc_clariion.c b/libmultipath/checkers/emc_clariion.c | ||
| 171 | index 9c1ffed..9115b1b 100644 | ||
| 172 | --- a/libmultipath/checkers/emc_clariion.c | ||
| 173 | +++ b/libmultipath/checkers/emc_clariion.c | ||
| 174 | @@ -90,11 +90,6 @@ void libcheck_free (struct checker * c) | ||
| 175 | free(c->context); | ||
| 176 | } | ||
| 177 | |||
| 178 | -void libcheck_repair (struct checker * c) | ||
| 179 | -{ | ||
| 180 | - return; | ||
| 181 | -} | ||
| 182 | - | ||
| 183 | int libcheck_check (struct checker * c) | ||
| 184 | { | ||
| 185 | unsigned char sense_buffer[128] = { 0, }; | ||
| 186 | diff --git a/libmultipath/checkers/hp_sw.c b/libmultipath/checkers/hp_sw.c | ||
| 187 | index cee9aab..0ad34a6 100644 | ||
| 188 | --- a/libmultipath/checkers/hp_sw.c | ||
| 189 | +++ b/libmultipath/checkers/hp_sw.c | ||
| 190 | @@ -45,11 +45,6 @@ void libcheck_free (struct checker * c) | ||
| 191 | return; | ||
| 192 | } | ||
| 193 | |||
| 194 | -void libcheck_repair (struct checker * c) | ||
| 195 | -{ | ||
| 196 | - return; | ||
| 197 | -} | ||
| 198 | - | ||
| 199 | static int | ||
| 200 | do_inq(int sg_fd, int cmddt, int evpd, unsigned int pg_op, | ||
| 201 | void *resp, int mx_resp_len, int noisy, unsigned int timeout) | ||
| 202 | diff --git a/libmultipath/checkers/rbd.c b/libmultipath/checkers/rbd.c | ||
| 203 | deleted file mode 100644 | ||
| 204 | index 4ff54f4..0000000 | ||
| 205 | --- a/libmultipath/checkers/rbd.c | ||
| 206 | +++ /dev/null | ||
| 207 | @@ -1,653 +0,0 @@ | ||
| 208 | -/* | ||
| 209 | - * Copyright (c) 2016 Red Hat | ||
| 210 | - * Copyright (c) 2004 Christophe Varoqui | ||
| 211 | - * | ||
| 212 | - * Code based off of tur.c and ceph's krbd.cc | ||
| 213 | - */ | ||
| 214 | -#define _GNU_SOURCE | ||
| 215 | -#include <stdio.h> | ||
| 216 | -#include <stdlib.h> | ||
| 217 | -#include <string.h> | ||
| 218 | -#include <unistd.h> | ||
| 219 | -#include <fcntl.h> | ||
| 220 | -#include <errno.h> | ||
| 221 | -#include <pthread.h> | ||
| 222 | -#include <libudev.h> | ||
| 223 | -#include <ifaddrs.h> | ||
| 224 | -#include <sys/types.h> | ||
| 225 | -#include <sys/stat.h> | ||
| 226 | -#include <sys/ioctl.h> | ||
| 227 | -#include <sys/time.h> | ||
| 228 | -#include <sys/wait.h> | ||
| 229 | -#include <urcu.h> | ||
| 230 | - | ||
| 231 | -#include "rados/librados.h" | ||
| 232 | - | ||
| 233 | -#include "structs.h" | ||
| 234 | -#include "checkers.h" | ||
| 235 | - | ||
| 236 | -#include "../libmultipath/debug.h" | ||
| 237 | -#include "../libmultipath/util.h" | ||
| 238 | -#include "../libmultipath/time-util.h" | ||
| 239 | -#include "../libmultipath/util.h" | ||
| 240 | - | ||
| 241 | -struct rbd_checker_context; | ||
| 242 | -typedef int (thread_fn)(struct rbd_checker_context *ct, char *msg); | ||
| 243 | - | ||
| 244 | -#define RBD_MSG(msg, fmt, args...) snprintf(msg, CHECKER_MSG_LEN, fmt, ##args); | ||
| 245 | - | ||
| 246 | -#define RBD_FEATURE_EXCLUSIVE_LOCK (1 << 2) | ||
| 247 | - | ||
| 248 | -struct rbd_checker_context { | ||
| 249 | - int rbd_bus_id; | ||
| 250 | - char *client_addr; | ||
| 251 | - char *config_info; | ||
| 252 | - char *snap; | ||
| 253 | - char *pool; | ||
| 254 | - char *image; | ||
| 255 | - char *username; | ||
| 256 | - int remapped; | ||
| 257 | - int blacklisted; | ||
| 258 | - unsigned lock_on_read:1; | ||
| 259 | - | ||
| 260 | - rados_t cluster; | ||
| 261 | - | ||
| 262 | - int state; | ||
| 263 | - int running; | ||
| 264 | - time_t time; | ||
| 265 | - thread_fn *fn; | ||
| 266 | - pthread_t thread; | ||
| 267 | - pthread_mutex_t lock; | ||
| 268 | - pthread_cond_t active; | ||
| 269 | - pthread_spinlock_t hldr_lock; | ||
| 270 | - int holders; | ||
| 271 | - char message[CHECKER_MSG_LEN]; | ||
| 272 | -}; | ||
| 273 | - | ||
| 274 | -int libcheck_init(struct checker * c) | ||
| 275 | -{ | ||
| 276 | - struct rbd_checker_context *ct; | ||
| 277 | - struct udev_device *block_dev; | ||
| 278 | - struct udev_device *bus_dev; | ||
| 279 | - struct udev *udev; | ||
| 280 | - struct stat sb; | ||
| 281 | - const char *block_name, *addr, *config_info, *features_str; | ||
| 282 | - const char *image, *pool, *snap, *username; | ||
| 283 | - uint64_t features = 0; | ||
| 284 | - char sysfs_path[PATH_SIZE]; | ||
| 285 | - int ret; | ||
| 286 | - | ||
| 287 | - ct = malloc(sizeof(struct rbd_checker_context)); | ||
| 288 | - if (!ct) | ||
| 289 | - return 1; | ||
| 290 | - memset(ct, 0, sizeof(struct rbd_checker_context)); | ||
| 291 | - ct->holders = 1; | ||
| 292 | - pthread_cond_init_mono(&ct->active); | ||
| 293 | - pthread_mutex_init(&ct->lock, NULL); | ||
| 294 | - pthread_spin_init(&ct->hldr_lock, PTHREAD_PROCESS_PRIVATE); | ||
| 295 | - c->context = ct; | ||
| 296 | - | ||
| 297 | - /* | ||
| 298 | - * The rbd block layer sysfs device is not linked to the rbd bus | ||
| 299 | - * device that we interact with, so figure that out now. | ||
| 300 | - */ | ||
| 301 | - if (fstat(c->fd, &sb) != 0) | ||
| 302 | - goto free_ct; | ||
| 303 | - | ||
| 304 | - udev = udev_new(); | ||
| 305 | - if (!udev) | ||
| 306 | - goto free_ct; | ||
| 307 | - | ||
| 308 | - block_dev = udev_device_new_from_devnum(udev, 'b', sb.st_rdev); | ||
| 309 | - if (!block_dev) | ||
| 310 | - goto free_udev; | ||
| 311 | - | ||
| 312 | - block_name = udev_device_get_sysname(block_dev); | ||
| 313 | - ret = sscanf(block_name, "rbd%d", &ct->rbd_bus_id); | ||
| 314 | - | ||
| 315 | - udev_device_unref(block_dev); | ||
| 316 | - if (ret != 1) | ||
| 317 | - goto free_udev; | ||
| 318 | - | ||
| 319 | - snprintf(sysfs_path, sizeof(sysfs_path), "/sys/bus/rbd/devices/%d", | ||
| 320 | - ct->rbd_bus_id); | ||
| 321 | - bus_dev = udev_device_new_from_syspath(udev, sysfs_path); | ||
| 322 | - if (!bus_dev) | ||
| 323 | - goto free_udev; | ||
| 324 | - | ||
| 325 | - addr = udev_device_get_sysattr_value(bus_dev, "client_addr"); | ||
| 326 | - if (!addr) { | ||
| 327 | - condlog(0, "rbd%d: Could not find client_addr in rbd sysfs. " | ||
| 328 | - "Try updating kernel", ct->rbd_bus_id); | ||
| 329 | - goto free_dev; | ||
| 330 | - } | ||
| 331 | - | ||
| 332 | - ct->client_addr = strdup(addr); | ||
| 333 | - if (!ct->client_addr) | ||
| 334 | - goto free_dev; | ||
| 335 | - | ||
| 336 | - features_str = udev_device_get_sysattr_value(bus_dev, "features"); | ||
| 337 | - if (!features_str) | ||
| 338 | - goto free_addr; | ||
| 339 | - features = strtoll(features_str, NULL, 16); | ||
| 340 | - if (!(features & RBD_FEATURE_EXCLUSIVE_LOCK)) { | ||
| 341 | - condlog(3, "rbd%d: Exclusive lock not set.", ct->rbd_bus_id); | ||
| 342 | - goto free_addr; | ||
| 343 | - } | ||
| 344 | - | ||
| 345 | - config_info = udev_device_get_sysattr_value(bus_dev, "config_info"); | ||
| 346 | - if (!config_info) | ||
| 347 | - goto free_addr; | ||
| 348 | - | ||
| 349 | - if (!strstr(config_info, "noshare")) { | ||
| 350 | - condlog(3, "rbd%d: Only nonshared clients supported.", | ||
| 351 | - ct->rbd_bus_id); | ||
| 352 | - goto free_addr; | ||
| 353 | - } | ||
| 354 | - | ||
| 355 | - if (strstr(config_info, "lock_on_read")) | ||
| 356 | - ct->lock_on_read = 1; | ||
| 357 | - | ||
| 358 | - ct->config_info = strdup(config_info); | ||
| 359 | - if (!ct->config_info) | ||
| 360 | - goto free_addr; | ||
| 361 | - | ||
| 362 | - username = strstr(config_info, "name="); | ||
| 363 | - if (username) { | ||
| 364 | - char *end; | ||
| 365 | - int len; | ||
| 366 | - | ||
| 367 | - username += 5; | ||
| 368 | - end = strchr(username, ','); | ||
| 369 | - if (!end) | ||
| 370 | - goto free_info; | ||
| 371 | - len = end - username; | ||
| 372 | - | ||
| 373 | - ct->username = malloc(len + 1); | ||
| 374 | - if (!ct->username) | ||
| 375 | - goto free_info; | ||
| 376 | - strncpy(ct->username, username, len); | ||
| 377 | - ct->username[len] = '\0'; | ||
| 378 | - } | ||
| 379 | - | ||
| 380 | - image = udev_device_get_sysattr_value(bus_dev, "name"); | ||
| 381 | - if (!image) | ||
| 382 | - goto free_username; | ||
| 383 | - | ||
| 384 | - ct->image = strdup(image); | ||
| 385 | - if (!ct->image) | ||
| 386 | - goto free_username; | ||
| 387 | - | ||
| 388 | - pool = udev_device_get_sysattr_value(bus_dev, "pool"); | ||
| 389 | - if (!pool) | ||
| 390 | - goto free_image; | ||
| 391 | - | ||
| 392 | - ct->pool = strdup(pool); | ||
| 393 | - if (!ct->pool) | ||
| 394 | - goto free_image; | ||
| 395 | - | ||
| 396 | - snap = udev_device_get_sysattr_value(bus_dev, "current_snap"); | ||
| 397 | - if (!snap) | ||
| 398 | - goto free_pool; | ||
| 399 | - | ||
| 400 | - if (strcmp("-", snap)) { | ||
| 401 | - ct->snap = strdup(snap); | ||
| 402 | - if (!ct->snap) | ||
| 403 | - goto free_pool; | ||
| 404 | - } | ||
| 405 | - | ||
| 406 | - if (rados_create(&ct->cluster, NULL) < 0) { | ||
| 407 | - condlog(0, "rbd%d: Could not create rados cluster", | ||
| 408 | - ct->rbd_bus_id); | ||
| 409 | - goto free_snap; | ||
| 410 | - } | ||
| 411 | - | ||
| 412 | - if (rados_conf_read_file(ct->cluster, NULL) < 0) { | ||
| 413 | - condlog(0, "rbd%d: Could not read rados conf", ct->rbd_bus_id); | ||
| 414 | - goto shutdown_rados; | ||
| 415 | - } | ||
| 416 | - | ||
| 417 | - ret = rados_connect(ct->cluster); | ||
| 418 | - if (ret < 0) { | ||
| 419 | - condlog(0, "rbd%d: Could not connect to rados cluster", | ||
| 420 | - ct->rbd_bus_id); | ||
| 421 | - goto shutdown_rados; | ||
| 422 | - } | ||
| 423 | - | ||
| 424 | - udev_device_unref(bus_dev); | ||
| 425 | - udev_unref(udev); | ||
| 426 | - | ||
| 427 | - condlog(3, "rbd%d checker init %s %s/%s@%s %s", ct->rbd_bus_id, | ||
| 428 | - ct->client_addr, ct->pool, ct->image, ct->snap ? ct->snap : "-", | ||
| 429 | - ct->username ? ct->username : "none"); | ||
| 430 | - return 0; | ||
| 431 | - | ||
| 432 | -shutdown_rados: | ||
| 433 | - rados_shutdown(ct->cluster); | ||
| 434 | -free_snap: | ||
| 435 | - if (ct->snap) | ||
| 436 | - free(ct->snap); | ||
| 437 | -free_pool: | ||
| 438 | - free(ct->pool); | ||
| 439 | -free_image: | ||
| 440 | - free(ct->image); | ||
| 441 | -free_username: | ||
| 442 | - if (ct->username) | ||
| 443 | - free(ct->username); | ||
| 444 | -free_info: | ||
| 445 | - free(ct->config_info); | ||
| 446 | -free_addr: | ||
| 447 | - free(ct->client_addr); | ||
| 448 | -free_dev: | ||
| 449 | - udev_device_unref(bus_dev); | ||
| 450 | -free_udev: | ||
| 451 | - udev_unref(udev); | ||
| 452 | -free_ct: | ||
| 453 | - free(ct); | ||
| 454 | - return 1; | ||
| 455 | -} | ||
| 456 | - | ||
| 457 | -static void cleanup_context(struct rbd_checker_context *ct) | ||
| 458 | -{ | ||
| 459 | - pthread_mutex_destroy(&ct->lock); | ||
| 460 | - pthread_cond_destroy(&ct->active); | ||
| 461 | - pthread_spin_destroy(&ct->hldr_lock); | ||
| 462 | - | ||
| 463 | - rados_shutdown(ct->cluster); | ||
| 464 | - | ||
| 465 | - if (ct->username) | ||
| 466 | - free(ct->username); | ||
| 467 | - if (ct->snap) | ||
| 468 | - free(ct->snap); | ||
| 469 | - free(ct->pool); | ||
| 470 | - free(ct->image); | ||
| 471 | - free(ct->config_info); | ||
| 472 | - free(ct->client_addr); | ||
| 473 | - free(ct); | ||
| 474 | -} | ||
| 475 | - | ||
| 476 | -void libcheck_free(struct checker * c) | ||
| 477 | -{ | ||
| 478 | - if (c->context) { | ||
| 479 | - struct rbd_checker_context *ct = c->context; | ||
| 480 | - int holders; | ||
| 481 | - pthread_t thread; | ||
| 482 | - | ||
| 483 | - pthread_spin_lock(&ct->hldr_lock); | ||
| 484 | - ct->holders--; | ||
| 485 | - holders = ct->holders; | ||
| 486 | - thread = ct->thread; | ||
| 487 | - pthread_spin_unlock(&ct->hldr_lock); | ||
| 488 | - if (holders) | ||
| 489 | - pthread_cancel(thread); | ||
| 490 | - else | ||
| 491 | - cleanup_context(ct); | ||
| 492 | - c->context = NULL; | ||
| 493 | - } | ||
| 494 | -} | ||
| 495 | - | ||
| 496 | -static int rbd_is_blacklisted(struct rbd_checker_context *ct, char *msg) | ||
| 497 | -{ | ||
| 498 | - char *addr_tok, *start, *save; | ||
| 499 | - const char *cmd[2]; | ||
| 500 | - char *blklist, *stat; | ||
| 501 | - size_t blklist_len, stat_len; | ||
| 502 | - int ret; | ||
| 503 | - char *end; | ||
| 504 | - | ||
| 505 | - cmd[0] = "{\"prefix\": \"osd blacklist ls\"}"; | ||
| 506 | - cmd[1] = NULL; | ||
| 507 | - | ||
| 508 | - ret = rados_mon_command(ct->cluster, (const char **)cmd, 1, "", 0, | ||
| 509 | - &blklist, &blklist_len, &stat, &stat_len); | ||
| 510 | - if (ret < 0) { | ||
| 511 | - RBD_MSG(msg, "checker failed: mon command failed %d", ret); | ||
| 512 | - return ret; | ||
| 513 | - } | ||
| 514 | - | ||
| 515 | - if (!blklist || !blklist_len) | ||
| 516 | - goto free_bufs; | ||
| 517 | - | ||
| 518 | - /* | ||
| 519 | - * parse list of addrs with the format | ||
| 520 | - * ipv4:port/nonce date time\n | ||
| 521 | - * or | ||
| 522 | - * [ipv6]:port/nonce date time\n | ||
| 523 | - */ | ||
| 524 | - ret = 0; | ||
| 525 | - for (start = blklist; ; start = NULL) { | ||
| 526 | - addr_tok = strtok_r(start, "\n", &save); | ||
| 527 | - if (!addr_tok || !strlen(addr_tok)) | ||
| 528 | - break; | ||
| 529 | - | ||
| 530 | - end = strchr(addr_tok, ' '); | ||
| 531 | - if (!end) { | ||
| 532 | - RBD_MSG(msg, "checker failed: invalid blacklist %s", | ||
| 533 | - addr_tok); | ||
| 534 | - break; | ||
| 535 | - } | ||
| 536 | - *end = '\0'; | ||
| 537 | - | ||
| 538 | - if (!strcmp(addr_tok, ct->client_addr)) { | ||
| 539 | - ct->blacklisted = 1; | ||
| 540 | - RBD_MSG(msg, "%s is blacklisted", ct->client_addr); | ||
| 541 | - ret = 1; | ||
| 542 | - break; | ||
| 543 | - } | ||
| 544 | - } | ||
| 545 | - | ||
| 546 | -free_bufs: | ||
| 547 | - rados_buffer_free(blklist); | ||
| 548 | - rados_buffer_free(stat); | ||
| 549 | - return ret; | ||
| 550 | -} | ||
| 551 | - | ||
| 552 | -static int rbd_check(struct rbd_checker_context *ct, char *msg) | ||
| 553 | -{ | ||
| 554 | - if (ct->blacklisted || rbd_is_blacklisted(ct, msg) == 1) | ||
| 555 | - return PATH_DOWN; | ||
| 556 | - | ||
| 557 | - RBD_MSG(msg, "checker reports path is up"); | ||
| 558 | - /* | ||
| 559 | - * Path may have issues, but the ceph cluster is at least | ||
| 560 | - * accepting IO, so we can attempt to do IO. | ||
| 561 | - * | ||
| 562 | - * TODO: in future versions, we can run other tests to | ||
| 563 | - * verify OSDs and networks. | ||
| 564 | - */ | ||
| 565 | - return PATH_UP; | ||
| 566 | -} | ||
| 567 | - | ||
| 568 | -static int sysfs_write_rbd_bus(const char *which, const char *buf, | ||
| 569 | - size_t buf_len) | ||
| 570 | -{ | ||
| 571 | - char sysfs_path[PATH_SIZE]; | ||
| 572 | - int fd; | ||
| 573 | - int r; | ||
| 574 | - | ||
| 575 | - /* we require newer kernels so single_major should always be there */ | ||
| 576 | - snprintf(sysfs_path, sizeof(sysfs_path), | ||
| 577 | - "/sys/bus/rbd/%s_single_major", which); | ||
| 578 | - fd = open(sysfs_path, O_WRONLY); | ||
| 579 | - if (fd < 0) | ||
| 580 | - return -errno; | ||
| 581 | - | ||
| 582 | - r = safe_write(fd, buf, buf_len); | ||
| 583 | - close(fd); | ||
| 584 | - return r; | ||
| 585 | -} | ||
| 586 | - | ||
| 587 | -static int rbd_remap(struct rbd_checker_context *ct) | ||
| 588 | -{ | ||
| 589 | - char *argv[11]; | ||
| 590 | - pid_t pid; | ||
| 591 | - int ret = 0, i = 0; | ||
| 592 | - int status; | ||
| 593 | - | ||
| 594 | - pid = fork(); | ||
| 595 | - switch (pid) { | ||
| 596 | - case 0: | ||
| 597 | - argv[i++] = "rbd"; | ||
| 598 | - argv[i++] = "map"; | ||
| 599 | - if (ct->lock_on_read) | ||
| 600 | - argv[i++] = "-o noshare,lock_on_read"; | ||
| 601 | - else | ||
| 602 | - argv[i++] = "-o noshare"; | ||
| 603 | - if (ct->username) { | ||
| 604 | - argv[i++] = "--id"; | ||
| 605 | - argv[i++] = ct->username; | ||
| 606 | - } | ||
| 607 | - argv[i++] = "--pool"; | ||
| 608 | - argv[i++] = ct->pool; | ||
| 609 | - if (ct->snap) { | ||
| 610 | - argv[i++] = "--snap"; | ||
| 611 | - argv[i++] = ct->snap; | ||
| 612 | - } | ||
| 613 | - argv[i++] = ct->image; | ||
| 614 | - argv[i] = NULL; | ||
| 615 | - | ||
| 616 | - ret = execvp(argv[0], argv); | ||
| 617 | - condlog(0, "rbd%d: Error executing rbd: %s", ct->rbd_bus_id, | ||
| 618 | - strerror(errno)); | ||
| 619 | - exit(-1); | ||
| 620 | - case -1: | ||
| 621 | - condlog(0, "rbd%d: fork failed: %s", ct->rbd_bus_id, | ||
| 622 | - strerror(errno)); | ||
| 623 | - return -1; | ||
| 624 | - default: | ||
| 625 | - ret = -1; | ||
| 626 | - wait(&status); | ||
| 627 | - if (WIFEXITED(status)) { | ||
| 628 | - status = WEXITSTATUS(status); | ||
| 629 | - if (status == 0) | ||
| 630 | - ret = 0; | ||
| 631 | - else | ||
| 632 | - condlog(0, "rbd%d: failed with %d", | ||
| 633 | - ct->rbd_bus_id, status); | ||
| 634 | - } | ||
| 635 | - } | ||
| 636 | - | ||
| 637 | - return ret; | ||
| 638 | -} | ||
| 639 | - | ||
| 640 | -static int sysfs_write_rbd_remove(const char *buf, int buf_len) | ||
| 641 | -{ | ||
| 642 | - return sysfs_write_rbd_bus("remove", buf, buf_len); | ||
| 643 | -} | ||
| 644 | - | ||
| 645 | -static int rbd_rm_blacklist(struct rbd_checker_context *ct) | ||
| 646 | -{ | ||
| 647 | - const char *cmd[2]; | ||
| 648 | - char *stat, *cmd_str; | ||
| 649 | - size_t stat_len; | ||
| 650 | - int ret; | ||
| 651 | - | ||
| 652 | - ret = asprintf(&cmd_str, "{\"prefix\": \"osd blacklist\", \"blacklistop\": \"rm\", \"addr\": \"%s\"}", | ||
| 653 | - ct->client_addr); | ||
| 654 | - if (ret == -1) | ||
| 655 | - return -ENOMEM; | ||
| 656 | - | ||
| 657 | - cmd[0] = cmd_str; | ||
| 658 | - cmd[1] = NULL; | ||
| 659 | - | ||
| 660 | - ret = rados_mon_command(ct->cluster, (const char **)cmd, 1, "", 0, | ||
| 661 | - NULL, NULL, &stat, &stat_len); | ||
| 662 | - if (ret < 0) { | ||
| 663 | - condlog(1, "rbd%d: repair failed to remove blacklist for %s %d", | ||
| 664 | - ct->rbd_bus_id, ct->client_addr, ret); | ||
| 665 | - goto free_cmd; | ||
| 666 | - } | ||
| 667 | - | ||
| 668 | - condlog(1, "rbd%d: repair rm blacklist for %s", | ||
| 669 | - ct->rbd_bus_id, ct->client_addr); | ||
| 670 | - free(stat); | ||
| 671 | -free_cmd: | ||
| 672 | - free(cmd_str); | ||
| 673 | - return ret; | ||
| 674 | -} | ||
| 675 | - | ||
| 676 | -static int rbd_repair(struct rbd_checker_context *ct, char *msg) | ||
| 677 | -{ | ||
| 678 | - char del[17]; | ||
| 679 | - int ret; | ||
| 680 | - | ||
| 681 | - if (!ct->blacklisted) | ||
| 682 | - return PATH_UP; | ||
| 683 | - | ||
| 684 | - if (!ct->remapped) { | ||
| 685 | - ret = rbd_remap(ct); | ||
| 686 | - if (ret) { | ||
| 687 | - RBD_MSG(msg, "repair failed to remap. Err %d", ret); | ||
| 688 | - return PATH_DOWN; | ||
| 689 | - } | ||
| 690 | - } | ||
| 691 | - ct->remapped = 1; | ||
| 692 | - | ||
| 693 | - snprintf(del, sizeof(del), "%d force", ct->rbd_bus_id); | ||
| 694 | - ret = sysfs_write_rbd_remove(del, strlen(del) + 1); | ||
| 695 | - if (ret) { | ||
| 696 | - RBD_MSG(msg, "repair failed to clean up. Err %d", ret); | ||
| 697 | - return PATH_DOWN; | ||
| 698 | - } | ||
| 699 | - | ||
| 700 | - ret = rbd_rm_blacklist(ct); | ||
| 701 | - if (ret) { | ||
| 702 | - RBD_MSG(msg, "repair could not remove blacklist entry. Err %d", | ||
| 703 | - ret); | ||
| 704 | - return PATH_DOWN; | ||
| 705 | - } | ||
| 706 | - | ||
| 707 | - ct->remapped = 0; | ||
| 708 | - ct->blacklisted = 0; | ||
| 709 | - | ||
| 710 | - RBD_MSG(msg, "has been repaired"); | ||
| 711 | - return PATH_UP; | ||
| 712 | -} | ||
| 713 | - | ||
| 714 | -#define rbd_thread_cleanup_push(ct) pthread_cleanup_push(cleanup_func, ct) | ||
| 715 | -#define rbd_thread_cleanup_pop(ct) pthread_cleanup_pop(1) | ||
| 716 | - | ||
| 717 | -static void cleanup_func(void *data) | ||
| 718 | -{ | ||
| 719 | - int holders; | ||
| 720 | - struct rbd_checker_context *ct = data; | ||
| 721 | - pthread_spin_lock(&ct->hldr_lock); | ||
| 722 | - ct->holders--; | ||
| 723 | - holders = ct->holders; | ||
| 724 | - ct->thread = 0; | ||
| 725 | - pthread_spin_unlock(&ct->hldr_lock); | ||
| 726 | - if (!holders) | ||
| 727 | - cleanup_context(ct); | ||
| 728 | - rcu_unregister_thread(); | ||
| 729 | -} | ||
| 730 | - | ||
| 731 | -static void *rbd_thread(void *ctx) | ||
| 732 | -{ | ||
| 733 | - struct rbd_checker_context *ct = ctx; | ||
| 734 | - int state; | ||
| 735 | - | ||
| 736 | - /* This thread can be canceled, so setup clean up */ | ||
| 737 | - rbd_thread_cleanup_push(ct) | ||
| 738 | - rcu_register_thread(); | ||
| 739 | - condlog(3, "rbd%d: thread starting up", ct->rbd_bus_id); | ||
| 740 | - | ||
| 741 | - ct->message[0] = '\0'; | ||
| 742 | - | ||
| 743 | - /* checker start up */ | ||
| 744 | - pthread_mutex_lock(&ct->lock); | ||
| 745 | - ct->state = PATH_PENDING; | ||
| 746 | - pthread_mutex_unlock(&ct->lock); | ||
| 747 | - | ||
| 748 | - state = ct->fn(ct, ct->message); | ||
| 749 | - | ||
| 750 | - /* checker done */ | ||
| 751 | - pthread_mutex_lock(&ct->lock); | ||
| 752 | - ct->state = state; | ||
| 753 | - pthread_cond_signal(&ct->active); | ||
| 754 | - pthread_mutex_unlock(&ct->lock); | ||
| 755 | - | ||
| 756 | - condlog(3, "rbd%d: thead finished, state %s", ct->rbd_bus_id, | ||
| 757 | - checker_state_name(state)); | ||
| 758 | - rbd_thread_cleanup_pop(ct); | ||
| 759 | - return ((void *)0); | ||
| 760 | -} | ||
| 761 | - | ||
| 762 | -static void rbd_timeout(struct timespec *tsp) | ||
| 763 | -{ | ||
| 764 | - clock_gettime(CLOCK_MONOTONIC, tsp); | ||
| 765 | - tsp->tv_nsec += 1000 * 1000; /* 1 millisecond */ | ||
| 766 | - normalize_timespec(tsp); | ||
| 767 | -} | ||
| 768 | - | ||
| 769 | -static int rbd_exec_fn(struct checker *c, thread_fn *fn) | ||
| 770 | -{ | ||
| 771 | - struct rbd_checker_context *ct = c->context; | ||
| 772 | - struct timespec tsp; | ||
| 773 | - pthread_attr_t attr; | ||
| 774 | - int rbd_status, r; | ||
| 775 | - | ||
| 776 | - if (c->sync) | ||
| 777 | - return fn(ct, c->message); | ||
| 778 | - /* | ||
| 779 | - * Async mode | ||
| 780 | - */ | ||
| 781 | - r = pthread_mutex_lock(&ct->lock); | ||
| 782 | - if (r != 0) { | ||
| 783 | - condlog(2, "rbd%d: mutex lock failed with %d", ct->rbd_bus_id, | ||
| 784 | - r); | ||
| 785 | - MSG(c, "rbd%d: thread failed to initialize", ct->rbd_bus_id); | ||
| 786 | - return PATH_WILD; | ||
| 787 | - } | ||
| 788 | - | ||
| 789 | - if (ct->running) { | ||
| 790 | - /* Check if checker is still running */ | ||
| 791 | - if (ct->thread) { | ||
| 792 | - condlog(3, "rbd%d: thread not finished", | ||
| 793 | - ct->rbd_bus_id); | ||
| 794 | - rbd_status = PATH_PENDING; | ||
| 795 | - } else { | ||
| 796 | - /* checker done */ | ||
| 797 | - ct->running = 0; | ||
| 798 | - rbd_status = ct->state; | ||
| 799 | - strncpy(c->message, ct->message, CHECKER_MSG_LEN); | ||
| 800 | - c->message[CHECKER_MSG_LEN - 1] = '\0'; | ||
| 801 | - } | ||
| 802 | - pthread_mutex_unlock(&ct->lock); | ||
| 803 | - } else { | ||
| 804 | - /* Start new checker */ | ||
| 805 | - ct->state = PATH_UNCHECKED; | ||
| 806 | - ct->fn = fn; | ||
| 807 | - pthread_spin_lock(&ct->hldr_lock); | ||
| 808 | - ct->holders++; | ||
| 809 | - pthread_spin_unlock(&ct->hldr_lock); | ||
| 810 | - setup_thread_attr(&attr, 32 * 1024, 1); | ||
| 811 | - r = pthread_create(&ct->thread, &attr, rbd_thread, ct); | ||
| 812 | - if (r) { | ||
| 813 | - pthread_mutex_unlock(&ct->lock); | ||
| 814 | - ct->thread = 0; | ||
| 815 | - ct->holders--; | ||
| 816 | - condlog(3, "rbd%d failed to start rbd thread, using sync mode", | ||
| 817 | - ct->rbd_bus_id); | ||
| 818 | - return fn(ct, c->message); | ||
| 819 | - } | ||
| 820 | - pthread_attr_destroy(&attr); | ||
| 821 | - rbd_timeout(&tsp); | ||
| 822 | - r = pthread_cond_timedwait(&ct->active, &ct->lock, &tsp); | ||
| 823 | - rbd_status = ct->state; | ||
| 824 | - strncpy(c->message, ct->message,CHECKER_MSG_LEN); | ||
| 825 | - c->message[CHECKER_MSG_LEN -1] = '\0'; | ||
| 826 | - pthread_mutex_unlock(&ct->lock); | ||
| 827 | - | ||
| 828 | - if (ct->thread && | ||
| 829 | - (rbd_status == PATH_PENDING || rbd_status == PATH_UNCHECKED)) { | ||
| 830 | - condlog(3, "rbd%d: thread still running", | ||
| 831 | - ct->rbd_bus_id); | ||
| 832 | - ct->running = 1; | ||
| 833 | - rbd_status = PATH_PENDING; | ||
| 834 | - } | ||
| 835 | - } | ||
| 836 | - | ||
| 837 | - return rbd_status; | ||
| 838 | -} | ||
| 839 | - | ||
| 840 | -void libcheck_repair(struct checker * c) | ||
| 841 | -{ | ||
| 842 | - struct rbd_checker_context *ct = c->context; | ||
| 843 | - | ||
| 844 | - if (!ct || !ct->blacklisted) | ||
| 845 | - return; | ||
| 846 | - rbd_exec_fn(c, rbd_repair); | ||
| 847 | -} | ||
| 848 | - | ||
| 849 | -int libcheck_check(struct checker * c) | ||
| 850 | -{ | ||
| 851 | - struct rbd_checker_context *ct = c->context; | ||
| 852 | - | ||
| 853 | - if (!ct) | ||
| 854 | - return PATH_UNCHECKED; | ||
| 855 | - | ||
| 856 | - if (ct->blacklisted) | ||
| 857 | - return PATH_DOWN; | ||
| 858 | - | ||
| 859 | - return rbd_exec_fn(c, rbd_check); | ||
| 860 | -} | ||
| 861 | diff --git a/libmultipath/checkers/rdac.c b/libmultipath/checkers/rdac.c | ||
| 862 | index a643a4a..5104e4e 100644 | ||
| 863 | --- a/libmultipath/checkers/rdac.c | ||
| 864 | +++ b/libmultipath/checkers/rdac.c | ||
| 865 | @@ -139,11 +139,6 @@ void libcheck_free (struct checker * c) | ||
| 866 | return; | ||
| 867 | } | ||
| 868 | |||
| 869 | -void libcheck_repair (struct checker * c) | ||
| 870 | -{ | ||
| 871 | - return; | ||
| 872 | -} | ||
| 873 | - | ||
| 874 | static int | ||
| 875 | do_inq(int sg_fd, unsigned int pg_op, void *resp, int mx_resp_len, | ||
| 876 | unsigned int timeout) | ||
| 877 | diff --git a/libmultipath/checkers/readsector0.c b/libmultipath/checkers/readsector0.c | ||
| 878 | index 8fccb46..1c2a868 100644 | ||
| 879 | --- a/libmultipath/checkers/readsector0.c | ||
| 880 | +++ b/libmultipath/checkers/readsector0.c | ||
| 881 | @@ -23,11 +23,6 @@ void libcheck_free (struct checker * c) | ||
| 882 | return; | ||
| 883 | } | ||
| 884 | |||
| 885 | -void libcheck_repair (struct checker * c) | ||
| 886 | -{ | ||
| 887 | - return; | ||
| 888 | -} | ||
| 889 | - | ||
| 890 | int libcheck_check (struct checker * c) | ||
| 891 | { | ||
| 892 | unsigned char buf[4096]; | ||
| 893 | diff --git a/libmultipath/checkers/tur.c b/libmultipath/checkers/tur.c | ||
| 894 | index eb3348d..bf8486d 100644 | ||
| 895 | --- a/libmultipath/checkers/tur.c | ||
| 896 | +++ b/libmultipath/checkers/tur.c | ||
| 897 | @@ -112,11 +112,6 @@ void libcheck_free (struct checker * c) | ||
| 898 | return; | ||
| 899 | } | ||
| 900 | |||
| 901 | -void libcheck_repair (struct checker * c) | ||
| 902 | -{ | ||
| 903 | - return; | ||
| 904 | -} | ||
| 905 | - | ||
| 906 | #define TUR_MSG(fmt, args...) \ | ||
| 907 | do { \ | ||
| 908 | char msg[CHECKER_MSG_LEN]; \ | ||
| 909 | diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c | ||
| 910 | index 1ef1dfa..18ad0e2 100644 | ||
| 911 | --- a/libmultipath/discovery.c | ||
| 912 | +++ b/libmultipath/discovery.c | ||
| 913 | @@ -1246,21 +1246,6 @@ nvme_sysfs_pathinfo (struct path * pp, vector hwtable) | ||
| 914 | } | ||
| 915 | |||
| 916 | static int | ||
| 917 | -rbd_sysfs_pathinfo (struct path * pp, vector hwtable) | ||
| 918 | -{ | ||
| 919 | - sprintf(pp->vendor_id, "Ceph"); | ||
| 920 | - sprintf(pp->product_id, "RBD"); | ||
| 921 | - | ||
| 922 | - condlog(3, "%s: vendor = %s product = %s", pp->dev, pp->vendor_id, | ||
| 923 | - pp->product_id); | ||
| 924 | - /* | ||
| 925 | - * set the hwe configlet pointer | ||
| 926 | - */ | ||
| 927 | - pp->hwe = find_hwe(hwtable, pp->vendor_id, pp->product_id, NULL); | ||
| 928 | - return 0; | ||
| 929 | -} | ||
| 930 | - | ||
| 931 | -static int | ||
| 932 | ccw_sysfs_pathinfo (struct path * pp, vector hwtable) | ||
| 933 | { | ||
| 934 | struct udev_device *parent; | ||
| 935 | @@ -1486,8 +1471,6 @@ sysfs_pathinfo(struct path * pp, vector hwtable) | ||
| 936 | pp->bus = SYSFS_BUS_CCW; | ||
| 937 | if (!strncmp(pp->dev,"sd", 2)) | ||
| 938 | pp->bus = SYSFS_BUS_SCSI; | ||
| 939 | - if (!strncmp(pp->dev,"rbd", 3)) | ||
| 940 | - pp->bus = SYSFS_BUS_RBD; | ||
| 941 | if (!strncmp(pp->dev,"nvme", 4)) | ||
| 942 | pp->bus = SYSFS_BUS_NVME; | ||
| 943 | |||
| 944 | @@ -1502,9 +1485,6 @@ sysfs_pathinfo(struct path * pp, vector hwtable) | ||
| 945 | } else if (pp->bus == SYSFS_BUS_CCISS) { | ||
| 946 | if (cciss_sysfs_pathinfo(pp, hwtable)) | ||
| 947 | return 1; | ||
| 948 | - } else if (pp->bus == SYSFS_BUS_RBD) { | ||
| 949 | - if (rbd_sysfs_pathinfo(pp, hwtable)) | ||
| 950 | - return 1; | ||
| 951 | } else if (pp->bus == SYSFS_BUS_NVME) { | ||
| 952 | if (nvme_sysfs_pathinfo(pp, hwtable)) | ||
| 953 | return 1; | ||
| 954 | @@ -1753,53 +1733,6 @@ get_udev_uid(struct path * pp, char *uid_attribute, struct udev_device *udev) | ||
| 955 | } | ||
| 956 | |||
| 957 | static int | ||
| 958 | -get_rbd_uid(struct path * pp) | ||
| 959 | -{ | ||
| 960 | - struct udev_device *rbd_bus_dev; | ||
| 961 | - int ret, rbd_bus_id; | ||
| 962 | - const char *pool, *image, *snap; | ||
| 963 | - char sysfs_path[PATH_SIZE]; | ||
| 964 | - uint64_t snap_id, max_snap_id = -3; | ||
| 965 | - | ||
| 966 | - ret = sscanf(pp->dev, "rbd%d", &rbd_bus_id); | ||
| 967 | - if (ret != 1) | ||
| 968 | - return -EINVAL; | ||
| 969 | - | ||
| 970 | - snprintf(sysfs_path, sizeof(sysfs_path), "/sys/bus/rbd/devices/%d", | ||
| 971 | - rbd_bus_id); | ||
| 972 | - rbd_bus_dev = udev_device_new_from_syspath(udev, sysfs_path); | ||
| 973 | - if (!rbd_bus_dev) | ||
| 974 | - return -ENODEV; | ||
| 975 | - | ||
| 976 | - ret = -EINVAL; | ||
| 977 | - pool = udev_device_get_sysattr_value(rbd_bus_dev, "pool_id"); | ||
| 978 | - if (!pool) | ||
| 979 | - goto free_dev; | ||
| 980 | - | ||
| 981 | - image = udev_device_get_sysattr_value(rbd_bus_dev, "image_id"); | ||
| 982 | - if (!image) | ||
| 983 | - goto free_dev; | ||
| 984 | - | ||
| 985 | - snap = udev_device_get_sysattr_value(rbd_bus_dev, "snap_id"); | ||
| 986 | - if (!snap) | ||
| 987 | - goto free_dev; | ||
| 988 | - snap_id = strtoull(snap, NULL, 19); | ||
| 989 | - if (snap_id >= max_snap_id) | ||
| 990 | - ret = snprintf(pp->wwid, WWID_SIZE, "%s-%s", pool, image); | ||
| 991 | - else | ||
| 992 | - ret = snprintf(pp->wwid, WWID_SIZE, "%s-%s-%s", pool, | ||
| 993 | - image, snap); | ||
| 994 | - if (ret >= WWID_SIZE) { | ||
| 995 | - condlog(0, "%s: wwid overflow", pp->dev); | ||
| 996 | - ret = -EOVERFLOW; | ||
| 997 | - } | ||
| 998 | - | ||
| 999 | -free_dev: | ||
| 1000 | - udev_device_unref(rbd_bus_dev); | ||
| 1001 | - return ret; | ||
| 1002 | -} | ||
| 1003 | - | ||
| 1004 | -static int | ||
| 1005 | get_vpd_uid(struct path * pp) | ||
| 1006 | { | ||
| 1007 | struct udev_device *parent = pp->udev; | ||
| 1008 | @@ -1876,9 +1809,6 @@ get_uid (struct path * pp, int path_state, struct udev_device *udev) | ||
| 1009 | } else | ||
| 1010 | len = strlen(pp->wwid); | ||
| 1011 | origin = "callout"; | ||
| 1012 | - } else if (pp->bus == SYSFS_BUS_RBD) { | ||
| 1013 | - len = get_rbd_uid(pp); | ||
| 1014 | - origin = "sysfs"; | ||
| 1015 | } else { | ||
| 1016 | |||
| 1017 | if (udev && pp->uid_attribute) { | ||
| 1018 | diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c | ||
| 1019 | index 148f0ba..d529bae 100644 | ||
| 1020 | --- a/libmultipath/hwtable.c | ||
| 1021 | +++ b/libmultipath/hwtable.c | ||
| 1022 | @@ -1000,18 +1000,6 @@ static struct hwentry default_hw[] = { | ||
| 1023 | .prio_name = PRIO_ALUA, | ||
| 1024 | }, | ||
| 1025 | /* | ||
| 1026 | - * Red Hat | ||
| 1027 | - * | ||
| 1028 | - * Maintainer: Mike Christie | ||
| 1029 | - * Mail: mchristi@redhat.com | ||
| 1030 | - */ | ||
| 1031 | - { | ||
| 1032 | - .vendor = "Ceph", | ||
| 1033 | - .product = "RBD", | ||
| 1034 | - .checker_name = RBD, | ||
| 1035 | - .deferred_remove = DEFERRED_REMOVE_ON, | ||
| 1036 | - }, | ||
| 1037 | - /* | ||
| 1038 | * Kove | ||
| 1039 | */ | ||
| 1040 | { | ||
| 1041 | diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 | ||
| 1042 | index 0c1f174..31f4585 100644 | ||
| 1043 | --- a/multipath/multipath.conf.5 | ||
| 1044 | +++ b/multipath/multipath.conf.5 | ||
| 1045 | @@ -482,9 +482,6 @@ Check the path state for HP/COMPAQ Smart Array(CCISS) controllers. | ||
| 1046 | .I none | ||
| 1047 | Do not check the device, fallback to use the values retrieved from sysfs | ||
| 1048 | .TP | ||
| 1049 | -.I rbd | ||
| 1050 | -Check if the path is in the Ceph blacklist and remap the path if it is. | ||
| 1051 | -.TP | ||
| 1052 | The default is: \fBtur\fR | ||
| 1053 | .RE | ||
| 1054 | . | ||
| 1055 | diff --git a/multipathd/main.c b/multipathd/main.c | ||
| 1056 | index 0db88ee..d40c416 100644 | ||
| 1057 | --- a/multipathd/main.c | ||
| 1058 | +++ b/multipathd/main.c | ||
| 1059 | @@ -1783,15 +1783,6 @@ int update_path_groups(struct multipath *mpp, struct vectors *vecs, int refresh) | ||
| 1060 | return 0; | ||
| 1061 | } | ||
| 1062 | |||
| 1063 | -void repair_path(struct path * pp) | ||
| 1064 | -{ | ||
| 1065 | - if (pp->state != PATH_DOWN) | ||
| 1066 | - return; | ||
| 1067 | - | ||
| 1068 | - checker_repair(&pp->checker); | ||
| 1069 | - LOG_MSG(1, checker_message(&pp->checker)); | ||
| 1070 | -} | ||
| 1071 | - | ||
| 1072 | /* | ||
| 1073 | * Returns '1' if the path has been checked, '-1' if it was blacklisted | ||
| 1074 | * and '0' otherwise | ||
| 1075 | @@ -1972,7 +1963,6 @@ check_path (struct vectors * vecs, struct path * pp, int ticks) | ||
| 1076 | pp->mpp->failback_tick = 0; | ||
| 1077 | |||
| 1078 | pp->mpp->stat_path_failures++; | ||
| 1079 | - repair_path(pp); | ||
| 1080 | return 1; | ||
| 1081 | } | ||
| 1082 | |||
| 1083 | @@ -2071,7 +2061,6 @@ check_path (struct vectors * vecs, struct path * pp, int ticks) | ||
| 1084 | } | ||
| 1085 | |||
| 1086 | pp->state = newstate; | ||
| 1087 | - repair_path(pp); | ||
| 1088 | |||
| 1089 | if (pp->mpp->wait_for_udev) | ||
| 1090 | return 1; | ||
| 1091 | -- | ||
| 1092 | 2.7.4 | ||
| 1093 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0017-mpathpersist-fix-aptpl-support.patch b/meta-oe/recipes-support/multipath-tools/files/0017-mpathpersist-fix-aptpl-support.patch deleted file mode 100644 index b98d310a13..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0017-mpathpersist-fix-aptpl-support.patch +++ /dev/null | |||
| @@ -1,543 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 3 | Date: Mon, 4 Jun 2018 22:04:44 -0500 | ||
| 4 | Subject: [PATCH] mpathpersist: fix aptpl support | ||
| 5 | |||
| 6 | The "Active Persist Through Power Loss" flag must be set whenever a key | ||
| 7 | is registered. However, there is no way for multipathd to know if this | ||
| 8 | was set by mpathpersist. The result is that if a path goes down and | ||
| 9 | comes back up (or if it wasn't up when mpathpersist was first run) | ||
| 10 | multipathd will clear the aptpl flag when it reregisters the key on it. | ||
| 11 | |||
| 12 | To fix this, multipath.conf now accepts an optional ":aptpl" appended | ||
| 13 | on the reservation_key value. If this is added to the reservation_key | ||
| 14 | multipathd will set the aptpl flag when it reregisters the key. If | ||
| 15 | reservation_key is set to "file", this will automatically be tracked | ||
| 16 | in the /etc/multipath/prkeys file. | ||
| 17 | |||
| 18 | To track this flag in the prkeys file, without changing the format | ||
| 19 | I've made "0x<key>" stand for non-aptpl keys, and "0X<key>" stand | ||
| 20 | for aptpl keys. Since previously, all keys used a lower-case x, this | ||
| 21 | will default to the current behavior for existing keys. Obviously, the | ||
| 22 | next time mpathpersist is run, this will be changed if --param-aptpl | ||
| 23 | is used. Since there are no more flags that are in sg_persist that | ||
| 24 | multipathd needs to care about in mpathpersist, there shouldn't need | ||
| 25 | to be any more flags added to the prkeys file. | ||
| 26 | |||
| 27 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 28 | --- | ||
| 29 | libmpathpersist/mpath_persist.c | 3 ++- | ||
| 30 | libmpathpersist/mpath_updatepr.c | 11 +++++++---- | ||
| 31 | libmpathpersist/mpathpr.h | 3 ++- | ||
| 32 | libmultipath/Makefile | 2 +- | ||
| 33 | libmultipath/config.h | 2 ++ | ||
| 34 | libmultipath/dict.c | 23 +++++++++++++++++++---- | ||
| 35 | libmultipath/dict.h | 3 ++- | ||
| 36 | libmultipath/prkey.c | 27 ++++++++++++++++++++++++--- | ||
| 37 | libmultipath/prkey.h | 6 ++++-- | ||
| 38 | libmultipath/propsel.c | 6 ++++-- | ||
| 39 | libmultipath/structs.h | 1 + | ||
| 40 | libmultipath/util.c | 16 ++++++++++++++++ | ||
| 41 | libmultipath/util.h | 1 + | ||
| 42 | multipath/multipath.conf.5 | 7 +++++-- | ||
| 43 | multipathd/cli_handlers.c | 15 ++++++++++----- | ||
| 44 | multipathd/main.c | 1 + | ||
| 45 | 16 files changed, 101 insertions(+), 26 deletions(-) | ||
| 46 | |||
| 47 | diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c | ||
| 48 | index ca91c55..6e9e67f 100644 | ||
| 49 | --- a/libmpathpersist/mpath_persist.c | ||
| 50 | +++ b/libmpathpersist/mpath_persist.c | ||
| 51 | @@ -344,7 +344,8 @@ int mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, | ||
| 52 | rq_servact == MPATH_PROUT_REG_SA) || | ||
| 53 | rq_servact == MPATH_PROUT_REG_IGN_SA)) { | ||
| 54 | memcpy(&mpp->reservation_key, paramp->sa_key, 8); | ||
| 55 | - if (update_prkey(alias, get_be64(mpp->reservation_key))) { | ||
| 56 | + if (update_prkey_flags(alias, get_be64(mpp->reservation_key), | ||
| 57 | + paramp->sa_flags)) { | ||
| 58 | condlog(0, "%s: failed to set prkey for multipathd.", | ||
| 59 | alias); | ||
| 60 | ret = MPATH_PR_DMMP_ERROR; | ||
| 61 | diff --git a/libmpathpersist/mpath_updatepr.c b/libmpathpersist/mpath_updatepr.c | ||
| 62 | index 8063e90..0aca28e 100644 | ||
| 63 | --- a/libmpathpersist/mpath_updatepr.c | ||
| 64 | +++ b/libmpathpersist/mpath_updatepr.c | ||
| 65 | @@ -1,7 +1,5 @@ | ||
| 66 | #include <stdio.h> | ||
| 67 | #include <unistd.h> | ||
| 68 | -#include <errno.h> | ||
| 69 | - | ||
| 70 | #include <stdlib.h> | ||
| 71 | #include <stdarg.h> | ||
| 72 | #include <fcntl.h> | ||
| 73 | @@ -11,6 +9,8 @@ | ||
| 74 | #include <sys/un.h> | ||
| 75 | #include <poll.h> | ||
| 76 | #include <errno.h> | ||
| 77 | +#include <libudev.h> | ||
| 78 | +#include <mpath_persist.h> | ||
| 79 | #include "debug.h" | ||
| 80 | #include "mpath_cmd.h" | ||
| 81 | #include "uxsock.h" | ||
| 82 | @@ -59,11 +59,14 @@ int update_prflag(char *mapname, int set) { | ||
| 83 | return do_update_pr(mapname, (set)? "setprstatus" : "unsetprstatus"); | ||
| 84 | } | ||
| 85 | |||
| 86 | -int update_prkey(char *mapname, uint64_t prkey) { | ||
| 87 | +int update_prkey_flags(char *mapname, uint64_t prkey, uint8_t sa_flags) { | ||
| 88 | char str[256]; | ||
| 89 | + char *flagstr = ""; | ||
| 90 | |||
| 91 | + if (sa_flags & MPATH_F_APTPL_MASK) | ||
| 92 | + flagstr = ":aptpl"; | ||
| 93 | if (prkey) | ||
| 94 | - sprintf(str, "setprkey key %" PRIx64, prkey); | ||
| 95 | + sprintf(str, "setprkey key %" PRIx64 "%s", prkey, flagstr); | ||
| 96 | else | ||
| 97 | sprintf(str, "unsetprkey"); | ||
| 98 | return do_update_pr(mapname, str); | ||
| 99 | diff --git a/libmpathpersist/mpathpr.h b/libmpathpersist/mpathpr.h | ||
| 100 | index 72feb60..5ea8cd6 100644 | ||
| 101 | --- a/libmpathpersist/mpathpr.h | ||
| 102 | +++ b/libmpathpersist/mpathpr.h | ||
| 103 | @@ -46,7 +46,8 @@ int send_prout_activepath(char * dev, int rq_servact, int rq_scope, | ||
| 104 | unsigned int rq_type, struct prout_param_descriptor * paramp, int noisy); | ||
| 105 | |||
| 106 | int update_prflag(char *mapname, int set); | ||
| 107 | -int update_prkey(char *mapname, uint64_t prkey); | ||
| 108 | +int update_prkey_flags(char *mapname, uint64_t prkey, uint8_t sa_flags); | ||
| 109 | +#define update_prkey(mapname, prkey) update_prkey_flags(mapname, prkey, 0) | ||
| 110 | void * mpath_alloc_prin_response(int prin_sa); | ||
| 111 | int update_map_pr(struct multipath *mpp); | ||
| 112 | |||
| 113 | diff --git a/libmultipath/Makefile b/libmultipath/Makefile | ||
| 114 | index f51786d..33f5269 100644 | ||
| 115 | --- a/libmultipath/Makefile | ||
| 116 | +++ b/libmultipath/Makefile | ||
| 117 | @@ -7,7 +7,7 @@ SONAME = 0 | ||
| 118 | DEVLIB = libmultipath.so | ||
| 119 | LIBS = $(DEVLIB).$(SONAME) | ||
| 120 | |||
| 121 | -CFLAGS += $(LIB_CFLAGS) -I$(mpathcmddir) | ||
| 122 | +CFLAGS += $(LIB_CFLAGS) -I$(mpathcmddir) -I$(mpathpersistdir) | ||
| 123 | |||
| 124 | LIBDEPS += -lpthread -ldl -ldevmapper -ludev -L$(mpathcmddir) -lmpathcmd -lurcu -laio | ||
| 125 | |||
| 126 | diff --git a/libmultipath/config.h b/libmultipath/config.h | ||
| 127 | index 1bf708a..fcbe3fc 100644 | ||
| 128 | --- a/libmultipath/config.h | ||
| 129 | +++ b/libmultipath/config.h | ||
| 130 | @@ -98,6 +98,7 @@ struct mpentry { | ||
| 131 | char * prio_args; | ||
| 132 | int prkey_source; | ||
| 133 | struct be64 reservation_key; | ||
| 134 | + uint8_t sa_flags; | ||
| 135 | int pgpolicy; | ||
| 136 | int pgfailback; | ||
| 137 | int rr_weight; | ||
| 138 | @@ -197,6 +198,7 @@ struct config { | ||
| 139 | int prkey_source; | ||
| 140 | int all_tg_pt; | ||
| 141 | struct be64 reservation_key; | ||
| 142 | + uint8_t sa_flags; | ||
| 143 | |||
| 144 | vector keywords; | ||
| 145 | vector mptable; | ||
| 146 | diff --git a/libmultipath/dict.c b/libmultipath/dict.c | ||
| 147 | index 2557b8a..7ad0f5a 100644 | ||
| 148 | --- a/libmultipath/dict.c | ||
| 149 | +++ b/libmultipath/dict.c | ||
| 150 | @@ -22,6 +22,8 @@ | ||
| 151 | #include "util.h" | ||
| 152 | #include <errno.h> | ||
| 153 | #include <inttypes.h> | ||
| 154 | +#include <libudev.h> | ||
| 155 | +#include <mpath_persist.h> | ||
| 156 | #include "mpath_cmd.h" | ||
| 157 | #include "dict.h" | ||
| 158 | |||
| 159 | @@ -1012,10 +1014,12 @@ snprint_def_log_checker_err (struct config *conf, char * buff, int len, | ||
| 160 | } | ||
| 161 | |||
| 162 | static int | ||
| 163 | -set_reservation_key(vector strvec, struct be64 *be64_ptr, int *source_ptr) | ||
| 164 | +set_reservation_key(vector strvec, struct be64 *be64_ptr, uint8_t *flags_ptr, | ||
| 165 | + int *source_ptr) | ||
| 166 | { | ||
| 167 | char *buff; | ||
| 168 | uint64_t prkey; | ||
| 169 | + uint8_t sa_flags; | ||
| 170 | |||
| 171 | buff = set_value(strvec); | ||
| 172 | if (!buff) | ||
| 173 | @@ -1023,35 +1027,43 @@ set_reservation_key(vector strvec, struct be64 *be64_ptr, int *source_ptr) | ||
| 174 | |||
| 175 | if (strcmp(buff, "file") == 0) { | ||
| 176 | *source_ptr = PRKEY_SOURCE_FILE; | ||
| 177 | + *flags_ptr = 0; | ||
| 178 | put_be64(*be64_ptr, 0); | ||
| 179 | FREE(buff); | ||
| 180 | return 0; | ||
| 181 | } | ||
| 182 | |||
| 183 | - if (parse_prkey(buff, &prkey) != 0) { | ||
| 184 | + if (parse_prkey_flags(buff, &prkey, &sa_flags) != 0) { | ||
| 185 | FREE(buff); | ||
| 186 | return 1; | ||
| 187 | } | ||
| 188 | *source_ptr = PRKEY_SOURCE_CONF; | ||
| 189 | + *flags_ptr = sa_flags; | ||
| 190 | put_be64(*be64_ptr, prkey); | ||
| 191 | FREE(buff); | ||
| 192 | return 0; | ||
| 193 | } | ||
| 194 | |||
| 195 | int | ||
| 196 | -print_reservation_key(char * buff, int len, struct be64 key, int source) | ||
| 197 | +print_reservation_key(char * buff, int len, struct be64 key, uint8_t flags, | ||
| 198 | + int source) | ||
| 199 | { | ||
| 200 | + char *flagstr = ""; | ||
| 201 | if (source == PRKEY_SOURCE_NONE) | ||
| 202 | return 0; | ||
| 203 | if (source == PRKEY_SOURCE_FILE) | ||
| 204 | return snprintf(buff, len, "file"); | ||
| 205 | - return snprintf(buff, len, "0x%" PRIx64, get_be64(key)); | ||
| 206 | + if (flags & MPATH_F_APTPL_MASK) | ||
| 207 | + flagstr = ":aptpl"; | ||
| 208 | + return snprintf(buff, len, "0x%" PRIx64 "%s", get_be64(key), | ||
| 209 | + flagstr); | ||
| 210 | } | ||
| 211 | |||
| 212 | static int | ||
| 213 | def_reservation_key_handler(struct config *conf, vector strvec) | ||
| 214 | { | ||
| 215 | return set_reservation_key(strvec, &conf->reservation_key, | ||
| 216 | + &conf->sa_flags, | ||
| 217 | &conf->prkey_source); | ||
| 218 | } | ||
| 219 | |||
| 220 | @@ -1060,6 +1072,7 @@ snprint_def_reservation_key (struct config *conf, char * buff, int len, | ||
| 221 | const void * data) | ||
| 222 | { | ||
| 223 | return print_reservation_key(buff, len, conf->reservation_key, | ||
| 224 | + conf->sa_flags, | ||
| 225 | conf->prkey_source); | ||
| 226 | } | ||
| 227 | |||
| 228 | @@ -1070,6 +1083,7 @@ mp_reservation_key_handler(struct config *conf, vector strvec) | ||
| 229 | if (!mpe) | ||
| 230 | return 1; | ||
| 231 | return set_reservation_key(strvec, &mpe->reservation_key, | ||
| 232 | + &mpe->sa_flags, | ||
| 233 | &mpe->prkey_source); | ||
| 234 | } | ||
| 235 | |||
| 236 | @@ -1079,6 +1093,7 @@ snprint_mp_reservation_key (struct config *conf, char * buff, int len, | ||
| 237 | { | ||
| 238 | const struct mpentry * mpe = (const struct mpentry *)data; | ||
| 239 | return print_reservation_key(buff, len, mpe->reservation_key, | ||
| 240 | + mpe->sa_flags, | ||
| 241 | mpe->prkey_source); | ||
| 242 | } | ||
| 243 | |||
| 244 | diff --git a/libmultipath/dict.h b/libmultipath/dict.h | ||
| 245 | index 7564892..a40ac66 100644 | ||
| 246 | --- a/libmultipath/dict.h | ||
| 247 | +++ b/libmultipath/dict.h | ||
| 248 | @@ -15,6 +15,7 @@ int print_pgpolicy(char *buff, int len, long v); | ||
| 249 | int print_no_path_retry(char *buff, int len, long v); | ||
| 250 | int print_fast_io_fail(char *buff, int len, long v); | ||
| 251 | int print_dev_loss(char *buff, int len, unsigned long v); | ||
| 252 | -int print_reservation_key(char * buff, int len, struct be64 key, int source); | ||
| 253 | +int print_reservation_key(char * buff, int len, struct be64 key, uint8_t | ||
| 254 | + flags, int source); | ||
| 255 | int print_off_int_undef(char *buff, int len, long v); | ||
| 256 | #endif /* _DICT_H */ | ||
| 257 | diff --git a/libmultipath/prkey.c b/libmultipath/prkey.c | ||
| 258 | index 89b90ed..d645f81 100644 | ||
| 259 | --- a/libmultipath/prkey.c | ||
| 260 | +++ b/libmultipath/prkey.c | ||
| 261 | @@ -11,6 +11,8 @@ | ||
| 262 | #include <string.h> | ||
| 263 | #include <inttypes.h> | ||
| 264 | #include <errno.h> | ||
| 265 | +#include <libudev.h> | ||
| 266 | +#include <mpath_persist.h> | ||
| 267 | |||
| 268 | #define PRKEY_READ 0 | ||
| 269 | #define PRKEY_WRITE 1 | ||
| 270 | @@ -108,7 +110,8 @@ static int do_prkey(int fd, char *wwid, char *keystr, int cmd) | ||
| 271 | return 0; | ||
| 272 | } | ||
| 273 | |||
| 274 | -int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey) | ||
| 275 | +int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey, | ||
| 276 | + uint8_t *sa_flags) | ||
| 277 | { | ||
| 278 | int fd; | ||
| 279 | int unused; | ||
| 280 | @@ -124,6 +127,9 @@ int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey) | ||
| 281 | ret = do_prkey(fd, mpp->wwid, keystr, PRKEY_READ); | ||
| 282 | if (ret) | ||
| 283 | goto out_file; | ||
| 284 | + *sa_flags = 0; | ||
| 285 | + if (strchr(keystr, 'X')) | ||
| 286 | + *sa_flags = MPATH_F_APTPL_MASK; | ||
| 287 | ret = !!parse_prkey(keystr, prkey); | ||
| 288 | out_file: | ||
| 289 | close(fd); | ||
| 290 | @@ -131,7 +137,8 @@ out: | ||
| 291 | return ret; | ||
| 292 | } | ||
| 293 | |||
| 294 | -int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey) | ||
| 295 | +int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey, | ||
| 296 | + uint8_t sa_flags) | ||
| 297 | { | ||
| 298 | int fd; | ||
| 299 | int can_write = 1; | ||
| 300 | @@ -141,6 +148,12 @@ int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey) | ||
| 301 | if (!strlen(mpp->wwid)) | ||
| 302 | goto out; | ||
| 303 | |||
| 304 | + if (sa_flags & ~MPATH_F_APTPL_MASK) { | ||
| 305 | + condlog(0, "unsupported pr flags, 0x%x", | ||
| 306 | + sa_flags & ~MPATH_F_APTPL_MASK); | ||
| 307 | + sa_flags &= MPATH_F_APTPL_MASK; | ||
| 308 | + } | ||
| 309 | + | ||
| 310 | fd = open_file(conf->prkeys_file, &can_write, PRKEYS_FILE_HEADER); | ||
| 311 | if (fd < 0) | ||
| 312 | goto out; | ||
| 313 | @@ -149,7 +162,15 @@ int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey) | ||
| 314 | goto out_file; | ||
| 315 | } | ||
| 316 | if (prkey) { | ||
| 317 | - snprintf(keystr, PRKEY_SIZE, "0x%016" PRIx64, prkey); | ||
| 318 | + /* using the capitalization of the 'x' is a hack, but | ||
| 319 | + * it's unlikely that mpath_persist will support more options | ||
| 320 | + * since sg_persist doesn't, and this lets us keep the | ||
| 321 | + * same file format as before instead of needing to change | ||
| 322 | + * the format of the prkeys file */ | ||
| 323 | + if (sa_flags) | ||
| 324 | + snprintf(keystr, PRKEY_SIZE, "0X%016" PRIx64, prkey); | ||
| 325 | + else | ||
| 326 | + snprintf(keystr, PRKEY_SIZE, "0x%016" PRIx64, prkey); | ||
| 327 | keystr[PRKEY_SIZE - 1] = '\0'; | ||
| 328 | ret = do_prkey(fd, mpp->wwid, keystr, PRKEY_WRITE); | ||
| 329 | } | ||
| 330 | diff --git a/libmultipath/prkey.h b/libmultipath/prkey.h | ||
| 331 | index 4028e70..6739191 100644 | ||
| 332 | --- a/libmultipath/prkey.h | ||
| 333 | +++ b/libmultipath/prkey.h | ||
| 334 | @@ -13,7 +13,9 @@ | ||
| 335 | "# prkey wwid\n" \ | ||
| 336 | "#\n" | ||
| 337 | |||
| 338 | -int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey); | ||
| 339 | -int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey); | ||
| 340 | +int set_prkey(struct config *conf, struct multipath *mpp, uint64_t prkey, | ||
| 341 | + uint8_t sa_flags); | ||
| 342 | +int get_prkey(struct config *conf, struct multipath *mpp, uint64_t *prkey, | ||
| 343 | + uint8_t *sa_flags); | ||
| 344 | |||
| 345 | #endif /* _PRKEY_H */ | ||
| 346 | diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c | ||
| 347 | index 9ca1355..62a6893 100644 | ||
| 348 | --- a/libmultipath/propsel.c | ||
| 349 | +++ b/libmultipath/propsel.c | ||
| 350 | @@ -106,6 +106,7 @@ do { \ | ||
| 351 | if (src && src->prkey_source != PRKEY_SOURCE_NONE) { \ | ||
| 352 | mp->prkey_source = src->prkey_source; \ | ||
| 353 | mp->reservation_key = src->reservation_key; \ | ||
| 354 | + mp->sa_flags = src->sa_flags; \ | ||
| 355 | origin = msg; \ | ||
| 356 | goto out; \ | ||
| 357 | } \ | ||
| 358 | @@ -703,18 +704,19 @@ int select_reservation_key(struct config *conf, struct multipath *mp) | ||
| 359 | do_prkey_set(mp->mpe, multipaths_origin); | ||
| 360 | do_prkey_set(conf, conf_origin); | ||
| 361 | put_be64(mp->reservation_key, 0); | ||
| 362 | + mp->sa_flags = 0; | ||
| 363 | mp->prkey_source = PRKEY_SOURCE_NONE; | ||
| 364 | return 0; | ||
| 365 | out: | ||
| 366 | if (mp->prkey_source == PRKEY_SOURCE_FILE) { | ||
| 367 | from_file = " (from prkeys file)"; | ||
| 368 | - if (get_prkey(conf, mp, &prkey) != 0) | ||
| 369 | + if (get_prkey(conf, mp, &prkey, &mp->sa_flags) != 0) | ||
| 370 | put_be64(mp->reservation_key, 0); | ||
| 371 | else | ||
| 372 | put_be64(mp->reservation_key, prkey); | ||
| 373 | } | ||
| 374 | print_reservation_key(buff, PRKEY_SIZE, mp->reservation_key, | ||
| 375 | - mp->prkey_source); | ||
| 376 | + mp->sa_flags, mp->prkey_source); | ||
| 377 | condlog(3, "%s: reservation_key = %s %s%s", mp->alias, buff, origin, | ||
| 378 | from_file); | ||
| 379 | return 0; | ||
| 380 | diff --git a/libmultipath/structs.h b/libmultipath/structs.h | ||
| 381 | index 0194b1e..987479f 100644 | ||
| 382 | --- a/libmultipath/structs.h | ||
| 383 | +++ b/libmultipath/structs.h | ||
| 384 | @@ -367,6 +367,7 @@ struct multipath { | ||
| 385 | /* persistent management data*/ | ||
| 386 | int prkey_source; | ||
| 387 | struct be64 reservation_key; | ||
| 388 | + uint8_t sa_flags; | ||
| 389 | unsigned char prflag; | ||
| 390 | int all_tg_pt; | ||
| 391 | struct gen_multipath generic_mp; | ||
| 392 | diff --git a/libmultipath/util.c b/libmultipath/util.c | ||
| 393 | index 7251ad0..8d8fcc8 100644 | ||
| 394 | --- a/libmultipath/util.c | ||
| 395 | +++ b/libmultipath/util.c | ||
| 396 | @@ -10,6 +10,8 @@ | ||
| 397 | #include <dirent.h> | ||
| 398 | #include <unistd.h> | ||
| 399 | #include <errno.h> | ||
| 400 | +#include <libudev.h> | ||
| 401 | +#include <mpath_persist.h> | ||
| 402 | |||
| 403 | #include "util.h" | ||
| 404 | #include "debug.h" | ||
| 405 | @@ -435,6 +437,20 @@ int parse_prkey(char *ptr, uint64_t *prkey) | ||
| 406 | return 0; | ||
| 407 | } | ||
| 408 | |||
| 409 | +int parse_prkey_flags(char *ptr, uint64_t *prkey, uint8_t *flags) | ||
| 410 | +{ | ||
| 411 | + char *flagstr; | ||
| 412 | + | ||
| 413 | + flagstr = strchr(ptr, ':'); | ||
| 414 | + *flags = 0; | ||
| 415 | + if (flagstr) { | ||
| 416 | + *flagstr++ = '\0'; | ||
| 417 | + if (strlen(flagstr) == 5 && strcmp(flagstr, "aptpl") == 0) | ||
| 418 | + *flags = MPATH_F_APTPL_MASK; | ||
| 419 | + } | ||
| 420 | + return parse_prkey(ptr, prkey); | ||
| 421 | +} | ||
| 422 | + | ||
| 423 | int safe_write(int fd, const void *buf, size_t count) | ||
| 424 | { | ||
| 425 | while (count > 0) { | ||
| 426 | diff --git a/libmultipath/util.h b/libmultipath/util.h | ||
| 427 | index a3ab894..56cec76 100644 | ||
| 428 | --- a/libmultipath/util.h | ||
| 429 | +++ b/libmultipath/util.h | ||
| 430 | @@ -19,6 +19,7 @@ void setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached); | ||
| 431 | int systemd_service_enabled(const char *dev); | ||
| 432 | int get_linux_version_code(void); | ||
| 433 | int parse_prkey(char *ptr, uint64_t *prkey); | ||
| 434 | +int parse_prkey_flags(char *ptr, uint64_t *prkey, uint8_t *flags); | ||
| 435 | int safe_write(int fd, const void *buf, size_t count); | ||
| 436 | |||
| 437 | #define KERNEL_VERSION(maj, min, ptc) ((((maj) * 256) + (min)) * 256 + (ptc)) | ||
| 438 | diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 | ||
| 439 | index 31f4585..30d8598 100644 | ||
| 440 | --- a/multipath/multipath.conf.5 | ||
| 441 | +++ b/multipath/multipath.conf.5 | ||
| 442 | @@ -726,14 +726,17 @@ This is the service action reservation key used by mpathpersist. It must be | ||
| 443 | set for all multipath devices using persistent reservations, and it must be | ||
| 444 | the same as the RESERVATION KEY field of the PERSISTENT RESERVE OUT parameter | ||
| 445 | list which contains an 8-byte value provided by the application client to the | ||
| 446 | -device server to identify the I_T nexus. | ||
| 447 | +device server to identify the I_T nexus. If the \fI--param-aptpl\fR option is | ||
| 448 | +used when registering the key with mpathpersist, \fB:aptpl\fR must be appended | ||
| 449 | +to the end of the reservation key. | ||
| 450 | .RS | ||
| 451 | .PP | ||
| 452 | Alternatively, this can be set to \fBfile\fR, which will store the RESERVATION | ||
| 453 | KEY registered by mpathpersist in the \fIprkeys_file\fR. multipathd will then | ||
| 454 | use this key to register additional paths as they appear. When the | ||
| 455 | registration is removed, the RESERVATION KEY is removed from the | ||
| 456 | -\fIprkeys_file\fR. | ||
| 457 | +\fIprkeys_file\fR. The prkeys file will automatically keep track of whether | ||
| 458 | +the key was registered with \fI--param-aptpl\fR. | ||
| 459 | .TP | ||
| 460 | The default is: \fB<unset>\fR | ||
| 461 | .RE | ||
| 462 | diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c | ||
| 463 | index ba50fb8..6452796 100644 | ||
| 464 | --- a/multipathd/cli_handlers.c | ||
| 465 | +++ b/multipathd/cli_handlers.c | ||
| 466 | @@ -21,6 +21,7 @@ | ||
| 467 | #include "sysfs.h" | ||
| 468 | #include <errno.h> | ||
| 469 | #include <libudev.h> | ||
| 470 | +#include <mpath_persist.h> | ||
| 471 | #include "util.h" | ||
| 472 | #include "prkey.h" | ||
| 473 | #include "propsel.h" | ||
| 474 | @@ -1463,6 +1464,7 @@ cli_getprkey(void * v, char ** reply, int * len, void * data) | ||
| 475 | struct multipath * mpp; | ||
| 476 | struct vectors * vecs = (struct vectors *)data; | ||
| 477 | char *mapname = get_keyparam(v, MAP); | ||
| 478 | + char *flagstr = ""; | ||
| 479 | |||
| 480 | mapname = convert_dev(mapname, 0); | ||
| 481 | condlog(3, "%s: get persistent reservation key (operator)", mapname); | ||
| 482 | @@ -1478,8 +1480,10 @@ cli_getprkey(void * v, char ** reply, int * len, void * data) | ||
| 483 | *len = strlen(*reply) + 1; | ||
| 484 | return 0; | ||
| 485 | } | ||
| 486 | - snprintf(*reply, 20, "0x%" PRIx64 "\n", | ||
| 487 | - get_be64(mpp->reservation_key)); | ||
| 488 | + if (mpp->sa_flags & MPATH_F_APTPL_MASK) | ||
| 489 | + flagstr = ":aptpl"; | ||
| 490 | + snprintf(*reply, 20, "0x%" PRIx64 "%s\n", | ||
| 491 | + get_be64(mpp->reservation_key), flagstr); | ||
| 492 | (*reply)[19] = '\0'; | ||
| 493 | *len = strlen(*reply) + 1; | ||
| 494 | return 0; | ||
| 495 | @@ -1503,7 +1507,7 @@ cli_unsetprkey(void * v, char ** reply, int * len, void * data) | ||
| 496 | |||
| 497 | conf = get_multipath_config(); | ||
| 498 | pthread_cleanup_push(put_multipath_config, conf); | ||
| 499 | - ret = set_prkey(conf, mpp, 0); | ||
| 500 | + ret = set_prkey(conf, mpp, 0, 0); | ||
| 501 | pthread_cleanup_pop(1); | ||
| 502 | |||
| 503 | return ret; | ||
| 504 | @@ -1517,6 +1521,7 @@ cli_setprkey(void * v, char ** reply, int * len, void * data) | ||
| 505 | char *mapname = get_keyparam(v, MAP); | ||
| 506 | char *keyparam = get_keyparam(v, KEY); | ||
| 507 | uint64_t prkey; | ||
| 508 | + uint8_t flags; | ||
| 509 | int ret; | ||
| 510 | struct config *conf; | ||
| 511 | |||
| 512 | @@ -1527,14 +1532,14 @@ cli_setprkey(void * v, char ** reply, int * len, void * data) | ||
| 513 | if (!mpp) | ||
| 514 | return 1; | ||
| 515 | |||
| 516 | - if (parse_prkey(keyparam, &prkey) != 0) { | ||
| 517 | + if (parse_prkey_flags(keyparam, &prkey, &flags) != 0) { | ||
| 518 | condlog(0, "%s: invalid prkey : '%s'", mapname, keyparam); | ||
| 519 | return 1; | ||
| 520 | } | ||
| 521 | |||
| 522 | conf = get_multipath_config(); | ||
| 523 | pthread_cleanup_push(put_multipath_config, conf); | ||
| 524 | - ret = set_prkey(conf, mpp, prkey); | ||
| 525 | + ret = set_prkey(conf, mpp, prkey, flags); | ||
| 526 | pthread_cleanup_pop(1); | ||
| 527 | |||
| 528 | return ret; | ||
| 529 | diff --git a/multipathd/main.c b/multipathd/main.c | ||
| 530 | index d40c416..6b1e782 100644 | ||
| 531 | --- a/multipathd/main.c | ||
| 532 | +++ b/multipathd/main.c | ||
| 533 | @@ -3089,6 +3089,7 @@ void * mpath_pr_event_handler_fn (void * pathp ) | ||
| 534 | |||
| 535 | param= malloc(sizeof(struct prout_param_descriptor)); | ||
| 536 | memset(param, 0 , sizeof(struct prout_param_descriptor)); | ||
| 537 | + param->sa_flags = mpp->sa_flags; | ||
| 538 | memcpy(param->sa_key, &mpp->reservation_key, 8); | ||
| 539 | param->num_transportid = 0; | ||
| 540 | |||
| 541 | -- | ||
| 542 | 2.7.4 | ||
| 543 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0018-multipath-don-t-check-timestamps-without-a-path.patch b/meta-oe/recipes-support/multipath-tools/files/0018-multipath-don-t-check-timestamps-without-a-path.patch deleted file mode 100644 index 5a3fd8374b..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0018-multipath-don-t-check-timestamps-without-a-path.patch +++ /dev/null | |||
| @@ -1,34 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 3 | Date: Tue, 5 Jun 2018 15:31:55 -0500 | ||
| 4 | Subject: [PATCH] multipath: don't check timestamps without a path | ||
| 5 | |||
| 6 | If a path was blacklisted, pathvec could exist but have no path in it. | ||
| 7 | print_cmd_valid wasn't checking this before calling | ||
| 8 | find_multipaths_check_timeout(). This was causing it to dereference a | ||
| 9 | NULL pointer in these cases. | ||
| 10 | |||
| 11 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 12 | --- | ||
| 13 | multipath/main.c | 4 +--- | ||
| 14 | 1 file changed, 1 insertion(+), 3 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/multipath/main.c b/multipath/main.c | ||
| 17 | index c69e996..3f0a6aa 100644 | ||
| 18 | --- a/multipath/main.c | ||
| 19 | +++ b/multipath/main.c | ||
| 20 | @@ -482,10 +482,8 @@ static int print_cmd_valid(int k, const vector pathvec, | ||
| 21 | pp, pp->find_multipaths_timeout, &until); | ||
| 22 | if (wait != FIND_MULTIPATHS_WAITING) | ||
| 23 | k = 1; | ||
| 24 | - } else if (pathvec != NULL) { | ||
| 25 | - pp = VECTOR_SLOT(pathvec, 0); | ||
| 26 | + } else if (pathvec != NULL && (pp = VECTOR_SLOT(pathvec, 0))) | ||
| 27 | wait = find_multipaths_check_timeout(pp, 0, &until); | ||
| 28 | - } | ||
| 29 | if (wait == FIND_MULTIPATHS_WAITING) | ||
| 30 | printf("FIND_MULTIPATHS_WAIT_UNTIL=\"%ld.%06ld\"\n", | ||
| 31 | until.tv_sec, until.tv_nsec/1000); | ||
| 32 | -- | ||
| 33 | 2.7.4 | ||
| 34 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0019-libmultipath-fix-detect-alua-corner-case.patch b/meta-oe/recipes-support/multipath-tools/files/0019-libmultipath-fix-detect-alua-corner-case.patch deleted file mode 100644 index 23908fa585..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0019-libmultipath-fix-detect-alua-corner-case.patch +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 3 | Date: Fri, 8 Jun 2018 17:12:37 -0500 | ||
| 4 | Subject: [PATCH] libmultipath: fix detect alua corner case | ||
| 5 | |||
| 6 | If retain_attach_hw_handler = no, then the paths tpgs state will never | ||
| 7 | be checked, and the multipath device will always select the alua | ||
| 8 | handler, if no other handler is selected. the paths tpgs state | ||
| 9 | should be checked, regardless of the retain_hwhandler value. | ||
| 10 | |||
| 11 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 12 | --- | ||
| 13 | libmultipath/propsel.c | 4 +++- | ||
| 14 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c | ||
| 17 | index 62a6893..f626c74 100644 | ||
| 18 | --- a/libmultipath/propsel.c | ||
| 19 | +++ b/libmultipath/propsel.c | ||
| 20 | @@ -403,9 +403,11 @@ int select_hwhandler(struct config *conf, struct multipath *mp) | ||
| 21 | bool all_tpgs = true; | ||
| 22 | |||
| 23 | dh_state = &handler[2]; | ||
| 24 | + | ||
| 25 | + vector_foreach_slot(mp->paths, pp, i) | ||
| 26 | + all_tpgs = all_tpgs && (pp->tpgs > 0); | ||
| 27 | if (mp->retain_hwhandler != RETAIN_HWHANDLER_OFF) { | ||
| 28 | vector_foreach_slot(mp->paths, pp, i) { | ||
| 29 | - all_tpgs = all_tpgs && (pp->tpgs > 0); | ||
| 30 | if (get_dh_state(pp, dh_state, sizeof(handler) - 2) > 0 | ||
| 31 | && strcmp(dh_state, "detached")) { | ||
| 32 | memcpy(handler, "1 ", 2); | ||
| 33 | -- | ||
| 34 | 2.7.4 | ||
| 35 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0020-multipath-fix-setting-conf-version.patch b/meta-oe/recipes-support/multipath-tools/files/0020-multipath-fix-setting-conf-version.patch deleted file mode 100644 index 624f45efd8..0000000000 --- a/meta-oe/recipes-support/multipath-tools/files/0020-multipath-fix-setting-conf-version.patch +++ /dev/null | |||
| @@ -1,39 +0,0 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 3 | Date: Fri, 8 Jun 2018 17:23:07 -0500 | ||
| 4 | Subject: [PATCH] multipath: fix setting conf->version | ||
| 5 | |||
| 6 | Commit d3b71498 stopped multipath from setting conf->version. Instead, | ||
| 7 | it was always being set to 0.0.0. Multipathd was still setting this | ||
| 8 | correctly. | ||
| 9 | |||
| 10 | Fixes: d3b71498 "multipath: fix rcu thread cancellation hang" | ||
| 11 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | ||
| 12 | --- | ||
| 13 | libmultipath/devmapper.c | 6 +++--- | ||
| 14 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c | ||
| 17 | index f2befad..8136d15 100644 | ||
| 18 | --- a/libmultipath/devmapper.c | ||
| 19 | +++ b/libmultipath/devmapper.c | ||
| 20 | @@ -245,13 +245,13 @@ void libmp_dm_init(void) | ||
| 21 | int verbosity; | ||
| 22 | unsigned int version[3]; | ||
| 23 | |||
| 24 | + if (dm_prereq(version)) | ||
| 25 | + exit(1); | ||
| 26 | conf = get_multipath_config(); | ||
| 27 | verbosity = conf->verbosity; | ||
| 28 | - memcpy(version, conf->version, sizeof(version)); | ||
| 29 | + memcpy(conf->version, version, sizeof(version)); | ||
| 30 | put_multipath_config(conf); | ||
| 31 | dm_init(verbosity); | ||
| 32 | - if (dm_prereq(version)) | ||
| 33 | - exit(1); | ||
| 34 | dm_udev_set_sync_support(libmp_dm_udev_sync); | ||
| 35 | } | ||
| 36 | |||
| 37 | -- | ||
| 38 | 2.7.4 | ||
| 39 | |||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0022-RH-Remove-the-property-blacklist-exception-builtin.patch b/meta-oe/recipes-support/multipath-tools/files/0022-RH-Remove-the-property-blacklist-exception-builtin.patch index 451c524c9a..a5c2b5e6c8 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0022-RH-Remove-the-property-blacklist-exception-builtin.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0022-RH-Remove-the-property-blacklist-exception-builtin.patch | |||
| @@ -1,7 +1,10 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | 1 | From 1fede9514566a21cdf3da99e22ddf5a7b2c856c6 Mon Sep 17 00:00:00 2001 |
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Wed, 2 Jul 2014 12:49:53 -0500 | 3 | Date: Fri, 23 Nov 2018 16:47:31 +0800 |
| 4 | Subject: [PATCH] RH: Remove the property blacklist exception builtin | 4 | Subject: [PATCH] From 0000000000000000000000000000000000000000 Mon Sep 17 |
| 5 | 00:00:00 2001 From: Benjamin Marzinski <bmarzins@redhat.com> Date: Wed, 2 Jul | ||
| 6 | 2014 12:49:53 -0500 Subject: [PATCH] RH: Remove the property blacklist | ||
| 7 | exception builtin | ||
| 5 | 8 | ||
| 6 | Multipath set the default property blacklist exceptions to | 9 | Multipath set the default property blacklist exceptions to |
| 7 | (ID_SCSI_VPD|ID_WWN). This has the effect of blacklisting some internal | 10 | (ID_SCSI_VPD|ID_WWN). This has the effect of blacklisting some internal |
| @@ -12,76 +15,46 @@ blacklist_exception is given, then devices aren't failed for not matching | |||
| 12 | it. | 15 | it. |
| 13 | 16 | ||
| 14 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | 17 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> |
| 18 | |||
| 19 | Upsteam-Status: Pending | ||
| 20 | |||
| 21 | update this patch to new version | ||
| 22 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 15 | --- | 23 | --- |
| 16 | libmultipath/blacklist.c | 15 ++++++--------- | 24 | libmultipath/blacklist.c | 13 +++++-------- |
| 17 | multipath/multipath.conf.5 | 14 ++++++++------ | 25 | 1 file changed, 5 insertions(+), 8 deletions(-) |
| 18 | 2 files changed, 14 insertions(+), 15 deletions(-) | ||
| 19 | 26 | ||
| 20 | diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c | 27 | diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c |
| 21 | index ee396e2..19d4697 100644 | 28 | index 318ec03..145fed3 100644 |
| 22 | --- a/libmultipath/blacklist.c | 29 | --- a/libmultipath/blacklist.c |
| 23 | +++ b/libmultipath/blacklist.c | 30 | +++ b/libmultipath/blacklist.c |
| 24 | @@ -181,12 +181,6 @@ setup_default_blist (struct config * conf) | 31 | @@ -192,12 +192,6 @@ setup_default_blist (struct config * conf) |
| 25 | if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT)) | 32 | char * str; |
| 26 | return 1; | 33 | int i; |
| 27 | 34 | ||
| 28 | - str = STRDUP("(SCSI_IDENT_|ID_WWN)"); | 35 | - str = STRDUP("^(ram|raw|loop|fd|md|dm-|sr|scd|st|dcssblk)[0-9]"); |
| 29 | - if (!str) | 36 | - if (!str) |
| 30 | - return 1; | 37 | - return 1; |
| 31 | - if (store_ble(conf->elist_property, str, ORIGIN_DEFAULT)) | 38 | - if (store_ble(conf->blist_devnode, str, ORIGIN_DEFAULT)) |
| 32 | - return 1; | 39 | - return 1; |
| 33 | - | 40 | - |
| 34 | vector_foreach_slot (conf->hwtable, hwe, i) { | 41 | str = STRDUP("^(td|hd|vd)[a-z]"); |
| 35 | if (hwe->bl_product) { | 42 | if (!str) |
| 36 | if (_blacklist_device(conf->blist_device, hwe->vendor, | 43 | return 1; |
| 37 | @@ -390,9 +384,12 @@ filter_property(struct config * conf, struct udev_device * udev) | 44 | @@ -415,8 +409,11 @@ filter_property(struct config * conf, struct udev_device * udev) |
| 38 | * This is the inverse of the 'normal' matching; | 45 | } |
| 39 | * the environment variable _has_ to match. | 46 | } |
| 40 | */ | 47 | |
| 41 | - log_filter(devname, NULL, NULL, NULL, NULL, | 48 | - log_filter(devname, NULL, NULL, NULL, env, NULL, r); |
| 42 | - MATCH_PROPERTY_BLIST_MISSING); | 49 | - return r; |
| 43 | - return MATCH_PROPERTY_BLIST_MISSING; | ||
| 44 | + if (VECTOR_SIZE(conf->elist_property)) { | 50 | + if (VECTOR_SIZE(conf->elist_property)) { |
| 45 | + log_filter(devname, NULL, NULL, NULL, NULL, | 51 | + log_filter(devname, NULL, NULL, NULL, env, NULL, r); |
| 46 | + MATCH_PROPERTY_BLIST_MISSING); | 52 | + return r; |
| 47 | + return MATCH_PROPERTY_BLIST_MISSING; | ||
| 48 | + } | 53 | + } |
| 49 | + return 0; | 54 | + return 0; |
| 50 | } | 55 | } |
| 51 | 56 | ||
| 52 | void | 57 | static void free_ble(struct blentry *ble) |
| 53 | diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 | ||
| 54 | index 30d8598..c45da9f 100644 | ||
| 55 | --- a/multipath/multipath.conf.5 | ||
| 56 | +++ b/multipath/multipath.conf.5 | ||
| 57 | @@ -1179,10 +1179,6 @@ The \fIWorld Wide Identification\fR of a device. | ||
| 58 | .TP | ||
| 59 | .B property | ||
| 60 | Regular expression of the udev property to be whitelisted. | ||
| 61 | -.RS | ||
| 62 | -.TP | ||
| 63 | -The default is: \fB(SCSI_IDENT_|ID_WWN)\fR | ||
| 64 | -.RE | ||
| 65 | .TP | ||
| 66 | .B device | ||
| 67 | Subsection for the device description. This subsection recognizes the | ||
| 68 | @@ -1193,8 +1189,14 @@ keywords. For a full description of these keywords please see the \fIdevices\fR | ||
| 69 | section description. | ||
| 70 | .LP | ||
| 71 | The \fIproperty\fR whitelist handling is different from the usual | ||
| 72 | -handling in the sense that the device \fIhas\fR to have a udev property that | ||
| 73 | -matches the whitelist, otherwise the device will be blacklisted. In these cases the message \fIblacklisted, udev property missing\fR will be displayed. | ||
| 74 | +handling in the sense that if the propery whitelist is set, the device | ||
| 75 | +\fIhas\fR to have a udev property that matches the whitelist, otherwise the | ||
| 76 | +device will be blacklisted. In these cases the message \fIblacklisted, udev | ||
| 77 | +property missing\fR will be displayed. For example settting the | ||
| 78 | +property blacklist_exception to \fB(SCSI_IDENT_|ID_WWN)\fR will blacklist | ||
| 79 | +all devices that have no udev property whose name regex matches either | ||
| 80 | +\fBSCSI_IDENT_\fR or \fBID_WWN\fR. This works to exclude most | ||
| 81 | +non-multipathable devices. | ||
| 82 | . | ||
| 83 | . | ||
| 84 | .\" ---------------------------------------------------------------------------- | ||
| 85 | -- | 58 | -- |
| 86 | 2.7.4 | 59 | 2.7.4 |
| 87 | 60 | ||
diff --git a/meta-oe/recipes-support/multipath-tools/files/0023-RH-don-t-start-without-a-config-file.patch b/meta-oe/recipes-support/multipath-tools/files/0023-RH-don-t-start-without-a-config-file.patch index 886f1c86f1..ea6137f878 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0023-RH-don-t-start-without-a-config-file.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0023-RH-don-t-start-without-a-config-file.patch | |||
| @@ -1,7 +1,10 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | 1 | From 0bf8ff8dab26201b268b419809844c07e168f17d Mon Sep 17 00:00:00 2001 |
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Wed, 15 Oct 2014 10:39:30 -0500 | 3 | Date: Fri, 23 Nov 2018 17:25:15 +0800 |
| 4 | Subject: [PATCH] RH: don't start without a config file | 4 | Subject: [PATCH] From 0000000000000000000000000000000000000000 Mon Sep 17 |
| 5 | 00:00:00 2001 From: Benjamin Marzinski <bmarzins@redhat.com> Date: Wed, 15 | ||
| 6 | Oct 2014 10:39:30 -0500 Subject: [PATCH] RH: don't start without a config | ||
| 7 | file | ||
| 5 | 8 | ||
| 6 | If /etc/multipath.conf doesn't exist, don't start multipathd and blacklist | 9 | If /etc/multipath.conf doesn't exist, don't start multipathd and blacklist |
| 7 | all devices when running multipath. A completely blank configuration file | 10 | all devices when running multipath. A completely blank configuration file |
| @@ -11,16 +14,21 @@ simple way to disable multipath. Simply removing or renaming | |||
| 11 | /etc/multipath.conf will keep multipath from doing anything. | 14 | /etc/multipath.conf will keep multipath from doing anything. |
| 12 | 15 | ||
| 13 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | 16 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> |
| 17 | |||
| 18 | Upstream-Status: Pending | ||
| 19 | |||
| 20 | update this patch to new version | ||
| 21 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 14 | --- | 22 | --- |
| 15 | libmultipath/config.c | 15 +++++++++++++++ | 23 | libmultipath/config.c | 18 ++++++++++++++++++ |
| 16 | libmultipath/config.h | 1 + | 24 | libmultipath/config.h | 1 + |
| 17 | multipath/multipath.rules | 1 + | 25 | multipath/multipath.rules | 1 + |
| 18 | multipathd/multipathd.8 | 2 ++ | 26 | multipathd/multipathd.8 | 2 ++ |
| 19 | multipathd/multipathd.service | 1 + | 27 | multipathd/multipathd.service | 1 + |
| 20 | 5 files changed, 20 insertions(+) | 28 | 5 files changed, 23 insertions(+) |
| 21 | 29 | ||
| 22 | diff --git a/libmultipath/config.c b/libmultipath/config.c | 30 | diff --git a/libmultipath/config.c b/libmultipath/config.c |
| 23 | index 5872927..0607403 100644 | 31 | index 5af7af5..e4233f1 100644 |
| 24 | --- a/libmultipath/config.c | 32 | --- a/libmultipath/config.c |
| 25 | +++ b/libmultipath/config.c | 33 | +++ b/libmultipath/config.c |
| 26 | @@ -26,6 +26,7 @@ | 34 | @@ -26,6 +26,7 @@ |
| @@ -30,30 +38,33 @@ index 5872927..0607403 100644 | |||
| 30 | +#include "version.h" | 38 | +#include "version.h" |
| 31 | 39 | ||
| 32 | static int | 40 | static int |
| 33 | hwe_strmatch (struct hwentry *hwe1, struct hwentry *hwe2) | 41 | hwe_strmatch (const struct hwentry *hwe1, const struct hwentry *hwe2) |
| 34 | @@ -658,6 +659,20 @@ load_config (char * file) | 42 | @@ -743,6 +745,23 @@ load_config (char * file) |
| 35 | factorize_hwtable(conf->hwtable, builtin_hwtable_size); | 43 | goto out; |
| 36 | } | 44 | } |
| 37 | 45 | factorize_hwtable(conf->hwtable, builtin_hwtable_size, file); | |
| 38 | + } else { | 46 | + } else { |
| 39 | + condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); | 47 | + condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); |
| 40 | + if (conf->blist_devnode == NULL) { | 48 | + if (conf->blist_devnode == NULL) { |
| 41 | + conf->blist_devnode = vector_alloc(); | 49 | + conf->blist_devnode = vector_alloc(); |
| 42 | + if (!conf->blist_devnode) { | 50 | + if (!conf->blist_devnode) { |
| 43 | + condlog(0, "cannot allocate blacklist\n"); | 51 | + conf->blist_devnode = vector_alloc(); |
| 52 | + if (!conf->blist_devnode) { | ||
| 53 | + condlog(0, "cannot allocate blacklist\n"); | ||
| 54 | + goto out; | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + if (store_ble(conf->blist_devnode, strdup(".*"), | ||
| 58 | + ORIGIN_NO_CONFIG)) { | ||
| 59 | + condlog(0, "cannot store default no-config blacklist\n"); | ||
| 44 | + goto out; | 60 | + goto out; |
| 45 | + } | 61 | + } |
| 46 | + } | 62 | + } |
| 47 | + if (store_ble(conf->blist_devnode, strdup(".*"), | ||
| 48 | + ORIGIN_NO_CONFIG)) { | ||
| 49 | + condlog(0, "cannot store default no-config blacklist\n"); | ||
| 50 | + goto out; | ||
| 51 | + } | ||
| 52 | } | 63 | } |
| 53 | 64 | ||
| 54 | conf->processed_main_config = 1; | 65 | conf->processed_main_config = 1; |
| 55 | diff --git a/libmultipath/config.h b/libmultipath/config.h | 66 | diff --git a/libmultipath/config.h b/libmultipath/config.h |
| 56 | index fcbe3fc..3a42435 100644 | 67 | index 7d0cd9a..d7fb8e2 100644 |
| 57 | --- a/libmultipath/config.h | 68 | --- a/libmultipath/config.h |
| 58 | +++ b/libmultipath/config.h | 69 | +++ b/libmultipath/config.h |
| 59 | @@ -9,6 +9,7 @@ | 70 | @@ -9,6 +9,7 @@ |
| @@ -65,7 +76,7 @@ index fcbe3fc..3a42435 100644 | |||
| 65 | /* | 76 | /* |
| 66 | * In kernel, fast_io_fail == 0 means immediate failure on rport delete. | 77 | * In kernel, fast_io_fail == 0 means immediate failure on rport delete. |
| 67 | diff --git a/multipath/multipath.rules b/multipath/multipath.rules | 78 | diff --git a/multipath/multipath.rules b/multipath/multipath.rules |
| 68 | index d658073..b3f54d7 100644 | 79 | index 9df11a9..0486bf7 100644 |
| 69 | --- a/multipath/multipath.rules | 80 | --- a/multipath/multipath.rules |
| 70 | +++ b/multipath/multipath.rules | 81 | +++ b/multipath/multipath.rules |
| 71 | @@ -9,6 +9,7 @@ IMPORT{cmdline}="nompath" | 82 | @@ -9,6 +9,7 @@ IMPORT{cmdline}="nompath" |
| @@ -77,7 +88,7 @@ index d658073..b3f54d7 100644 | |||
| 77 | ENV{DEVTYPE}!="partition", GOTO="test_dev" | 88 | ENV{DEVTYPE}!="partition", GOTO="test_dev" |
| 78 | IMPORT{parent}="DM_MULTIPATH_DEVICE_PATH" | 89 | IMPORT{parent}="DM_MULTIPATH_DEVICE_PATH" |
| 79 | diff --git a/multipathd/multipathd.8 b/multipathd/multipathd.8 | 90 | diff --git a/multipathd/multipathd.8 b/multipathd/multipathd.8 |
| 80 | index e78ac9e..09cdead 100644 | 91 | index 94c3f97..ed13efd 100644 |
| 81 | --- a/multipathd/multipathd.8 | 92 | --- a/multipathd/multipathd.8 |
| 82 | +++ b/multipathd/multipathd.8 | 93 | +++ b/multipathd/multipathd.8 |
| 83 | @@ -38,6 +38,8 @@ map regains its maximum performance and redundancy. | 94 | @@ -38,6 +38,8 @@ map regains its maximum performance and redundancy. |
diff --git a/meta-oe/recipes-support/multipath-tools/files/0024-RH-use-rpm-optflags-if-present.patch b/meta-oe/recipes-support/multipath-tools/files/0024-RH-use-rpm-optflags-if-present.patch index 9330bf0701..77dd96fee6 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0024-RH-use-rpm-optflags-if-present.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0024-RH-use-rpm-optflags-if-present.patch | |||
| @@ -1,49 +1,58 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | 1 | From 436f7594485e35523269e662c4b5dc3a2c10ff9b Mon Sep 17 00:00:00 2001 |
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Wed, 19 Apr 2017 06:10:01 -0500 | 3 | Date: Mon, 26 Nov 2018 09:19:17 +0800 |
| 4 | Subject: [PATCH] RH: use rpm optflags if present | 4 | Subject: [PATCH] From 0000000000000000000000000000000000000000 Mon Sep 17 |
| 5 | 00:00:00 2001 From: Benjamin Marzinski <bmarzins@redhat.com> Date: Wed, 19 | ||
| 6 | Apr 2017 06:10:01 -0500 Subject: [PATCH] RH: use rpm optflags if present | ||
| 5 | 7 | ||
| 6 | Use the passed in optflags when compiling as an RPM, and keep the | 8 | Use the passed in optflags when compiling as an RPM, and keep the |
| 7 | default flags as close as possible to the current fedora flags, while | 9 | default flags as close as possible to the current fedora flags, while |
| 8 | still being generic. | 10 | still being generic. |
| 9 | 11 | ||
| 10 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | 12 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> |
| 13 | |||
| 14 | Upstream-Status: Pending | ||
| 15 | |||
| 16 | update this patch to new version | ||
| 17 | |||
| 18 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 11 | --- | 19 | --- |
| 12 | Makefile.inc | 24 ++++++++++++++++-------- | 20 | Makefile.inc | 25 ++++++++++++++++--------- |
| 13 | 1 file changed, 16 insertions(+), 8 deletions(-) | 21 | 1 file changed, 16 insertions(+), 9 deletions(-) |
| 14 | 22 | ||
| 15 | diff --git a/Makefile.inc b/Makefile.inc | 23 | diff --git a/Makefile.inc b/Makefile.inc |
| 16 | index 0b271ea..5ff69a3 100644 | 24 | index b86cba6..295afb9 100644 |
| 17 | --- a/Makefile.inc | 25 | --- a/Makefile.inc |
| 18 | +++ b/Makefile.inc | 26 | +++ b/Makefile.inc |
| 19 | @@ -85,14 +85,22 @@ TEST_CC_OPTION = $(shell \ | 27 | @@ -85,15 +85,22 @@ TEST_CC_OPTION = $(shell \ |
| 20 | echo "$(2)"; \ | 28 | echo "$(2)"; \ |
| 21 | fi) | 29 | fi) |
| 22 | 30 | ||
| 23 | -STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector) | 31 | -STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector) |
| 32 | -ERROR_DISCARDED_QUALIFIERS := $(call TEST_CC_OPTION,-Werror=discarded-qualifiers,) | ||
| 24 | - | 33 | - |
| 25 | -OPTFLAGS = -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \ | 34 | -OPTFLAGS = -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \ |
| 26 | - -Werror=implicit-function-declaration -Werror=format-security \ | 35 | - -Werror=implicit-function-declaration -Werror=format-security \ |
| 27 | - -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered \ | 36 | - -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered \ |
| 28 | - -Werror=cast-qual -Werror=discarded-qualifiers \ | 37 | - -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \ |
| 29 | - -Wp,-D_FORTIFY_SOURCE=2 $(STACKPROT) \ | 38 | - -Wp,-D_FORTIFY_SOURCE=2 $(STACKPROT) \ |
| 30 | - --param=ssp-buffer-size=4 | 39 | - --param=ssp-buffer-size=4 |
| 31 | +ifndef RPM_OPT_FLAGS | 40 | +ifndef RPM_OPT_FLAGS |
| 32 | + STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector) | 41 | + STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector) |
| 33 | + OPTFLAGS = -O2 -g -pipe -Wall -Werror=format-security \ | 42 | + OPTFLAGS = -O2 -g -pipe -Wall -Werror=format-security \ |
| 34 | + -Wp,-D_FORTIFY_SOURCE=2 -fexceptions \ | 43 | + -Wp,-D_FORTIFY_SOURCE=2 -fexceptions \ |
| 35 | + $(STACKPROT) --param=ssp-buffer-size=4 \ | 44 | + $(STACKPROT) --param=ssp-buffer-size=4 \ |
| 36 | + -grecord-gcc-switches | 45 | + -grecord-gcc-switches |
| 37 | + ifeq ($(shell test -f /usr/lib/rpm/redhat/redhat-hardened-cc1 && echo 1),1) | 46 | + ifeq ($(shell test -f /usr/lib/rpm/redhat/redhat-hardened-cc1 && echo 1),1) |
| 38 | + OPTFLAGS += -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 | 47 | + OPTFLAGS += -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 |
| 39 | + endif | 48 | + endif |
| 40 | +else | 49 | +else |
| 41 | + OPTFLAGS = $(RPM_OPT_FLAGS) | 50 | + OPTFLAGS = $(RPM_OPT_FLAGS) |
| 42 | +endif | 51 | +endif |
| 43 | +OPTFLAGS += -Wextra -Wstrict-prototypes -Wformat=2 -Werror=implicit-int \ | 52 | +OPTFLAGS += -Wextra -Wstrict-prototypes -Wformat=2 -Werror=implicit-int \ |
| 44 | + -Werror=implicit-function-declaration -Wno-sign-compare \ | 53 | + -Werror=implicit-function-declaration -Wno-sign-compare \ |
| 45 | + -Wno-unused-parameter -Werror=cast-qual \ | 54 | + -Wno-unused-parameter -Werror=cast-qual \ |
| 46 | + -Werror=discarded-qualifiers | 55 | + -Werror=discarded-qualifiers |
| 47 | 56 | ||
| 48 | CFLAGS := $(OPTFLAGS) -DBIN_DIR=\"$(bindir)\" -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" \ | 57 | CFLAGS := $(OPTFLAGS) -DBIN_DIR=\"$(bindir)\" -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" \ |
| 49 | -MMD -MP $(CFLAGS) | 58 | -MMD -MP $(CFLAGS) |
diff --git a/meta-oe/recipes-support/multipath-tools/files/0025-RH-add-mpathconf.patch b/meta-oe/recipes-support/multipath-tools/files/0025-RH-add-mpathconf.patch index 5cad22b2b2..a1407718d5 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0025-RH-add-mpathconf.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0025-RH-add-mpathconf.patch | |||
| @@ -1,7 +1,9 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | 1 | From eb5a36e6e0caedf06008e48eb77b7bf7c6534ee5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Thu, 16 Oct 2014 15:49:01 -0500 | 3 | Date: Mon, 26 Nov 2018 09:55:12 +0800 |
| 4 | Subject: [PATCH] RH: add mpathconf | 4 | Subject: [PATCH] From 0000000000000000000000000000000000000000 Mon Sep 17 |
| 5 | 00:00:00 2001 From: Benjamin Marzinski <bmarzins@redhat.com> Date: Thu, 16 | ||
| 6 | Oct 2014 15:49:01 -0500 Subject: [PATCH] RH: add mpathconf | ||
| 5 | 7 | ||
| 6 | mpathconf is a program (largely based on lvmcomf) to help users | 8 | mpathconf is a program (largely based on lvmcomf) to help users |
| 7 | configure /etc/multipath.conf and enable or disable multipathing. It | 9 | configure /etc/multipath.conf and enable or disable multipathing. It |
| @@ -11,6 +13,12 @@ with the OS defaults, and to enable and disable multipathing via | |||
| 11 | a single command. | 13 | a single command. |
| 12 | 14 | ||
| 13 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | 15 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> |
| 16 | |||
| 17 | Upstream-Status: Pending | ||
| 18 | |||
| 19 | update this patch to new version | ||
| 20 | |||
| 21 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 14 | --- | 22 | --- |
| 15 | libmultipath/config.c | 1 + | 23 | libmultipath/config.c | 1 + |
| 16 | multipath/Makefile | 5 + | 24 | multipath/Makefile | 5 + |
| @@ -21,11 +29,11 @@ Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | |||
| 21 | create mode 100644 multipath/mpathconf.8 | 29 | create mode 100644 multipath/mpathconf.8 |
| 22 | 30 | ||
| 23 | diff --git a/libmultipath/config.c b/libmultipath/config.c | 31 | diff --git a/libmultipath/config.c b/libmultipath/config.c |
| 24 | index 0607403..5c98e48 100644 | 32 | index e4233f1..b779505 100644 |
| 25 | --- a/libmultipath/config.c | 33 | --- a/libmultipath/config.c |
| 26 | +++ b/libmultipath/config.c | 34 | +++ b/libmultipath/config.c |
| 27 | @@ -661,6 +661,7 @@ load_config (char * file) | 35 | @@ -747,6 +747,7 @@ load_config (char * file) |
| 28 | 36 | factorize_hwtable(conf->hwtable, builtin_hwtable_size, file); | |
| 29 | } else { | 37 | } else { |
| 30 | condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); | 38 | condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); |
| 31 | + condlog(0, "You can run /sbin/mpathconf to create or modify /etc/multipath.conf"); | 39 | + condlog(0, "You can run /sbin/mpathconf to create or modify /etc/multipath.conf"); |
diff --git a/meta-oe/recipes-support/multipath-tools/files/0026-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch b/meta-oe/recipes-support/multipath-tools/files/0026-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch index ddf022f762..912832a084 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0026-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0026-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch | |||
| @@ -1,7 +1,10 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | 1 | From 694a2a6c7e4b523603b30a109b6efb1c30a7cec3 Mon Sep 17 00:00:00 2001 |
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Fri, 17 Oct 2014 11:20:34 -0500 | 3 | Date: Mon, 26 Nov 2018 10:17:58 +0800 |
| 4 | Subject: [PATCH] RH: add wwids from kernel cmdline mpath.wwids with -A | 4 | Subject: [PATCH] From 0000000000000000000000000000000000000000 Mon Sep 17 |
| 5 | 00:00:00 2001 From: Benjamin Marzinski <bmarzins@redhat.com> Date: Fri, 17 | ||
| 6 | Oct 2014 11:20:34 -0500 Subject: [PATCH] RH: add wwids from kernel cmdline | ||
| 7 | mpath.wwids with -A | ||
| 5 | 8 | ||
| 6 | This patch adds another option to multipath, "-A", which reads | 9 | This patch adds another option to multipath, "-A", which reads |
| 7 | /proc/cmdline for mpath.wwid=<WWID> options, and adds any wwids it finds | 10 | /proc/cmdline for mpath.wwid=<WWID> options, and adds any wwids it finds |
| @@ -13,16 +16,22 @@ patch also execs "/sbin/multipath -A" before running multipathd in | |||
| 13 | multipathd.service | 16 | multipathd.service |
| 14 | 17 | ||
| 15 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | 18 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> |
| 19 | |||
| 20 | Upstream-Status: Pending | ||
| 21 | |||
| 22 | Update this patch to new version | ||
| 23 | |||
| 24 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 16 | --- | 25 | --- |
| 17 | libmultipath/wwids.c | 44 +++++++++++++++++++++++++++++++++++++++++++ | 26 | libmultipath/wwids.c | 44 +++++++++++++++++++++++++++++++++++++++++++ |
| 18 | libmultipath/wwids.h | 1 + | 27 | libmultipath/wwids.h | 1 + |
| 19 | multipath/main.c | 10 ++++++++-- | 28 | multipath/main.c | 10 ++++++++-- |
| 20 | multipath/multipath.8 | 5 ++++- | 29 | multipath/multipath.8 | 3 +++ |
| 21 | multipathd/multipathd.service | 1 + | 30 | multipathd/multipathd.service | 1 + |
| 22 | 5 files changed, 58 insertions(+), 3 deletions(-) | 31 | 5 files changed, 57 insertions(+), 2 deletions(-) |
| 23 | 32 | ||
| 24 | diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c | 33 | diff --git a/libmultipath/wwids.c b/libmultipath/wwids.c |
| 25 | index 53e7951..39e08cd 100644 | 34 | index 53e7951..9ba9b62 100644 |
| 26 | --- a/libmultipath/wwids.c | 35 | --- a/libmultipath/wwids.c |
| 27 | +++ b/libmultipath/wwids.c | 36 | +++ b/libmultipath/wwids.c |
| 28 | @@ -443,3 +443,47 @@ int op ## _wwid(const char *wwid) \ | 37 | @@ -443,3 +443,47 @@ int op ## _wwid(const char *wwid) \ |
| @@ -32,46 +41,46 @@ index 53e7951..39e08cd 100644 | |||
| 32 | + | 41 | + |
| 33 | +int remember_cmdline_wwid(void) | 42 | +int remember_cmdline_wwid(void) |
| 34 | +{ | 43 | +{ |
| 35 | + FILE *f = NULL; | 44 | + FILE *f = NULL; |
| 36 | + char buf[LINE_MAX], *next, *ptr; | 45 | + char buf[LINE_MAX], *next, *ptr; |
| 37 | + int ret = 0; | 46 | + int ret = 0; |
| 38 | + | 47 | + |
| 39 | + f = fopen("/proc/cmdline", "re"); | 48 | + f = fopen("/proc/cmdline", "re"); |
| 40 | + if (!f) { | 49 | + if (!f) { |
| 41 | + condlog(0, "can't open /proc/cmdline : %s", strerror(errno)); | 50 | + condlog(0, "can't open /proc/cmdline : %s", strerror(errno)); |
| 42 | + return -1; | 51 | + return -1; |
| 43 | + } | 52 | + } |
| 44 | + | 53 | + |
| 45 | + if (!fgets(buf, sizeof(buf), f)) { | 54 | + if (!fgets(buf, sizeof(buf), f)) { |
| 46 | + if (ferror(f)) | 55 | + if (ferror(f)) |
| 47 | + condlog(0, "read of /proc/cmdline failed : %s", | 56 | + condlog(0, "read of /proc/cmdline failed : %s", |
| 48 | + strerror(errno)); | 57 | + strerror(errno)); |
| 49 | + else | 58 | + else |
| 50 | + condlog(0, "couldn't read /proc/cmdline"); | 59 | + condlog(0, "couldn't read /proc/cmdline"); |
| 51 | + fclose(f); | 60 | + fclose(f); |
| 52 | + return -1; | 61 | + return -1; |
| 53 | + } | 62 | + } |
| 54 | + fclose(f); | 63 | + fclose(f); |
| 55 | + next = buf; | 64 | + next = buf; |
| 56 | + while((ptr = strstr(next, "mpath.wwid="))) { | 65 | + while((ptr = strstr(next, "mpath.wwid="))) { |
| 57 | + ptr += 11; | 66 | + ptr += 11; |
| 58 | + next = strpbrk(ptr, " \t\n"); | 67 | + next = strpbrk(ptr, " \t\n"); |
| 59 | + if (next) { | 68 | + if (next) { |
| 60 | + *next = '\0'; | 69 | + *next = '\0'; |
| 61 | + next++; | 70 | + next++; |
| 62 | + } | 71 | + } |
| 63 | + if (strlen(ptr)) { | 72 | + if (strlen(ptr)) { |
| 64 | + if (remember_wwid(ptr) != 0) | 73 | + if (remember_wwid(ptr) != 0) |
| 65 | + ret = -1; | 74 | + ret = -1; |
| 66 | + } | 75 | + } |
| 67 | + else { | 76 | + else { |
| 68 | + condlog(0, "empty mpath.wwid kernel command line option"); | 77 | + condlog(0, "empty mpath.wwid kernel command line option"); |
| 69 | + ret = -1; | 78 | + ret = -1; |
| 70 | + } | 79 | + } |
| 71 | + if (!next) | 80 | + if (!next) |
| 72 | + break; | 81 | + break; |
| 73 | + } | 82 | + } |
| 74 | + return ret; | 83 | + return ret; |
| 75 | +} | 84 | +} |
| 76 | diff --git a/libmultipath/wwids.h b/libmultipath/wwids.h | 85 | diff --git a/libmultipath/wwids.h b/libmultipath/wwids.h |
| 77 | index 0c6ee54..e32a0b0 100644 | 86 | index 0c6ee54..e32a0b0 100644 |
| @@ -86,10 +95,10 @@ index 0c6ee54..e32a0b0 100644 | |||
| 86 | enum { | 95 | enum { |
| 87 | WWID_IS_NOT_FAILED = 0, | 96 | WWID_IS_NOT_FAILED = 0, |
| 88 | diff --git a/multipath/main.c b/multipath/main.c | 97 | diff --git a/multipath/main.c b/multipath/main.c |
| 89 | index 6fdde03..7bac232 100644 | 98 | index ffa5b22..bcf8885 100644 |
| 90 | --- a/multipath/main.c | 99 | --- a/multipath/main.c |
| 91 | +++ b/multipath/main.c | 100 | +++ b/multipath/main.c |
| 92 | @@ -109,7 +109,7 @@ usage (char * progname) | 101 | @@ -120,7 +120,7 @@ usage (char * progname) |
| 93 | { | 102 | { |
| 94 | fprintf (stderr, VERSION_STRING); | 103 | fprintf (stderr, VERSION_STRING); |
| 95 | fprintf (stderr, "Usage:\n"); | 104 | fprintf (stderr, "Usage:\n"); |
| @@ -97,8 +106,8 @@ index 6fdde03..7bac232 100644 | |||
| 97 | + fprintf (stderr, " %s [-a|-A|-c|-w|-W] [-d] [-r] [-i] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); | 106 | + fprintf (stderr, " %s [-a|-A|-c|-w|-W] [-d] [-r] [-i] [-v lvl] [-p pol] [-b fil] [-q] [dev]\n", progname); |
| 98 | fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [-R num] [dev]\n", progname); | 107 | fprintf (stderr, " %s -l|-ll|-f [-v lvl] [-b fil] [-R num] [dev]\n", progname); |
| 99 | fprintf (stderr, " %s -F [-v lvl] [-R num]\n", progname); | 108 | fprintf (stderr, " %s -F [-v lvl] [-R num]\n", progname); |
| 100 | fprintf (stderr, " %s -t\n", progname); | 109 | fprintf (stderr, " %s [-t|-T]\n", progname); |
| 101 | @@ -123,6 +123,8 @@ usage (char * progname) | 110 | @@ -134,6 +134,8 @@ usage (char * progname) |
| 102 | " -f flush a multipath device map\n" | 111 | " -f flush a multipath device map\n" |
| 103 | " -F flush all multipath device maps\n" | 112 | " -F flush all multipath device maps\n" |
| 104 | " -a add a device wwid to the wwids file\n" | 113 | " -a add a device wwid to the wwids file\n" |
| @@ -107,40 +116,31 @@ index 6fdde03..7bac232 100644 | |||
| 107 | " -c check if a device should be a path in a multipath device\n" | 116 | " -c check if a device should be a path in a multipath device\n" |
| 108 | " -C check if a multipath device has usable paths\n" | 117 | " -C check if a multipath device has usable paths\n" |
| 109 | " -q allow queue_if_no_path when multipathd is not running\n" | 118 | " -q allow queue_if_no_path when multipathd is not running\n" |
| 110 | @@ -907,7 +909,7 @@ main (int argc, char *argv[]) | 119 | @@ -868,7 +870,7 @@ main (int argc, char *argv[]) |
| 111 | exit(1); | 120 | exit(1); |
| 112 | multipath_conf = conf; | 121 | multipath_conf = conf; |
| 113 | conf->retrigger_tries = 0; | 122 | conf->retrigger_tries = 0; |
| 114 | - while ((arg = getopt(argc, argv, ":adcChl::FfM:v:p:b:BrR:itquUwW")) != EOF ) { | 123 | - while ((arg = getopt(argc, argv, ":adcChl::FfM:v:p:b:BrR:itTquUwW")) != EOF ) { |
| 115 | + while ((arg = getopt(argc, argv, ":aAdcChl::FfM:v:p:b:BrR:itquUwW")) != EOF ) { | 124 | + while ((arg = getopt(argc, argv, ":aAdcChl::FfM:v:p:b:BrR:itquUwW")) != EOF ) { |
| 116 | switch(arg) { | 125 | switch(arg) { |
| 117 | case 1: printf("optarg : %s\n",optarg); | 126 | case 1: printf("optarg : %s\n",optarg); |
| 118 | break; | 127 | break; |
| 119 | @@ -974,6 +976,10 @@ main (int argc, char *argv[]) | 128 | @@ -935,6 +937,10 @@ main (int argc, char *argv[]) |
| 120 | case 't': | 129 | case 't': |
| 121 | r = dump_config(conf); | 130 | r = dump_config(conf, NULL, NULL); |
| 122 | goto out_free_config; | 131 | goto out_free_config; |
| 123 | + case 'A': | 132 | + case 'A': |
| 124 | + if (remember_cmdline_wwid() != 0) | 133 | + if (remember_cmdline_wwid() != 0) |
| 125 | + exit(1); | 134 | + exit(1); |
| 126 | + exit(0); | 135 | + exit(0); |
| 127 | case 'h': | 136 | case 'T': |
| 128 | usage(argv[0]); | 137 | cmd = CMD_DUMP_CONFIG; |
| 129 | exit(0); | 138 | break; |
| 130 | diff --git a/multipath/multipath.8 b/multipath/multipath.8 | 139 | diff --git a/multipath/multipath.8 b/multipath/multipath.8 |
| 131 | index 914a8cb..8c6a4c1 100644 | 140 | index 9cdd05a..1e120f3 100644 |
| 132 | --- a/multipath/multipath.8 | 141 | --- a/multipath/multipath.8 |
| 133 | +++ b/multipath/multipath.8 | 142 | +++ b/multipath/multipath.8 |
| 134 | @@ -25,7 +25,7 @@ multipath \- Device mapper target autoconfig. | 143 | @@ -167,6 +167,9 @@ itself doesn't attempt to do I/O on the device. |
| 135 | .RB [\| \-b\ \c | ||
| 136 | .IR bindings_file \|] | ||
| 137 | .RB [\| \-d \|] | ||
| 138 | -.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-C | \-q | \-r | \-i | \-a | \-u | \-U | \-w | \-W \|] | ||
| 139 | +.RB [\| \-h | \-l | \-ll | \-f | \-t | \-F | \-B | \-c | \-C | \-q | \-r | \-i | \-a | \-A | \-u | \-U | \-w | \-W \|] | ||
| 140 | .RB [\| \-p\ \c | ||
| 141 | .IR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|] | ||
| 142 | .RB [\| \-R\ \c | ||
| 143 | @@ -135,6 +135,9 @@ Add the WWID for the specified device to the WWIDs file. | ||
| 144 | Check if the device specified in the program environment should be | 144 | Check if the device specified in the program environment should be |
| 145 | a path in a multipath device. | 145 | a path in a multipath device. |
| 146 | . | 146 | . |
diff --git a/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch b/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch index a23e167393..57d04d02bb 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0027-RH-warn-on-invalid-regex-instead-of-failing.patch | |||
| @@ -1,7 +1,10 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | 1 | From d16de70b76919269561b4e404825f78286ea9a40 Mon Sep 17 00:00:00 2001 |
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Mon, 6 Nov 2017 21:39:28 -0600 | 3 | Date: Mon, 26 Nov 2018 10:31:30 +0800 |
| 4 | Subject: [PATCH] RH: warn on invalid regex instead of failing | 4 | Subject: [PATCH] From 0000000000000000000000000000000000000000 Mon Sep 17 |
| 5 | 00:00:00 2001 From: Benjamin Marzinski <bmarzins@redhat.com> Date: Mon, 6 Nov | ||
| 6 | 2017 21:39:28 -0600 Subject: [PATCH] RH: warn on invalid regex instead of | ||
| 7 | failing | ||
| 5 | 8 | ||
| 6 | multipath.conf used to allow "*" as a match everything regular expression, | 9 | multipath.conf used to allow "*" as a match everything regular expression, |
| 7 | instead of requiring ".*". Instead of erroring when the old style | 10 | instead of requiring ".*". Instead of erroring when the old style |
| @@ -9,48 +12,56 @@ regular expressions are used, it should print a warning and convert | |||
| 9 | them. | 12 | them. |
| 10 | 13 | ||
| 11 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | 14 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> |
| 15 | |||
| 16 | Upstream-Status: Pending | ||
| 17 | |||
| 18 | update this patch to new version | ||
| 19 | |||
| 20 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 12 | --- | 21 | --- |
| 13 | libmultipath/dict.c | 27 +++++++++++++++++++++------ | 22 | libmultipath/dict.c | 29 ++++++++++++++++++++++------- |
| 14 | libmultipath/parser.c | 13 +++++++++++++ | 23 | libmultipath/parser.c | 13 +++++++++++++ |
| 15 | libmultipath/parser.h | 1 + | 24 | libmultipath/parser.h | 2 +- |
| 16 | 3 files changed, 35 insertions(+), 6 deletions(-) | 25 | 3 files changed, 36 insertions(+), 8 deletions(-) |
| 17 | 26 | ||
| 18 | diff --git a/libmultipath/dict.c b/libmultipath/dict.c | 27 | diff --git a/libmultipath/dict.c b/libmultipath/dict.c |
| 19 | index 7ad0f5a..ab808d6 100644 | 28 | index a81c051..0689763 100644 |
| 20 | --- a/libmultipath/dict.c | 29 | --- a/libmultipath/dict.c |
| 21 | +++ b/libmultipath/dict.c | 30 | +++ b/libmultipath/dict.c |
| 22 | @@ -55,6 +55,21 @@ set_str(vector strvec, void *ptr) | 31 | @@ -59,6 +59,21 @@ set_str(vector strvec, void *ptr) |
| 23 | } | 32 | } |
| 24 | 33 | ||
| 25 | static int | 34 | static int |
| 26 | +set_regex(vector strvec, void *ptr) | 35 | +set_regex(vector strvec, void *ptr) |
| 27 | +{ | 36 | +{ |
| 28 | + char **str_ptr = (char **)ptr; | 37 | + char **str_ptr = (char **)ptr; |
| 29 | + | 38 | + |
| 30 | + if (*str_ptr) | 39 | + if (*str_ptr) |
| 31 | + FREE(*str_ptr); | 40 | + FREE(*str_ptr); |
| 32 | + *str_ptr = set_regex_value(strvec); | 41 | + *str_ptr = set_regex_value(strvec); |
| 33 | + | 42 | + |
| 34 | + if (!*str_ptr) | 43 | + if (!*str_ptr) |
| 35 | + return 1; | 44 | + return 1; |
| 36 | + | 45 | + |
| 37 | + return 0; | 46 | + return 0; |
| 38 | +} | 47 | +} |
| 39 | + | 48 | + |
| 40 | +static int | 49 | +static int |
| 41 | set_yes_no(vector strvec, void *ptr) | 50 | set_yes_no(vector strvec, void *ptr) |
| 42 | { | 51 | { |
| 43 | char * buff; | 52 | char * buff; |
| 44 | @@ -1271,7 +1286,7 @@ ble_ ## option ## _handler (struct config *conf, vector strvec) \ | 53 | @@ -1346,8 +1361,8 @@ ble_ ## option ## _handler (struct config *conf, vector strvec) \ |
| 54 | \ | ||
| 45 | if (!conf->option) \ | 55 | if (!conf->option) \ |
| 46 | return 1; \ | 56 | return 1; \ |
| 47 | \ | 57 | - \ |
| 48 | - buff = set_value(strvec); \ | 58 | - buff = set_value(strvec); \ |
| 59 | + \ | ||
| 49 | + buff = set_regex_value(strvec); \ | 60 | + buff = set_regex_value(strvec); \ |
| 50 | if (!buff) \ | 61 | if (!buff) \ |
| 51 | return 1; \ | 62 | return 1; \ |
| 52 | \ | 63 | \ |
| 53 | @@ -1287,7 +1302,7 @@ ble_ ## option ## _ ## name ## _handler (struct config *conf, vector strvec) \ | 64 | @@ -1363,7 +1378,7 @@ ble_ ## option ## _ ## name ## _handler (struct config *conf, vector strvec) \ |
| 54 | if (!conf->option) \ | 65 | if (!conf->option) \ |
| 55 | return 1; \ | 66 | return 1; \ |
| 56 | \ | 67 | \ |
| @@ -59,7 +70,7 @@ index 7ad0f5a..ab808d6 100644 | |||
| 59 | if (!buff) \ | 70 | if (!buff) \ |
| 60 | return 1; \ | 71 | return 1; \ |
| 61 | \ | 72 | \ |
| 62 | @@ -1388,16 +1403,16 @@ device_handler(struct config *conf, vector strvec) | 73 | @@ -1466,16 +1481,16 @@ device_handler(struct config *conf, vector strvec) |
| 63 | return 0; | 74 | return 0; |
| 64 | } | 75 | } |
| 65 | 76 | ||
| @@ -81,37 +92,38 @@ index 7ad0f5a..ab808d6 100644 | |||
| 81 | 92 | ||
| 82 | declare_hw_handler(hwhandler, set_str) | 93 | declare_hw_handler(hwhandler, set_str) |
| 83 | diff --git a/libmultipath/parser.c b/libmultipath/parser.c | 94 | diff --git a/libmultipath/parser.c b/libmultipath/parser.c |
| 84 | index b8b7e0d..34b4ad2 100644 | 95 | index 92ef7cf..0e2cf49 100644 |
| 85 | --- a/libmultipath/parser.c | 96 | --- a/libmultipath/parser.c |
| 86 | +++ b/libmultipath/parser.c | 97 | +++ b/libmultipath/parser.c |
| 87 | @@ -380,6 +380,19 @@ set_value(vector strvec) | 98 | @@ -384,6 +384,19 @@ set_value(vector strvec) |
| 88 | return alloc; | 99 | return alloc; |
| 89 | } | 100 | } |
| 90 | 101 | ||
| 91 | +void * | 102 | +void * |
| 92 | +set_regex_value(vector strvec) | 103 | +set_regex_value(vector strvec) |
| 93 | +{ | 104 | +{ |
| 94 | + char *buff = set_value(strvec); | 105 | + char *buff = set_value(strvec); |
| 95 | + | 106 | + |
| 96 | + if (buff && strcmp("*", buff) == 0) { | 107 | + if (buff && strcmp("*", buff) == 0) { |
| 97 | + condlog(0, "Invalid regular expression \"*\" in multipath.conf. Using \".*\""); | 108 | + condlog(0, "Invalid regular expression \"*\" in multipath.conf. Using \".*\""); |
| 98 | + FREE(buff); | 109 | + FREE(buff); |
| 99 | + return strdup(".*"); | 110 | + return strdup(".*"); |
| 100 | + } | 111 | + } |
| 101 | + return buff; | 112 | + return buff; |
| 102 | +} | 113 | +} |
| 103 | + | 114 | + |
| 104 | /* non-recursive configuration stream handler */ | 115 | /* non-recursive configuration stream handler */ |
| 105 | static int kw_level = 0; | 116 | static int kw_level = 0; |
| 106 | 117 | ||
| 107 | diff --git a/libmultipath/parser.h b/libmultipath/parser.h | 118 | diff --git a/libmultipath/parser.h b/libmultipath/parser.h |
| 108 | index 62906e9..b791705 100644 | 119 | index 62906e9..b6899fc 100644 |
| 109 | --- a/libmultipath/parser.h | 120 | --- a/libmultipath/parser.h |
| 110 | +++ b/libmultipath/parser.h | 121 | +++ b/libmultipath/parser.h |
| 111 | @@ -77,6 +77,7 @@ extern void dump_keywords(vector keydump, int level); | 122 | @@ -76,7 +76,7 @@ extern int _install_keyword(vector keywords, char *string, |
| 123 | extern void dump_keywords(vector keydump, int level); | ||
| 112 | extern void free_keywords(vector keywords); | 124 | extern void free_keywords(vector keywords); |
| 113 | extern vector alloc_strvec(char *string); | 125 | extern vector alloc_strvec(char *string); |
| 114 | extern void *set_value(vector strvec); | 126 | -extern void *set_value(vector strvec); |
| 115 | +extern void *set_regex_value(vector strvec); | 127 | +extern void *set_regex_value(vector strvec); |
| 116 | extern int process_file(struct config *conf, char *conf_file); | 128 | extern int process_file(struct config *conf, char *conf_file); |
| 117 | extern struct keyword * find_keyword(vector keywords, vector v, char * name); | 129 | extern struct keyword * find_keyword(vector keywords, vector v, char * name); |
diff --git a/meta-oe/recipes-support/multipath-tools/files/0028-RH-reset-default-find_mutipaths-value-to-off.patch b/meta-oe/recipes-support/multipath-tools/files/0028-RH-reset-default-find_mutipaths-value-to-off.patch index 05e686492e..ad03b8acc4 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0028-RH-reset-default-find_mutipaths-value-to-off.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0028-RH-reset-default-find_mutipaths-value-to-off.patch | |||
| @@ -1,18 +1,27 @@ | |||
| 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | 1 | From 16900150e02e5b367a8b33621b393975ad011130 Mon Sep 17 00:00:00 2001 |
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> | 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Thu, 7 Jun 2018 17:43:52 -0500 | 3 | Date: Mon, 26 Nov 2018 11:12:01 +0800 |
| 4 | Subject: [PATCH] RH: reset default find_mutipaths value to off | 4 | Subject: [PATCH] From 0000000000000000000000000000000000000000 Mon Sep 17 |
| 5 | 00:00:00 2001 From: Benjamin Marzinski <bmarzins@redhat.com> Date: Thu, 7 Jun | ||
| 6 | 2018 17:43:52 -0500 Subject: [PATCH] RH: reset default find_mutipaths value | ||
| 7 | to off | ||
| 5 | 8 | ||
| 6 | Upstream has changed to default find_multipaths to "strict". For now | 9 | Upstream has changed to default find_multipaths to "strict". For now |
| 7 | Redhat will retain the previous default of "off". | 10 | Redhat will retain the previous default of "off". |
| 8 | 11 | ||
| 9 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> | 12 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> |
| 13 | |||
| 14 | Upstream-Status: Pending | ||
| 15 | |||
| 16 | Update this patch to new version | ||
| 17 | |||
| 18 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 10 | --- | 19 | --- |
| 11 | libmultipath/defaults.h | 2 +- | 20 | libmultipath/defaults.h | 2 +- |
| 12 | 1 file changed, 1 insertion(+), 1 deletion(-) | 21 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 13 | 22 | ||
| 14 | diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h | 23 | diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h |
| 15 | index f076b4b..70ba98a 100644 | 24 | index 6576939..a2404b2 100644 |
| 16 | --- a/libmultipath/defaults.h | 25 | --- a/libmultipath/defaults.h |
| 17 | +++ b/libmultipath/defaults.h | 26 | +++ b/libmultipath/defaults.h |
| 18 | @@ -17,7 +17,7 @@ | 27 | @@ -17,7 +17,7 @@ |
| @@ -20,7 +29,7 @@ index f076b4b..70ba98a 100644 | |||
| 20 | #define DEFAULT_VERBOSITY 2 | 29 | #define DEFAULT_VERBOSITY 2 |
| 21 | #define DEFAULT_REASSIGN_MAPS 0 | 30 | #define DEFAULT_REASSIGN_MAPS 0 |
| 22 | -#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_STRICT | 31 | -#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_STRICT |
| 23 | +#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_OFF | 32 | +#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_OFF |
| 24 | #define DEFAULT_FAST_IO_FAIL 5 | 33 | #define DEFAULT_FAST_IO_FAIL 5 |
| 25 | #define DEFAULT_DEV_LOSS_TMO 600 | 34 | #define DEFAULT_DEV_LOSS_TMO 600 |
| 26 | #define DEFAULT_RETAIN_HWHANDLER RETAIN_HWHANDLER_ON | 35 | #define DEFAULT_RETAIN_HWHANDLER RETAIN_HWHANDLER_ON |
diff --git a/meta-oe/recipes-support/multipath-tools/files/0029-multipath-tools-modify-Makefile.inc-for-cross-compil.patch b/meta-oe/recipes-support/multipath-tools/files/0029-multipath-tools-modify-Makefile.inc-for-cross-compil.patch index 45cd32ac2e..4fa7960b17 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0029-multipath-tools-modify-Makefile.inc-for-cross-compil.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0029-multipath-tools-modify-Makefile.inc-for-cross-compil.patch | |||
| @@ -1,7 +1,10 @@ | |||
| 1 | From 8bdd4481d822b6625d8bf719431ca74ed1b5e021 Mon Sep 17 00:00:00 2001 | 1 | From a805b601fcf4bb9e269566a8d25e48d9e60915c0 Mon Sep 17 00:00:00 2001 |
| 2 | From: Changqing Li <changqing.li@windriver.com> | 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Mon, 16 Jul 2018 15:56:37 +0800 | 3 | Date: Mon, 26 Nov 2018 11:14:24 +0800 |
| 4 | Subject: [PATCH] multipath-tools: modify Makefile.inc for cross-compilation | 4 | Subject: [PATCH] From 8bdd4481d822b6625d8bf719431ca74ed1b5e021 Mon Sep 17 |
| 5 | 00:00:00 2001 From: Changqing Li <changqing.li@windriver.com> Date: Mon, 16 | ||
| 6 | Jul 2018 15:56:37 +0800 Subject: [PATCH] multipath-tools: modify Makefile.inc | ||
| 7 | for cross-compilation | ||
| 5 | 8 | ||
| 6 | Do not look for systemd info on the host, and allow us to pass in CFLAGS | 9 | Do not look for systemd info on the host, and allow us to pass in CFLAGS |
| 7 | using the OPTFLAGS variable. | 10 | using the OPTFLAGS variable. |
| @@ -23,12 +26,15 @@ update for version 0.7.7 | |||
| 23 | remove change about CFLAGS part, since patch 0024 already have similar function. | 26 | remove change about CFLAGS part, since patch 0024 already have similar function. |
| 24 | 27 | ||
| 25 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | 28 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
| 29 | |||
| 30 | update for version 0.7.9 | ||
| 31 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 26 | --- | 32 | --- |
| 27 | Makefile.inc | 8 ++------ | 33 | Makefile.inc | 6 ------ |
| 28 | 1 file changed, 2 insertions(+), 6 deletions(-) | 34 | 1 file changed, 6 deletions(-) |
| 29 | 35 | ||
| 30 | diff --git a/Makefile.inc b/Makefile.inc | 36 | diff --git a/Makefile.inc b/Makefile.inc |
| 31 | index 57a1835..0c403c7 100644 | 37 | index 295afb9..7136db3 100644 |
| 32 | --- a/Makefile.inc | 38 | --- a/Makefile.inc |
| 33 | +++ b/Makefile.inc | 39 | +++ b/Makefile.inc |
| 34 | @@ -38,12 +38,6 @@ ifndef RUN | 40 | @@ -38,12 +38,6 @@ ifndef RUN |
diff --git a/meta-oe/recipes-support/multipath-tools/files/0030-Always-use-devmapper.patch b/meta-oe/recipes-support/multipath-tools/files/0030-Always-use-devmapper.patch index 12811804a3..3e88b41004 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0030-Always-use-devmapper.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0030-Always-use-devmapper.patch | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | From d929a1ea5e42ecbe30c990644ed4ada2817c6439 Mon Sep 17 00:00:00 2001 | 1 | From e4acb46b10484d1da6f093257e34f269832e6a37 Mon Sep 17 00:00:00 2001 |
| 2 | From: Changqing Li <changqing.li@windriver.com> | 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Mon, 16 Jul 2018 16:00:14 +0800 | 3 | Date: Mon, 26 Nov 2018 11:17:41 +0800 |
| 4 | Subject: [PATCH] Always use devmapper | 4 | Subject: [PATCH] Subject: [PATCH] Always use devmapper |
| 5 | 5 | ||
| 6 | Do not try to compute several _API_ make variables | 6 | Do not try to compute several _API_ make variables |
| 7 | from host information when cross-compiling. | 7 | from host information when cross-compiling. |
| @@ -18,12 +18,15 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | |||
| 18 | Rebase to 0.7.7 | 18 | Rebase to 0.7.7 |
| 19 | 19 | ||
| 20 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | 20 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
| 21 | |||
| 22 | Rebase to 0.7.9 | ||
| 23 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 21 | --- | 24 | --- |
| 22 | libmultipath/Makefile | 19 ++++--------------- | 25 | libmultipath/Makefile | 19 ++++--------------- |
| 23 | 1 file changed, 4 insertions(+), 15 deletions(-) | 26 | 1 file changed, 4 insertions(+), 15 deletions(-) |
| 24 | 27 | ||
| 25 | diff --git a/libmultipath/Makefile b/libmultipath/Makefile | 28 | diff --git a/libmultipath/Makefile b/libmultipath/Makefile |
| 26 | index f51786d..3ad9c48 100644 | 29 | index 33f5269..adf6f4a 100644 |
| 27 | --- a/libmultipath/Makefile | 30 | --- a/libmultipath/Makefile |
| 28 | +++ b/libmultipath/Makefile | 31 | +++ b/libmultipath/Makefile |
| 29 | @@ -20,21 +20,10 @@ ifdef SYSTEMD | 32 | @@ -20,21 +20,10 @@ ifdef SYSTEMD |
diff --git a/meta-oe/recipes-support/multipath-tools/files/0031-Always-use-devmapper-for-kpartx.patch b/meta-oe/recipes-support/multipath-tools/files/0031-Always-use-devmapper-for-kpartx.patch index 88a758dcb7..418c0200f4 100644 --- a/meta-oe/recipes-support/multipath-tools/files/0031-Always-use-devmapper-for-kpartx.patch +++ b/meta-oe/recipes-support/multipath-tools/files/0031-Always-use-devmapper-for-kpartx.patch | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | From 145f2b829e5362cda975bebafd7fe4d00ff56d1c Mon Sep 17 00:00:00 2001 | 1 | From 1fe937835311a2d0afbc85ce4a4dbd3c9e0c912f Mon Sep 17 00:00:00 2001 |
| 2 | From: Changqing Li <changqing.li@windriver.com> | 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Mon, 16 Jul 2018 16:02:07 +0800 | 3 | Date: Mon, 26 Nov 2018 11:19:45 +0800 |
| 4 | Subject: [PATCH] Always use devmapper for kpartx | 4 | Subject: [PATCH] Subject: [PATCH] Always use devmapper for kpartx |
| 5 | 5 | ||
| 6 | Do not try to compute the LIBDM_API_COOKIE make variable | 6 | Do not try to compute the LIBDM_API_COOKIE make variable |
| 7 | from host information when cross-compiling. | 7 | from host information when cross-compiling. |
| @@ -16,6 +16,9 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | |||
| 16 | 16 | ||
| 17 | Rebase to 0.7.7 | 17 | Rebase to 0.7.7 |
| 18 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | 18 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
| 19 | |||
| 20 | Rebase to 0.7.9 | ||
| 21 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 19 | --- | 22 | --- |
| 20 | kpartx/Makefile | 4 +--- | 23 | kpartx/Makefile | 4 +--- |
| 21 | 1 file changed, 1 insertion(+), 3 deletions(-) | 24 | 1 file changed, 1 insertion(+), 3 deletions(-) |
diff --git a/meta-oe/recipes-support/multipath-tools/multipath-tools_0.7.7.bb b/meta-oe/recipes-support/multipath-tools/multipath-tools_0.7.9.bb index 5cc1546045..9cf104efa9 100644 --- a/meta-oe/recipes-support/multipath-tools/multipath-tools_0.7.7.bb +++ b/meta-oe/recipes-support/multipath-tools/multipath-tools_0.7.9.bb | |||
| @@ -31,26 +31,6 @@ LICENSE = "GPLv2" | |||
| 31 | SRC_URI = "git://git.opensvc.com/multipath-tools/.git;protocol=http \ | 31 | SRC_URI = "git://git.opensvc.com/multipath-tools/.git;protocol=http \ |
| 32 | file://multipathd.oe \ | 32 | file://multipathd.oe \ |
| 33 | file://multipath.conf.example \ | 33 | file://multipath.conf.example \ |
| 34 | file://0001-multipath-tools-add-RDAC-SUN-ArrayStorage-to-hwtable.patch \ | ||
| 35 | file://0002-multipath-tools-remove-c-from-__cpluscplus-misspelle.patch \ | ||
| 36 | file://0003-multipath-tools-remove-emacs-autoconfig-of-kpartx-gp.patch \ | ||
| 37 | file://0004-multipath-tools-replace-FSF-address-with-a-www-point.patch \ | ||
| 38 | file://0005-multipath-tools-Remove-trailing-leading-whitespaces-.patch \ | ||
| 39 | file://0006-multipath-tools-fix-compilation-with-musl-libc.patch \ | ||
| 40 | file://0007-multipath-tools-add-x-to-doc-preclean.pl-and-split-m.patch \ | ||
| 41 | file://0008-multipath-tools-refresh-kernel-doc-from-kernel-sourc.patch \ | ||
| 42 | file://0009-multipath-tools-configure-hitachi-ams2000-and-hus100.patch \ | ||
| 43 | file://0010-libmultipath-don-t-reject-maps-with-undefined-prio.patch \ | ||
| 44 | file://0011-multipathd-handle-errors-in-uxlsnr-as-fatal.patch \ | ||
| 45 | file://0012-libmultipath-fix-error-parsing-find_multipaths-stric.patch \ | ||
| 46 | file://0013-libmultipath-print-correct-default-for-delay_-_check.patch \ | ||
| 47 | file://0014-multipath.conf.5-clarify-property-whitelist-handling.patch \ | ||
| 48 | file://0015-mpathpersist-add-all_tg_pt-option.patch \ | ||
| 49 | file://0016-libmultipath-remove-rbd-code.patch \ | ||
| 50 | file://0017-mpathpersist-fix-aptpl-support.patch \ | ||
| 51 | file://0018-multipath-don-t-check-timestamps-without-a-path.patch \ | ||
| 52 | file://0019-libmultipath-fix-detect-alua-corner-case.patch \ | ||
| 53 | file://0020-multipath-fix-setting-conf-version.patch \ | ||
| 54 | file://0021-RH-fixup-udev-rules-for-redhat.patch \ | 34 | file://0021-RH-fixup-udev-rules-for-redhat.patch \ |
| 55 | file://0022-RH-Remove-the-property-blacklist-exception-builtin.patch \ | 35 | file://0022-RH-Remove-the-property-blacklist-exception-builtin.patch \ |
| 56 | file://0023-RH-don-t-start-without-a-config-file.patch \ | 36 | file://0023-RH-don-t-start-without-a-config-file.patch \ |
| @@ -66,7 +46,7 @@ SRC_URI = "git://git.opensvc.com/multipath-tools/.git;protocol=http \ | |||
| 66 | 46 | ||
| 67 | LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2" | 47 | LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2" |
| 68 | 48 | ||
| 69 | SRCREV = "386d288b5595fc2c01dffe698b6eb306c6674908" | 49 | SRCREV = "5c67a8b5944dd13542e6b44fa2ae9803e0cc4282" |
| 70 | 50 | ||
| 71 | S = "${WORKDIR}/git" | 51 | S = "${WORKDIR}/git" |
| 72 | 52 | ||
