]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
rbd: make sure we have latest osdmap on 'rbd map'
authorIlya Dryomov <ilya.dryomov@inktank.com>
Tue, 13 May 2014 07:19:27 +0000 (11:19 +0400)
committerYan, Zheng <zheng.z.yan@intel.com>
Fri, 6 Jun 2014 01:29:58 +0000 (09:29 +0800)
commit30ba1f020221991cf239d905c82984958f29bdfe
tree343cad430c508927f86c5b756d1dabd50c1aa1d3
parent6044cde6f2a94d88142d4401624152a741866338
rbd: make sure we have latest osdmap on 'rbd map'

Given an existing idle mapping (img1), mapping an image (img2) in
a newly created pool (pool2) fails:

    $ ceph osd pool create pool1 8 8
    $ rbd create --size 1000 pool1/img1
    $ sudo rbd map pool1/img1
    $ ceph osd pool create pool2 8 8
    $ rbd create --size 1000 pool2/img2
    $ sudo rbd map pool2/img2
    rbd: sysfs write failed
    rbd: map failed: (2) No such file or directory

This is because client instances are shared by default and we don't
request an osdmap update when bumping a ref on an existing client.  The
fix is to use the mon_get_version request to see if the osdmap we have
is the latest, and block until the requested update is received if it's
not.

Fixes: http://tracker.ceph.com/issues/8184
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
drivers/block/rbd.c