]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Objecter: remove balance_read and localize_read if rwordered
authorNitzan Mordechai <nmordech@redhat.com>
Mon, 14 Apr 2025 11:49:30 +0000 (11:49 +0000)
committerNitzan Mordechai <nmordech@redhat.com>
Tue, 15 Jul 2025 13:10:06 +0000 (13:10 +0000)
Objecter shouldn't sent ops with mixed rwordered and balance_read flags

Fixes: https://tracker.ceph.com/issues/70715
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
(cherry picked from commit 40292f2fd10f338c9baab60a019dfe4806e642c7)

src/osdc/Objecter.h

index 4167660c5a8d9dd07519e5145bbbc8fe56ee204e..edf0f4d285ec3f37b0680c60fe7d1248a7c16b94 100644 (file)
@@ -2933,8 +2933,15 @@ private:
   int _op_cancel(ceph_tid_t tid, int r);
 
   int get_read_flags(int flags) {
-    return flags | global_op_flags | extra_read_flags.load(std::memory_order_relaxed) |
-                   CEPH_OSD_FLAG_READ;
+    int ret = flags | global_op_flags |
+              extra_read_flags.load(std::memory_order_relaxed) |
+              CEPH_OSD_FLAG_READ;
+
+    // If the op is rwordered, strip out the balanced and localized flags.
+    if (flags & CEPH_OSD_FLAG_RWORDERED) {
+      ret &= ~(CEPH_OSD_FLAG_BALANCE_READS | CEPH_OSD_FLAG_LOCALIZE_READS);
+    }
+    return ret;
   }
 
 public: