]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore/bluefs: Fix race condition between truncate() and unlink() 62588/head
authorAdam Kupczyk <akupczyk@ibm.com>
Tue, 1 Apr 2025 14:01:23 +0000 (14:01 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Tue, 8 Apr 2025 15:51:42 +0000 (15:51 +0000)
commite5f8892a1249a0ce631082d1fbf8884237434a0f
tree0bee4f82d01e9a2d127dec1f9190fa75c3dc7bae
parentd7f0b6a23d6e9d6bd5c760bbf94b509d50e80f7e
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/70747

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueFS.h