diff --git a/0009-rgw-rgw_file-Fix-the-return-value-of-read-and-readli.patch b/0009-rgw-rgw_file-Fix-the-return-value-of-read-and-readli.patch new file mode 100644 index 0000000000000000000000000000000000000000..461b95a0a02326ce4b5ac81cdcb4525c86fad984 --- /dev/null +++ b/0009-rgw-rgw_file-Fix-the-return-value-of-read-and-readli.patch @@ -0,0 +1,38 @@ +From bfd83e8fa142873a0bdf09a4d1ad1b04127f5885 Mon Sep 17 00:00:00 2001 +From: luo rixin +Date: Tue, 29 Dec 2020 14:39:21 +0800 +Subject: [PATCH] rgw/rgw_file: Fix the return value of read() and readlink() + +Fixes: https://tracker.ceph.com/issues/49189 + +Signed-off-by: Dai zhiwei +Signed-off-by: luo rixin +--- + src/rgw/rgw_file.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc +index 50e0b60396..d3047a326c 100644 +--- a/src/rgw/rgw_file.cc ++++ b/src/rgw/rgw_file.cc +@@ -324,7 +324,7 @@ namespace rgw { + + int rc = rgwlib.get_fe()->execute_req(&req); + if ((rc == 0) && +- (req.get_ret() == 0)) { ++ ((rc = req.get_ret()) == 0)) { + lock_guard guard(rgw_fh->mtx); + rgw_fh->set_atime(real_clock::to_timespec(real_clock::now())); + *bytes_read = req.nread; +@@ -347,7 +347,7 @@ namespace rgw { + + int rc = rgwlib.get_fe()->execute_req(&req); + if ((rc == 0) && +- (req.get_ret() == 0)) { ++ ((rc = req.get_ret()) == 0)) { + lock_guard(rgw_fh->mtx); + rgw_fh->set_atime(real_clock::to_timespec(real_clock::now())); + *bytes_read = req.nread; +-- +2.32.0.windows.1 + diff --git a/0010-common-avoid-pthread_mutex_unlock-twice.patch b/0010-common-avoid-pthread_mutex_unlock-twice.patch new file mode 100644 index 0000000000000000000000000000000000000000..a6342485a228d38ea4d8b9f18b6913495a030f8e --- /dev/null +++ b/0010-common-avoid-pthread_mutex_unlock-twice.patch @@ -0,0 +1,55 @@ +From a5523129590c4ecf900161f89521b07b73aef615 Mon Sep 17 00:00:00 2001 +From: Dai Zhiwei +Date: Mon, 18 Oct 2021 11:34:50 +0800 +Subject: [PATCH] common: avoid pthread_mutex_unlock twice + + modified: src/common/cohort_lru.h + +Signed-off-by: Dai Zhiwei +--- + src/common/cohort_lru.h | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/src/common/cohort_lru.h b/src/common/cohort_lru.h +index 2383fc95d7..b105c80ccd 100644 +--- a/src/common/cohort_lru.h ++++ b/src/common/cohort_lru.h +@@ -139,15 +139,15 @@ namespace cohort { + for (int ix = 0; ix < n_lanes; ++ix, + lane_ix = next_evict_lane()) { + Lane& lane = qlane[lane_ix]; +- lane.lock.lock(); ++ std::unique_lock lane_lock{lane.lock}; + /* if object at LRU has refcnt==1, it may be reclaimable */ + Object* o = &(lane.q.back()); + if (can_reclaim(o)) { + ++(o->lru_refcnt); + o->lru_flags |= FLAG_EVICTING; +- lane.lock.unlock(); ++ lane_lock.unlock(); + if (o->reclaim(newobj_fac)) { +- lane.lock.lock(); ++ lane_lock.lock(); + --(o->lru_refcnt); + /* assertions that o state has not changed across + * relock */ +@@ -156,16 +156,13 @@ namespace cohort { + Object::Queue::iterator it = + Object::Queue::s_iterator_to(*o); + lane.q.erase(it); +- lane.lock.unlock(); + return o; + } else { +- // XXX can't make unreachable (means what?) + --(o->lru_refcnt); + o->lru_flags &= ~FLAG_EVICTING; + /* unlock in next block */ + } + } /* can_reclaim(o) */ +- lane.lock.unlock(); + } /* each lane */ + return nullptr; + } /* evict_block */ +-- +2.32.0.windows.1 + diff --git a/ceph.spec b/ceph.spec index 64bbc905ac6a0fe2e187c87b6dad835b4bccc115..7a228665bc641a977f63f98d7832a3eb89a42c90 100644 --- a/ceph.spec +++ b/ceph.spec @@ -110,7 +110,7 @@ ################################################################################# Name: ceph Version: 14.2.15 -Release: 7%{?dist} +Release: 8%{?dist} %if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler} Epoch: 2 %endif @@ -137,7 +137,9 @@ Patch4: 0004-CVE-2020-27781-4.patch Patch5: 0005-CVE-2020-27781-5.patch Patch6: 0006-CVE-2021-3524-1.patch Patch7: 0007-fix-build-error-PTHREAD_STACK_MIN.patch -Patch9: 0008-common-crc32c_aarch64-fix-crc32c-unittest-failed-on-.patch +Patch8: 0008-common-crc32c_aarch64-fix-crc32c-unittest-failed-on-.patch +Patch9: 0009-rgw-rgw_file-Fix-the-return-value-of-read-and-readli.patch +Patch10: 0010-common-avoid-pthread_mutex_unlock-twice.patch %if 0%{?suse_version} # _insert_obs_source_lines_here @@ -2045,6 +2047,9 @@ exit 0 %changelog +* Fri Dec 8 2021 Dai Zhiwei - 1:14.2.15-8 +- backport some librgw api bug fixes + * Fri Nov 5 2021 Dai Zhiwei - 1:14.2.15-7 - fix aarch64 crc32c unittest error