]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
krbd: make sure the device node is accessible after the mapping
authorIlya Dryomov <idryomov@gmail.com>
Fri, 19 Feb 2021 15:47:17 +0000 (16:47 +0100)
committerJason Dillaman <dillaman@redhat.com>
Tue, 9 Mar 2021 21:53:59 +0000 (16:53 -0500)
commitb977a1a415a2a371435dfaf4decd29d9d9063d77
tree838c5b71cb75993c86f0cf957850f8e65b1ead4e
parent1ff7d244fcbc15312e010f47e19e0e96c819755d
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