[PR #2177] [MERGED] Use smart pointer to manage pcfstat object #2374

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

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2177
Author: @eryugey
Created: 5/31/2023
Status: Merged
Merged: 7/19/2023
Merged by: @gaul

Base: masterHead: dev


📝 Commits (1)

  • 503a4bd Use smart pointer to manage pcfstat object

📊 Changes

1 file changed (+4 additions, -6 deletions)

View changed files

📝 src/fdcache_entity.cpp (+4 -6)

📄 Description

Previously pcfstat points to a raw pointer, and it may be leaked if
function returned before deleting it.

So use smart pointer to automatically release the object.

Note that currently s3fs only uses c++03, so we use auto_ptr here, not
unique_ptr, which requires c++11.

Fixes: github.com/s3fs-fuse/s3fs-fuse@6ca5a24a7f ("Fix two inconsistency issues between stat cache and cache file (https://github.com/s3fs-fuse/s3fs-fuse/pull/2152)")
Signed-off-by: Eryu Guan eguan@linux.alibaba.com


🔄 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/2177 **Author:** [@eryugey](https://github.com/eryugey) **Created:** 5/31/2023 **Status:** ✅ Merged **Merged:** 7/19/2023 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `dev` --- ### 📝 Commits (1) - [`503a4bd`](https://github.com/s3fs-fuse/s3fs-fuse/commit/503a4bd0176fbe0eba9479c1356981e27a0a234f) Use smart pointer to manage pcfstat object ### 📊 Changes **1 file changed** (+4 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/fdcache_entity.cpp` (+4 -6) </details> ### 📄 Description Previously pcfstat points to a raw pointer, and it may be leaked if function returned before deleting it. So use smart pointer to automatically release the object. Note that currently s3fs only uses c++03, so we use auto_ptr here, not unique_ptr, which requires c++11. Fixes: https://github.com/s3fs-fuse/s3fs-fuse/commit/6ca5a24a7f29718967de1b8cc78dfe68c839729a ("Fix two inconsistency issues between stat cache and cache file (https://github.com/s3fs-fuse/s3fs-fuse/pull/2152)") Signed-off-by: Eryu Guan <eguan@linux.alibaba.com> --- <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:12 +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#2374
No description provided.