]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/osdc/Objecter.h
update sources to v12.2.3
[ceph.git] / ceph / src / osdc / Objecter.h
index 527022b5d2ac830318965a8723bef33111e4cc45..87ace75699acee5b19b06140c57d5bb3dd07bbc3 100644 (file)
@@ -335,13 +335,20 @@ struct ObjectOperation {
     void finish(int r) override {
       bufferlist::iterator iter = bl.begin();
       if (r >= 0) {
-       try {
-         ::decode(*extents, iter);
-         ::decode(*data_bl, iter);
-       } catch (buffer::error& e) {
-         if (prval)
-           *prval = -EIO;
-       }
+        // NOTE: it's possible the sub-op has not been executed but the result
+        // code remains zeroed. Avoid the costly exception handling on a
+        // potential IO path.
+        if (bl.length() > 0) {
+         try {
+           ::decode(*extents, iter);
+           ::decode(*data_bl, iter);
+         } catch (buffer::error& e) {
+           if (prval)
+              *prval = -EIO;
+         }
+        } else if (prval) {
+          *prval = -EIO;
+        }
       }
     }
   };