]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore/bluefs: Fix race condition between truncate() and unlink() 62840/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:36:51 +0000 (07:36 +0000)
commit4f83038f13e60f02d2a14c59df232b392b57a904
tree690bcdcb2c3e1a1b67765de1805b0b95a3850937
parent3993779cde9d10512f4a26f87487d11103ac1bd0
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.

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