[PR #2283] [MERGED] Added std::map erase before calling emplace in xattrs operations #2444

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

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2283
Author: @ggtakec
Created: 8/19/2023
Status: Merged
Merged: 8/20/2023
Merged by: @gaul

Base: masterHead: fix_emplace


📝 Commits (1)

  • e08e049 Reverted to direct array access instead of std::map emplace

📊 Changes

2 files changed (+6 additions, -3 deletions)

View changed files

📝 src/s3fs.cpp (+2 -3)
📝 test/integration-test-main.sh (+4 -0)

📄 Description

Relevant Issue (if applicable)

#2280

Details

std::map emplace will not replace the value if that key exists.
Fixed xattrs handling to call erase if there is a target key.

I also added a test case for the missing xattrs inspection related to this.

Check where emplace is used in the current source code, and there is no problem except for xattrs.
(In the stat cache process, the keys are deleted in advance, so I don't think there will be any problems.)


🔄 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/2283 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 8/19/2023 **Status:** ✅ Merged **Merged:** 8/20/2023 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `fix_emplace` --- ### 📝 Commits (1) - [`e08e049`](https://github.com/s3fs-fuse/s3fs-fuse/commit/e08e049791b02ed2b62dd821ab09835059fabaee) Reverted to direct array access instead of std::map emplace ### 📊 Changes **2 files changed** (+6 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/s3fs.cpp` (+2 -3) 📝 `test/integration-test-main.sh` (+4 -0) </details> ### 📄 Description ### Relevant Issue (if applicable) #2280 ### Details `std::map emplace` will not replace the value if that key exists. Fixed xattrs handling to call `erase` if there is a target key. I also added a test case for the missing xattrs inspection related to this. Check where emplace is used in the current source code, and there is no problem except for xattrs. (In the `stat cache` process, the keys are deleted in advance, so I don't think there will be any problems.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:05:34 +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#2444
No description provided.