Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cp and mirror commands fail to be executed when the file length is 255 characters #5114

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

dormanze
Copy link
Contributor

@dormanze dormanze commented Jan 21, 2025

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.

Description

After I successfully upload a file whose length is 255, the download fails when I use mc cp to download the file.

Motivation and Context

The cp command of the MC is expected to support download of files whose length is 255 characters.

How to test this PR?

  1. touch graph_auto_space_yingshe.tag256_1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567c9111ce1764e1663d8253f6bf96bb710.xml

  2. mc cp graph_auto_space_yingshe.tag256_1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567c9111ce1764e1663d8253f6bf96bb710.xml myminio/bucket

  3. mc cp myminio/bucket/graph_auto_space_yingshe.tag256_1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567c9111ce1764e1663d8253f6bf96bb710.xml ./

I've tested the same 10G of data, 200,000 files, mirror, and cp command execution time without deterioration.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (mc cp exec failed #5115 )
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

The cp and mirror commands fails to be executed when the length of the file name is 255 characters.
Copy link
Contributor

@klauspost klauspost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some tweaks. Might as well get this right.

cmd/client-fs.go Show resolved Hide resolved
cmd/client-fs.go Show resolved Hide resolved
cmd/client-fs.go Outdated Show resolved Hide resolved
@dormanze dormanze requested a review from klauspost January 21, 2025 09:27
Copy link
Contributor

@klauspost klauspost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@harshavardhana harshavardhana merged commit 0019b7b into minio:master Jan 21, 2025
5 checks passed
@dormanze dormanze deleted the fix_cp branch January 26, 2025 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants