]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore/bluefs: Fix race condition between truncate() and unlink() 62839/head
authorAdam Kupczyk <akupczyk@ibm.com>
Tue, 1 Apr 2025 14:01:23 +0000 (14:01 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 16 Apr 2025 07:06:40 +0000 (07:06 +0000)
commit8c541963b60ce957f112f3a5ae0da68b8a7ccd47
tree2feb74d82e21951270a0f1bf7402b8e6cf772177
parentb0ff2b3aae0b9262ce911ee47839bf71d7441051
os/bluestore/bluefs: Fix race condition between truncate() and unlink()

It was possible for unlink() to interrupt ongoing truncate().
As the result, unlink() finishes properly, but truncate() is not aware
of it and does:
1) updates file that is already removed
2) releases same allocations again

Now fixed by checking if file is deleted under FILE lock.

https://tracker.ceph.com/issues/70856

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit e5f8892a1249a0ce631082d1fbf8884237434a0f)
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueFS.h