]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd: handle no-op write with snapshot case 3183/head
authorSage Weil <sage@redhat.com>
Tue, 16 Dec 2014 01:04:32 +0000 (17:04 -0800)
committerSage Weil <sage@redhat.com>
Tue, 16 Dec 2014 01:04:32 +0000 (17:04 -0800)
commit02fae9fc54c10b5a932102bac43f32199d4cb612
tree0eea46e79d4fc4454e458b07772321324ed90e7e
parentdb951aed0aca59a1bb2b21b87ada714e6769e230
osd: handle no-op write with snapshot case

If we have a transaction that does something to the object but it !exists
both before and after, we will continue through the write path.  If the
snapdir object already exists, and we try to create it again, we will
leak a snapdir obc and lock and later crash on an assert when the obc
is destroyed:

0> 2014-12-06 01:49:51.750163 7f08d6ade700 -1 osd/osd_types.h: In function 'ObjectContext::~ObjectContext()' thread 7f08d6ade700 time 2014-12-06 01:49:51.605411
osd/osd_types.h: 2944: FAILED assert(rwstate.empty())

Fix is to not recreated the snapdir if it already exists.

Fixes: #10262
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ReplicatedPG.cc
src/test/librados/snapshots.cc