mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 13:26:00 +03:00
[PR #1569] [MERGED] Improved processing when HEAD response is 400 #2051
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#2051
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/1569
Author: @ggtakec
Created: 2/13/2021
Status: ✅ Merged
Merged: 2/13/2021
Merged by: @gaul
Base:
master← Head:head_400📝 Commits (1)
55c7f79Improved processing when HEAD response is 400📊 Changes
2 files changed (+32 additions, -4 deletions)
View changed files
📝
src/curl.cpp(+7 -2)📝
src/s3fs.cpp(+25 -2)📄 Description
Relevant Issue (if applicable)
#1569 #1567
(But this PR merge does not have to wait for #1567 merge.)
Details
Current
The HEAD request returns a 400 error if access to an object such as SSE is denied.(See also #1567)
If s3fs received this error, it was not registered in the Stats cache.
Therefore, when everytime listing the directories containing the SSE objects that generate the error, a HEAD request was generated for each object that causes the error.
Also, the object that resulted in EPREM with a 403 error also degraded performance as same as it.
Fixes
For HEAD requests, It was changed the 400 error to EPERM instead of EIO.
And when s3fs receives the result of EPERM, s3fs registers the file in the Stats cache.
This will list the files in the list of objects in the directory without any error message.
However, if s3fs leaves the meta header empty and register it in the Stats cache, it will be displayed with the permissions
0644.In this state, when user access the file, nothing is displayed without any error.
So, when registering in the Stats cache, s3fs sets
0000permission as the dummy tox-amz-meta-modeand register it.This allows that user gets a
Permission deniederror when user access the file.Details
Before the fix, objects such as SSE(with error) were displayed as follows.
As mentioned above, permissions, owner, group, date and time were all
?, And aNo such file or directoryerror was output.And the HEAD request sent every time when user reads this directory.
First HEAD request receives a 400 error, so after all, the 4 type request(the normal path(
/sse_file), the path as a directory(/sse_file/), the special path(/sse_file_$folder$) and ListBucket requests as/sse_file) were sent.After modification, only HEAD request(normal path(
/sse_file)) will be sent.Also, once registered in the Stats cache, no HEAD requests will be sent while the cache is valid.
And the result of listing the directories is as follows.
As mentioned above, the file permissions will be
0000, and the owner, group, date and time(unixtime=0) will also be displayed.Also, the
No such file or directoryerror disappears.When user accesses this file, user gets a
Permission deniederror as shown below.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.