]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore/bluefs: Fix race condition between truncate() and unlink()
authorAdam Kupczyk <akupczyk@ibm.com>
Tue, 1 Apr 2025 14:01:23 +0000 (14:01 +0000)
committerYuri Weinstein <yweinste@redhat.com>
Wed, 30 Apr 2025 21:05:52 +0000 (21:05 +0000)
commitb480287a40dd1b0f43eb80531634908dd7c0b6ff
tree97b348d6e14874ef755f6e504bc7bbab5012655a
parent4bb7b63f8a4329919e61b856da88c14180f99e35
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)
(cherry picked from commit 4f83038f13e60f02d2a14c59df232b392b57a904)
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueFS.h