]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: fix zero length request handling 1632/head
authorJosh Durgin <josh.durgin@inktank.com>
Wed, 9 Apr 2014 00:38:50 +0000 (17:38 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Wed, 9 Apr 2014 00:39:00 +0000 (17:39 -0700)
commita8330f5cfddaab853a1844afe43ee9a71f96d0c3
treec65561625aa854b6d55b53c53aecb8887246164a
parent26907e3dcdcc3e1bab571638858ad713684216ef
librbd: fix zero length request handling

Zero-length writes would hang because the completion was never
called. Reads would hit an assert about zero length in
Striper::file_to_exents().

Fix all of these cases by skipping zero-length extents. The completion
is created and finished when finish_adding_requests() is called. This
is slightly different from usual completions since it comes from the
same thread as the one scheduling the request, but zero-length aio
requests should never happen from things that might care about this,
like QEMU.

Writes and discards have had this bug since the beginning of
librbd. Reads might have avoided it until stripingv2 was added.

Fixes: #5469
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/librbd/internal.cc
src/test/librbd/test_librbd.cc