If block completions finished before all of them were scheduled, the
pending_count could reach 0, and the callback could be called more
than once. This caused the reference counting to be off, so the next
call to the callback passed an invalid pointer, resulting in crashes
like this (or more mysterious ones):
common/Mutex.h: In function 'void Mutex::Lock(bool)', in thread '0x7f5f37e62700'
common/Mutex.h: 118: FAILED assert(r == 0)
1: (librbd::RBD::AioCompletion::get_return_value()+0x19c) [0x7f5f408835bc]
2: /usr/bin/kvm() [0x4629fd]
3: (librbd::AioCompletion::complete_block(librbd::AioBlockCompletion*, long)+0x13c) [0x7f5f4088ab5c]
4: (librbd::rados_aio_sparse_read_cb(void*, void*)+0x8d) [0x7f5f4088b40d]
5: (librados::RadosClient::C_aio_sparse_read_Ack::finish(int)+0x12e) [0x7f5f4050beee]
6: (Objecter::handle_osd_op_reply(MOSDOpReply*)+0x783) [0x7f5f40517863]
7: (librados::RadosClient::_dispatch(Message*)+0x3c) [0x7f5f404ffe8c]
8: (librados::RadosClient::ms_dispatch(Message*)+0x33) [0x7f5f404fff53]
9: (SimpleMessenger::dispatch_entry()+0x69d) [0x7f5f405bf5bd]
10: (SimpleMessenger::DispatchThread::entry()+0x1c) [0x7f5f4050052c]
11: (()+0x6d8c) [0x7f5f40c9dd8c]
12: (clone()+0x6d) [0x7f5f3e0b904d]
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Previously it assumed everything was relative, but we need to handle
absolute paths on occasion, and already have the code to do so!
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
This prevents it from getting cleaned up during mkfs. Then we can make it
a symlink, or at the very least avoid deleting + reallocating it.
Signed-off-by: Sage Weil <sage@newdream.net>
If block completions finished before all of them where scheduled, the
pending_count would reach 0, and the AioCompletion would be destroyed
since the refcount would also reach 0. To fix this, hold a reference
to the AioCompletion while scheduling more block completions.
This caused a crash like this when running qemu:
1: ceph::__ceph_assert_fail (assertion=<value optimized out>, file=<value optimized out>, line=<value optimized out>, func=<value optimized out>) at common/assert.cc:86
2: Lock (ictx=0x7f83d0001f00, off=5368705024, len=0, buf=0x2fac000 "", c=0x2cebe00) at common/Mutex.h:118
3: add_block_completion (ictx=0x7f83d0001f00, off=5368705024, len=0, buf=0x2fac000 "", c=0x2cebe00) at librbd.cc:159
4: librbd::aio_read (ictx=0x7f83d0001f00, off=5368705024, len=0, buf=0x2fac000 "", c=0x2cebe00) at librbd.cc:1368
5: rbd_aio_rw_vector (bs=<value optimized out>, sector_num=10485752, qiov=<value optimized out>, nb_sectors=<value optimized out>, cb=<value optimized out>, opaque=<value optimized out>, write=0) at block/rbd.c:626
6: qemu_rbd_aio_readv (bs=<value optimized out>, sector_num=<value optimized out>, qiov=<value optimized out>, nb_sectors=<value optimized out>, cb=<value optimized out>, opaque=<value optimized out>) at block/rbd.c:649
7: bdrv_aio_readv (bs=0x2ce92e0, sector_num=10485752, qiov=0x2de08f0, nb_sectors=8, cb=<value optimized out>, opaque=<value optimized out>)
Fixes: #998
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
No need for a separate qa/src/ dir; just put them where we want them. We
need to ignore non-executable files when doing the bulk runs anyway.
Signed-off-by: Sage Weil <sage@newdream.net>
This lets the workunits find stuff build in qa/src/, in case you are
running using these (old) scripts.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Look at the ObjectState to determine if the head exists, not the snapset
(which doesn't reflect the prior object state).
Signed-off-by: Sage Weil <sage@newdream.net>