[PR #1780] [MERGED] Fixed wrong stat of cache after new creation file #2166

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

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/1780
Author: @ggtakec
Created: 10/16/2021
Status: Merged
Merged: 10/17/2021
Merged by: @gaul

Base: masterHead: fix_fdpage


📝 Commits (1)

  • b779560 Fixed wrong stat of cache after new creation file

📊 Changes

4 files changed (+68 additions, -22 deletions)

View changed files

📝 src/fdcache_entity.cpp (+10 -0)
📝 src/fdcache_entity.h (+1 -5)
📝 src/fdcache_page.cpp (+30 -17)
📝 test/integration-test-main.sh (+27 -0)

📄 Description

Relevant Issue (if applicable)

#1640

Details

When creating an empty file(when opening a non-existent file with the create flag), the FdEntity::MarkDirtyNewFile() method adds a page information to the pagelist.
The page information to be added was start=0 and size=1.

This works now, but the stat information(.<bucket>.stat/<file>) for the cache file immediately after the file is created that it shows a 1byte file.
However, the size of the real cache file is zero and it seems to work correctly.

If s3fs does not have the modified page information, it can not create an empty file, so it is as above for avoiding this.

But it is not correct, since the stat information for cache file is creating an incorrect state, this page addition process has been fixed.
After that, enabled to add page information of size 0 to pagelist.

For safety, if any other page information exists, the size 0 page information will be compressed and deleted.
This empty page information can exist only when there is no other page information(ex: when creating an empty file).


🔄 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/1780 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 10/16/2021 **Status:** ✅ Merged **Merged:** 10/17/2021 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `fix_fdpage` --- ### 📝 Commits (1) - [`b779560`](https://github.com/s3fs-fuse/s3fs-fuse/commit/b77956041acec8d3ebd0e49cfc8fa8549d2b946b) Fixed wrong stat of cache after new creation file ### 📊 Changes **4 files changed** (+68 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `src/fdcache_entity.cpp` (+10 -0) 📝 `src/fdcache_entity.h` (+1 -5) 📝 `src/fdcache_page.cpp` (+30 -17) 📝 `test/integration-test-main.sh` (+27 -0) </details> ### 📄 Description ### Relevant Issue (if applicable) #1640 ### Details When creating an empty file(when opening a non-existent file with the create flag), the `FdEntity::MarkDirtyNewFile()` method adds a page information to the pagelist. The page information to be added was start=0 and size=1. This works now, but the stat information(`.<bucket>.stat/<file>`) for the cache file immediately after the file is created that it shows a 1byte file. However, the size of the real cache file is zero and it seems to work correctly. If s3fs does not have the modified page information, it can not create an empty file, so it is as above for avoiding this. But it is not correct, since the stat information for cache file is creating an incorrect state, this page addition process has been fixed. After that, enabled to add page information of size 0 to pagelist. For safety, if any other page information exists, the size 0 page information will be compressed and deleted. This empty page information can exist only when there is no other page information(ex: when creating an empty file). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:04:06 +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#2166
No description provided.