]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: don't claim ObjectOperation::cmpext() buffer
authorIlya Dryomov <idryomov@gmail.com>
Tue, 19 Feb 2019 15:07:22 +0000 (16:07 +0100)
committerJason Dillaman <dillaman@redhat.com>
Wed, 15 May 2019 20:32:44 +0000 (16:32 -0400)
This is counter-intuitive and doesn't match the behavior of either
other compare ops (cmpxattr, omap_cmp) or write ops.

Fixes: http://tracker.ceph.com/issues/38383
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 4daddf0564dcd548ecc7c214ab9a41fc12ba71c0)

Conflicts:
don't change method signature but copy bufferlist

src/librados/librados.cc

index 77bc9ca9ad3bcff32335cc7d261dc31137959e0d..e4698f2adad09800a095bf0e84755ed9f28b689d 100644 (file)
@@ -158,7 +158,8 @@ void librados::ObjectOperation::cmpext(uint64_t off,
                                        int *prval)
 {
   ::ObjectOperation *o = &impl->o;
-  o->cmpext(off, cmp_bl, prval);
+  bufferlist c = cmp_bl;
+  o->cmpext(off, c, prval);
 }
 
 void librados::ObjectOperation::cmpxattr(const char *name, uint8_t op, const bufferlist& v)