mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 05:16:00 +03:00
[PR #2131] [CLOSED] Flush after opened file size is shrinked #2347
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#2347
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/2131
Author: @ggtakec
Created: 3/16/2023
Status: ❌ Closed
Base:
master← Head:fix_filesize📝 Commits (1)
67f98b7Flush after opened file size is shrinked📊 Changes
5 files changed (+134 additions, -10 deletions)
View changed files
📝
.gitignore(+2 -0)📝
src/s3fs.cpp(+21 -6)📝
test/Makefile.am(+6 -4)📝
test/integration-test-main.sh(+24 -0)➕
test/truncate_read_file.c(+81 -0)📄 Description
Relevant Issue (if applicable)
#2107
Details
There was a bug in trauncate, which shrinks files.
This bug occurs under the following conditions:
At this time, it got the old size before shrinking from the server(Content-Length) and set old size again.
So that the read data from the reduced size to the original size padded as 0x00, and read it.
When read all of file, the read size is old length before reduction.
I added C source code to test the condition that caused the failure and included it in this PR.
(Because it is difficult to realize with a shell script, I wrote it in C source)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.