]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
rbd: do not read in parent info before snap context
authorIlya Dryomov <ilya.dryomov@inktank.com>
Thu, 24 Jul 2014 06:42:13 +0000 (10:42 +0400)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Fri, 25 Jul 2014 09:16:14 +0000 (13:16 +0400)
commite8f59b595d05b7251a9a3054c14567fd8c8220ef
treeb5fdb58bfdd0436b498475adfa405a67f334f53b
parent5ff1108ccc10dbb07bf5875e38fee313844ccef6
rbd: do not read in parent info before snap context

Currently rbd_dev_v2_header_info() reads in parent info before the snap
context is read in.  This is wrong, because we may need to look at the
the parent_overlap value of the snapshot instead of that of the base
image, for example when mapping a snapshot - see next commit.  (When
mapping a snapshot, all we got is its name and we need the snap context
to translate that name into an id to know which parent info to look
for.)

The approach taken here is to make sure rbd_dev_v2_parent_info() is
called after the snap context has been read in.  The other approach
would be to add a parent_overlap field to struct rbd_mapping and
maintain it the same way rbd_mapping::size is maintained.  The reason
I chose the first approach is that the value of keeping around both
base image values and the actual mapping values is unclear to me.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
drivers/block/rbd.c