[PR #1404] [MERGED] fix dead lock in disk insufficient and optimize code #1964

Closed
opened 2026-03-04 02:03:00 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/1404
Author: @liuyongqing
Created: 9/16/2020
Status: Merged
Merged: 9/19/2020
Merged by: @ggtakec

Base: masterHead: master


📝 Commits (1)

  • 211cc0f fix dead lock in disk insufficient and optimize code

📊 Changes

4 files changed (+29 additions, -59 deletions)

View changed files

📝 src/fdcache_entity.cpp (+26 -54)
📝 src/fdcache_entity.h (+0 -1)
📝 src/metaheader.h (+0 -1)
📝 src/s3fs.cpp (+3 -3)

📄 Description

Relevant Issue (if applicable)

Dead lock will occured in UploadPendingMeta which will call put_headers, the situation like follow:

  1. RowFlush get fdent_data_lock, fdent_lock and call put_headers and try to lock fdmanager_lock
  2. A another thread call s3fs_getattr, get fd_manager_lock and try get lock fdent_lock to increment refecnt
    In step one and step two, the dead lock occured, the solution is not get fdmanager lock to update mtime. In adittion, the file x-cos-meta-xxx can directly update to orgmeta and only need to call put_headers once in UploadPendingMeta.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/1404 **Author:** [@liuyongqing](https://github.com/liuyongqing) **Created:** 9/16/2020 **Status:** ✅ Merged **Merged:** 9/19/2020 **Merged by:** [@ggtakec](https://github.com/ggtakec) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`211cc0f`](https://github.com/s3fs-fuse/s3fs-fuse/commit/211cc0f5f2d5759712b156fcd7946e048130e0ad) fix dead lock in disk insufficient and optimize code ### 📊 Changes **4 files changed** (+29 additions, -59 deletions) <details> <summary>View changed files</summary> 📝 `src/fdcache_entity.cpp` (+26 -54) 📝 `src/fdcache_entity.h` (+0 -1) 📝 `src/metaheader.h` (+0 -1) 📝 `src/s3fs.cpp` (+3 -3) </details> ### 📄 Description ### Relevant Issue (if applicable) Dead lock will occured in UploadPendingMeta which will call put_headers, the situation like follow: 1. RowFlush get fdent_data_lock, fdent_lock and call put_headers and try to lock fdmanager_lock 2. A another thread call s3fs_getattr, get fd_manager_lock and try get lock fdent_lock to increment refecnt In step one and step two, the dead lock occured, the solution is not get fdmanager lock to update mtime. In adittion, the file x-cos-meta-xxx can directly update to orgmeta and only need to call put_headers once in UploadPendingMeta. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:03:00 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#1964
No description provided.