mirror of
https://github.com/libfuse/libfuse.git
synced 2026-07-07 14:47:41 +08:00
memfs_ll: fix deadlock in truncate operation
Remove redundant mutex lock acquisition in the truncate() method to prevent deadlock. The issue occurs when memfs_setattr() already holds the mutex lock and then calls truncate(), which attempts to acquire the same lock again. Signed-off-by: Long Li <leo.lilong@huawei.com>
This commit is contained in:
@@ -199,7 +199,6 @@ class Inode {
|
||||
|
||||
void truncate(off_t size)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex);
|
||||
std::lock_guard<std::mutex> attr_lock(attr_mutex);
|
||||
if (size < content.size()) {
|
||||
content.resize(size);
|
||||
|
||||
Reference in New Issue
Block a user