]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: drop ops when pool has EIO flag 43177/head
authorSage Weil <sage@newdream.net>
Wed, 15 Sep 2021 23:12:38 +0000 (19:12 -0400)
committerSage Weil <sage@newdream.net>
Mon, 27 Sep 2021 17:20:31 +0000 (13:20 -0400)
If the op doesn't have the SUPPORTSPOOLEIO flag (i.e., it is an old client),
return with an explicit EIO.

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/PrimaryLogPG.cc

index 6b1a3e52f45b6b8cd93d7cdd4e52798d328240e5..fefe60c7477db6f6163e85ae3ab11065936a69f3 100644 (file)
@@ -2128,12 +2128,21 @@ void PrimaryLogPG::do_op(OpRequestRef& op)
     return;
   }
   int64_t poolid = get_pgid().pool();
-  if (op->may_write()) {
-
-    const pg_pool_t *pi = get_osdmap()->get_pg_pool(poolid);
-    if (!pi) {
-      return;
+  const pg_pool_t *pi = get_osdmap()->get_pg_pool(poolid);
+  if (!pi) {
+    return;
+  }
+  if (pi->has_flag(pg_pool_t::FLAG_EIO)) {
+    // drop op on the floor; the client will handle returning EIO
+    if (m->has_flag(CEPH_OSD_FLAG_SUPPORTSPOOLEIO)) {
+      dout(10) << __func__ << " discarding op due to pool EIO flag" << dendl;
+    } else {
+      dout(10) << __func__ << " replying EIO due to pool EIO flag" << dendl;
+      osd->reply_op_error(op, -EIO);
     }
+    return;
+  }
+  if (op->may_write()) {
 
     // invalid?
     if (m->get_snapid() != CEPH_NOSNAP) {