From 733bdfd7143f7482ced5b7b5b4269fd0e035c274 Mon Sep 17 00:00:00 2001 From: Kaleb S. KEITHLEY Date: Aug 11 2021 18:31:17 +0000 Subject: fix requested by gfidente and gouthamr needed for openstack testing https://github.com/ceph/ceph/commit/80b635be63902048622e6a6093cac5ae8a324643 --- diff --git a/SOURCES/0001-pybind-ceph_volume_client-use-cephfs-mkdirs-api.patch b/SOURCES/0001-pybind-ceph_volume_client-use-cephfs-mkdirs-api.patch new file mode 100644 index 0000000..07dd932 --- /dev/null +++ b/SOURCES/0001-pybind-ceph_volume_client-use-cephfs-mkdirs-api.patch @@ -0,0 +1,87 @@ +From 80b635be63902048622e6a6093cac5ae8a324643 Mon Sep 17 00:00:00 2001 +From: Patrick Donnelly +Date: Fri, 2 Jul 2021 09:07:34 -0700 +Subject: [PATCH] pybind/ceph_volume_client: use cephfs mkdirs api + +This _mkdir_p should never have worked as the first directory it tries +to stat/mkdir is "", the empty string. This causes an assertion in the +client. I'm not sure how this code ever functioned without causing +faults. They look like: + + 2021-07-01 02:15:04.449 7f7612b5ab80 3 client.178735 statx enter (relpath want 2047) + +The assertion is caused by a C++ exception: + + /usr/include/c++/8/string_view:172: constexpr const _CharT& std::basic_string_view<_CharT, _Traits>::operator[](std::basic_string_view<_CharT, _Traits>::size_type) const [with _CharT = char$_Traits = std::char_traits; std::basic_string_view<_CharT, _Traits>::size_type = long unsigned int]: Assertion '__pos < this->_M_len' failed. + Aborted (core dumped) + +Where relpath is just the path passed to Client::stat. + +This commit only applies to Pacific and older because master no longer +has this library. + +Fixes: https://tracker.ceph.com/issues/51492 +Signed-off-by: Patrick Donnelly +(cherry picked from commit 0fb05aea8a6e12c37a9b54641715a9a94ae1366f) +--- + src/pybind/ceph_volume_client.py | 23 +++-------------------- + 1 file changed, 3 insertions(+), 20 deletions(-) + +diff --git a/src/pybind/ceph_volume_client.py b/src/pybind/ceph_volume_client.py +index b37d48ca260..1e5e192d80d 100644 +--- a/src/pybind/ceph_volume_client.py ++++ b/src/pybind/ceph_volume_client.py +@@ -629,7 +629,7 @@ class CephFSVolumeClient(object): + raise ValueError("group ID cannot end with '{0}'.".format( + META_FILE_EXT)) + path = self._get_group_path(group_id) +- self._mkdir_p(path, mode) ++ self.fs.mkdirs(path, mode) + + def destroy_group(self, group_id): + path = self._get_group_path(group_id) +@@ -640,23 +640,6 @@ class CephFSVolumeClient(object): + else: + self.fs.rmdir(path) + +- def _mkdir_p(self, path, mode=0o755): +- try: +- self.fs.stat(path) +- except cephfs.ObjectNotFound: +- pass +- else: +- return +- +- parts = path.split(os.path.sep) +- +- for i in range(1, len(parts) + 1): +- subpath = os.path.join(*parts[0:i]) +- try: +- self.fs.stat(subpath) +- except cephfs.ObjectNotFound: +- self.fs.mkdir(subpath, mode) +- + def create_volume(self, volume_path, size=None, data_isolated=False, namespace_isolated=True, + mode=0o755): + """ +@@ -674,7 +657,7 @@ class CephFSVolumeClient(object): + path = self._get_path(volume_path) + log.info("create_volume: {0}".format(path)) + +- self._mkdir_p(path, mode) ++ self.fs.mkdirs(path, mode) + + if size is not None: + self.fs.setxattr(path, 'ceph.quota.max_bytes', to_bytes(size), 0) +@@ -732,7 +715,7 @@ class CephFSVolumeClient(object): + + # Create the trash folder if it doesn't already exist + trash = os.path.join(self.volume_prefix, "_deleting") +- self._mkdir_p(trash) ++ self.fs.mkdirs(trash, 0o755) + + # We'll move it to here + trashed_volume = os.path.join(trash, volume_path.volume_id) +-- +2.31.1 + diff --git a/SOURCES/0001-src-common-crc32c_intel_fast.patch b/SOURCES/0001-src-common-crc32c_intel_fast.patch deleted file mode 100644 index 503dcd7..0000000 --- a/SOURCES/0001-src-common-crc32c_intel_fast.patch +++ /dev/null @@ -1,112 +0,0 @@ ---- ceph-15.1.0/src/common/crc32c_intel_fast_asm.s.orig 2020-03-04 14:37:33.431024436 -0500 -+++ ceph-15.1.0/src/common/crc32c_intel_fast_asm.s 2020-03-04 15:11:22.859388783 -0500 -@@ -40,6 +40,7 @@ - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -+ - ; crcB3 MACRO to implement crc32 on 3 %%bSize-byte blocks - %macro crcB3 3 - %define %%bSize %1 ; 1/3 of buffer size -@@ -672,3 +673,22 @@ - ; inform linker that this doesn't require executable stack - section .note.GNU-stack noalloc noexec nowrite progbits - %endif -+ -+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -+ -+SECTION .note.gnu.property align=8 noexec ; section number 22, const -+ -+ db 04H, 00H, 00H, 00H, 20H, 00H, 00H, 00H ; 0000 _ .... ... -+ db 05H, 00H, 00H, 00H, 47H, 4EH, 55H, 00H ; 0008 _ ....GNU. -+ db 00H, 00H, 00H, 0C0H, 04H, 00H, 00H, 00H ; 0010 _ ........ -+ db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0018 _ ........ -+ db 01H, 00H, 00H, 0C0H, 04H, 00H, 00H, 00H ; 0020 _ ........ -+ db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0028 _ ........ -+ db 04H, 00H, 00H, 00H, 10H, 00H, 00H, 00H ; 0030 _ ........ -+ db 05H, 00H, 00H, 00H, 47H, 4EH, 55H, 00H ; 0038 _ ....GNU. -+ db 02H, 00H, 00H, 0C0H, 04H, 00H, 00H, 00H ; 0040 _ ........ -+ db 03H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0048 _ ........ -+ -+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ---- ceph-15.1.0/src/common/crc32c_intel_fast_zero_asm.s.orig 2020-03-04 15:13:06.577071783 -0500 -+++ ceph-15.1.0/src/common/crc32c_intel_fast_zero_asm.s 2020-03-04 15:13:49.873356953 -0500 -@@ -654,3 +654,22 @@ - ; inform linker that this doesn't require executable stack - section .note.GNU-stack noalloc noexec nowrite progbits - %endif -+ -+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -+ -+SECTION .note.gnu.property align=8 noexec ; section number 22, const -+ -+ db 04H, 00H, 00H, 00H, 20H, 00H, 00H, 00H ; 0000 _ .... ... -+ db 05H, 00H, 00H, 00H, 47H, 4EH, 55H, 00H ; 0008 _ ....GNU. -+ db 00H, 00H, 00H, 0C0H, 04H, 00H, 00H, 00H ; 0010 _ ........ -+ db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0018 _ ........ -+ db 01H, 00H, 00H, 0C0H, 04H, 00H, 00H, 00H ; 0020 _ ........ -+ db 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0028 _ ........ -+ db 04H, 00H, 00H, 00H, 10H, 00H, 00H, 00H ; 0030 _ ........ -+ db 05H, 00H, 00H, 00H, 47H, 4EH, 55H, 00H ; 0038 _ ....GNU. -+ db 02H, 00H, 00H, 0C0H, 04H, 00H, 00H, 00H ; 0040 _ ........ -+ db 03H, 00H, 00H, 00H, 00H, 00H, 00H, 00H ; 0048 _ ........ -+ -+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ---- ceph-15.1.0/src/yasm-wrapper.orig 2020-03-09 12:57:37.603837466 -0400 -+++ ceph-15.1.0/src/yasm-wrapper 2020-03-09 13:02:31.496796609 -0400 -@@ -1,10 +1,11 @@ --#!/bin/sh -e -+#!/bin/sh - - # libtool and yasm do not get along. - # filter out any crap that libtool feeds us that yasm does not understand. - #echo $0: got $* - new="" - touch="" -+object="" - while [ -n "$*" ]; do - case "$1" in - -f ) -@@ -29,6 +30,12 @@ - touch="$1" - shift - ;; -+ -o ) -+ shift -+ object="$1" -+ new="$new -o $1" -+ shift -+ ;; - * ) - new="$new $1" - shift -@@ -39,6 +46,25 @@ - #echo $0: yasm $new - yasm $new - -+INDEXOFNOTEGNUPROPLINE=$(readelf -S -W ${object} | grep ".note.gnu.property") -+ -+if [ -n "${INDEXOFNOTEGNUPROPLINE}" ]; then -+ -+ STARTOFSECTHDRLINE=$(readelf -h ${object} | grep "Start of section headers:") -+ SIZEOFSECTHDRLINE=$(readelf -h ${object} | grep "Size of section headers:") -+ -+ STARTOFSECTHDR=$(echo ${STARTOFSECTHDRLINE} | cut -d ' ' -f 5) -+ SIZEOFSECTHDR=$(echo ${SIZEOFSECTHDRLINE} | cut -d ' ' -f 5) -+ INDEXOFNOTEGNUPROPFRAG=$(echo ${INDEXOFNOTEGNUPROPLINE} | cut -d '.' -f 1) -+ -+ INDEXOFNOTEGNUPROP=$(echo ${INDEXOFNOTEGNUPROPFRAG} | grep -Eo "[[:digit:]]+") -+ -+ OFFSET=$(( ${STARTOFSECTHDR} + 4 + ( ${SIZEOFSECTHDR} * ${INDEXOFNOTEGNUPROP} ) )) -+ -+ printf '\x07' | dd of=${object} bs=1 seek=${OFFSET} count=1 conv=notrunc &> /dev/null -+ -+fi -+ - [ -n "$touch" ] && touch $touch - - true diff --git a/SOURCES/0002-src-common-CMakeLists.txt.patch b/SOURCES/0002-src-common-CMakeLists.txt.patch deleted file mode 100644 index e3252b3..0000000 --- a/SOURCES/0002-src-common-CMakeLists.txt.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt -index 65ba10b0f1..eeedc29c37 100644 ---- a/src/common/CMakeLists.txt -+++ b/src/common/CMakeLists.txt -@@ -165,7 +165,7 @@ elseif(HAVE_ARMV8_CRC) - crc32c_aarch64.c) - endif(HAVE_INTEL) - --add_library(crc32 ${crc32_srcs}) -+add_library(crc32 STATIC ${crc32_srcs}) - if(HAVE_ARMV8_CRC) - set_target_properties(crc32 PROPERTIES - COMPILE_FLAGS "${CMAKE_C_FLAGS} ${ARMV8_CRC_COMPILE_FLAGS}") diff --git a/SOURCES/0003-src-common-bitstr.h.patch b/SOURCES/0003-src-common-bitstr.h.patch deleted file mode 100644 index 3c7a516..0000000 --- a/SOURCES/0003-src-common-bitstr.h.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ceph-15.1.0/src/common/bit_str.h.orig 2020-02-03 09:47:20.047149798 -0500 -+++ ceph-15.1.0/src/common/bit_str.h 2020-02-03 09:47:50.213149798 -0500 -@@ -17,6 +17,7 @@ - #include - #include - #include -+#include - - namespace ceph { - class Formatter; diff --git a/SPECS/ceph.spec b/SPECS/ceph.spec index d0c9d21..8144012 100644 --- a/SPECS/ceph.spec +++ b/SPECS/ceph.spec @@ -111,7 +111,7 @@ ################################################################################# Name: ceph Version: 14.2.22 -Release: 1%{?dist} +Release: 2%{?dist} %if 0%{?fedora} || 0%{?rhel} Epoch: 2 %endif @@ -127,6 +127,7 @@ Group: System/Filesystems %endif URL: http://ceph.com/ Source0: %{?_remote_tarball_prefix}ceph-%{version}.tar.gz +Patch0001: 0001-pybind-ceph_volume_client-use-cephfs-mkdirs-api.patch %if 0%{?suse_version} # _insert_obs_source_lines_here ExclusiveArch: x86_64 aarch64 ppc64le s390x @@ -2341,6 +2342,9 @@ exit 0 %changelog +* Wed Aug 11 2021 Kaleb S. KEITHLEY - 2:14.2.22-2 +- ceph 14.2.22 cephfs-mkdirs-api patch, for openstack testing + * Thu Jul 1 2021 Kaleb S. KEITHLEY - 2:14.2.22-1 - ceph 14.2.22 GA