]> git.baikalelectronics.ru Git - kernel.git/commit
rbd: always set read-only flag in rbd_add()
authorAlex Elder <elder@inktank.com>
Mon, 6 May 2013 12:40:30 +0000 (07:40 -0500)
committerAlex Elder <elder@inktank.com>
Wed, 8 May 2013 12:48:12 +0000 (07:48 -0500)
commit13fb4daaa4b371fef5656dbbd6022859f210b3ae
treeec44e04a0219e9d7b7c99ad6e87b546289eceea5
parent64e97630fea65add1c86db0ac2440aed8bc3b2ed
rbd: always set read-only flag in rbd_add()

Hold off setting the read-only flag in rbd_add() for an image being
mapped until we have successfully probed the image.  At that point
we know whether it's a snapshot mapping or not, so we can set the
read-only flag in that one place rather than doing so (for
snapshots) in rbd_dev_mapping_set().  To do this, pass a flag to the
image probe routine indicating whether we want a read-only mapping.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c