]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
rbd: don't zero-fill non-image object requests
authorAlex Elder <elder@inktank.com>
Wed, 27 Mar 2013 14:16:30 +0000 (09:16 -0500)
committerAlex Elder <elder@inktank.com>
Fri, 29 Mar 2013 19:26:13 +0000 (14:26 -0500)
commit3d2429d859a595593d39219ff9470e81f2551d4b
tree68ac5d9e4e9736ffb0f37ec6ab7d2b14c36675c6
parent74ff80f189ec31f75c92e3ba8a5e0c93f67f0935
rbd: don't zero-fill non-image object requests

A result of ENOENT from a read request for an object that's part of
an rbd image indicates that there is a hole in that portion of the
image.  Similarly, a short read for such an object indicates that
the remainder of the read should be interpreted a full read with
zeros filling out the end of the request.

This behavior is not correct for objects that are not backing rbd
image data.  Currently rbd_img_obj_request_callback() assumes it
should be done for all objects.

Change rbd_img_obj_request_callback() so it only does this zeroing
for image objects.  Encapsulate that special handling in its own
function.  Add an assertion that the image object request is a bio
request, since we assume that (and we currently don't support any
other types).

This resolves a problem identified here:
    http://tracker.ceph.com/issues/4559

Reported-by: Dan van der Ster <dan@vanderster.com>
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 86c58b1d2c195e86468366326f0fe2793f517bcb)
drivers/block/rbd.c