]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
krbd: make sure the device node is accessible after the mapping 39642/head
authorIlya Dryomov <idryomov@gmail.com>
Fri, 19 Feb 2021 15:47:17 +0000 (16:47 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 23 Feb 2021 16:51:23 +0000 (17:51 +0100)
commit6cd12aa381c0041d18242840d6c827bbeb32fda2
treee16c7820a48521d9fe44e63ca999d4ae89e37814
parent71ca6256249f5020aa372710c6a9eece4acc80f4
krbd: make sure the device node is accessible after the mapping

We have always assumed this to be the case and users' scripts and
orchestration tools have grown to depend on this.  Let's add some
enforcement, prompted by [1]:

  "I am running my Kubernetes worker node inside of an LXC container
   which doesn't benefit from the device node created by the kernel, so
   I'm using udev to create the /dev/rbd* device nodes inside of the LXC
   container."

which, through the unfortunate interaction with ceph-csi rbd plugin,
results in data loss for "volumeMode: Filesystem" PVs because it ends
up recreating the filesystem every time the PV is attached to the pod:

  "When deleting the pod and re-creating it, I can see that the RBD
   image is indeed being reformatted. This seems to be because when
   blkid is being run to check if the image is formatted, the /dev/rbd*
   device has not yet been created by udev. By the time the code gets
   down to running mkfs, the device is there and the damage is done."

[1] https://github.com/ceph/ceph-csi/issues/1820

Fixes: https://tracker.ceph.com/issues/49410
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit f6854ac65d2a838e2f523979e341136e5f201b5c)
src/krbd.cc