]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
blk/kernel: Add O_EXCL for block devices
authorAdam Kupczyk <akupczyk@redhat.com>
Tue, 29 Nov 2022 15:38:08 +0000 (15:38 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 25 Jan 2023 11:27:14 +0000 (11:27 +0000)
commit5dc01efd97109fcb7fc3ded5ffbe502c8e7439b2
treef58be8b7c3c8313cfd0e3b33f0deb7e12c73ca64
parentb197423020829e2b98ae1ea48bacaf0d82e53b21
blk/kernel: Add O_EXCL for block devices

Change behaviour when target file is block device "mknod name b major minor".
Append O_EXCL flag for first open of the block device.

The problem is that if 2 different files for same block devices are created,
it is possible to ::flock each of them in 2 separate processes.
In some container cases when we recreate bluestore osd dir with
  ceph-bluestore-tool prime-osd
command, we can end up with completely different files.
Open with O_EXCL is immune to that.

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
src/blk/kernel/KernelDevice.cc