]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
blk/kernel: Add O_EXCL for block devices 53567/head
authorAdam Kupczyk <akupczyk@redhat.com>
Tue, 29 Nov 2022 15:38:08 +0000 (15:38 +0000)
committerPrashant D <pdhange@redhat.com>
Wed, 20 Sep 2023 22:53:12 +0000 (18:53 -0400)
commit59f6535b1780d142a84117d4199b30cb596d080e
tree5a97d92ae62914a38f43c475bf65c3f89165a9fa
parente3f5e0b901546d86badda7c8be2c9b08121e74c2
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>
(cherry picked from commit 5dc01efd97109fcb7fc3ded5ffbe502c8e7439b2)
src/blk/kernel/KernelDevice.cc