mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 05:16:00 +03:00
[PR #1780] [MERGED] Fixed wrong stat of cache after new creation file #2166
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#2166
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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:
master← Head:fix_fdpage📝 Commits (1)
b779560Fixed 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.