]> git.apps.os.sepia.ceph.com Git - ceph-ci.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)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 22 Feb 2021 10:09:36 +0000 (11:09 +0100)
commitf6854ac65d2a838e2f523979e341136e5f201b5c
tree5a2b0fa83191631dd3f06a340856e7fa0d32f3f7
parent2a9d726fbb6d0bb18020b79ac376839e5dd79067
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>
src/krbd.cc