]> git.baikalelectronics.ru Git - kernel.git/commit
rbd: send snapshot context with writes
authorJosh Durgin <josh.durgin@inktank.com>
Wed, 26 Jun 2013 19:56:17 +0000 (12:56 -0700)
committerSage Weil <sage@inktank.com>
Thu, 27 Jun 2013 12:55:29 +0000 (05:55 -0700)
commit14c2ed5c6bf7e0229de220ededd069d376483e1b
treeafca84d419b3c3896cdbb59a9f6eb277e4ace7b3
parent22fa423d31ea4e69e2b94de47e8b01e561c8f7d1
rbd: send snapshot context with writes

Sending the right snapshot context with each write is required for
snapshots to work. Due to the ordering of calls, the snapshot context
is never set for any requests. This causes writes to the current
version of the image to be reflected in all snapshots, which are
supposed to be read-only.

This happens because rbd_osd_req_format_write() sets the snapshot
context based on obj_request->img_request. At this point, however,
obj_request->img_request has not been set yet, to the snapshot context
is set to NULL. Fix this by moving rbd_img_obj_request_add(), which
sets obj_request->img_request, before the osd request formatting
calls.

This resolves:
    http://tracker.ceph.com/issues/5465

Reported-by: Karol Jurak <karol.jurak@gmail.com>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
drivers/block/rbd.c