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>
(cherry picked from commit
02fae9fc54c10b5a932102bac43f32199d4cb612)