rbd: set up watch in rbd_dev_image_probe()
authorAlex Elder <elder@inktank.com>
Sat, 27 Apr 2013 14:59:31 +0000 (09:59 -0500)
committerSage Weil <sage@inktank.com>
Thu, 2 May 2013 04:20:01 +0000 (21:20 -0700)
commitb644de2ba0c5b590db9195c03358ccd0f061daa6
tree85bfa5ab49b5a3617b04d8c4c3dab1750550f3dd
parent96f03e08f9f27cf72d2c24b4e75ade81d2df3c75
rbd: set up watch in rbd_dev_image_probe()

Move setting up the watch request for an image so it's done in
rbd_dev_image_probe() rather than rbd_dev_probe_finish().  Move
it all the way up to before doing the initial probe.  This avoids
a potential race condition, in which we get (and use) the initial
snapshot context for an image, and it gets changed between that
time and the time we get the watch set up.

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

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