mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 05:16:00 +03:00
[PR #1579] [MERGED] Fixed a bug that filling NULL bytes when changing the attribute after renaming #2056
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#2056
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/1579
Author: @ggtakec
Created: 2/19/2021
Status: ✅ Merged
Merged: 2/20/2021
Merged by: @gaul
Base:
master← Head:fix_1453📝 Commits (2)
6de31b1Fixed a bug that filling NULL bytes when changing the attribute after renaming929f81bFixed the same bug in chmod/chown/utimens and added tests📊 Changes
3 files changed (+178 additions, -48 deletions)
View changed files
📝
src/s3fs.cpp(+81 -48)📝
test/integration-test-main.sh(+87 -0)📝
test/test-utils.sh(+10 -0)📄 Description
Relevant Issue (if applicable)
#1453
Details
The rename logic internally copies the file and deletes the original file.
The cause of the #1453 was that s3fs was updating mtime immediately after this copy, at which time a new cache file was created and the contents of the file were null.
In this PR, updates such as mtime are added to the cache file before copying.
And leave the cache file open and copy (put_header).
After copying, rename the cache file and delete the original file.
Keeping the cache file open is necessary because fdcache cannot be renamed unless it is open and new cache files are not created.
And, although it was also the cause of the problem, I accidentally deleted the cache of the destination file.
This is also fixed. (Prevents unnecessary downloads and improves efficiency)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.