Skip to content

mv: keep copying xattrs after one fails on a cross-device move - #14629

Open
krosci wants to merge 3 commits into
uutils:mainfrom
krosci:mv-copy-xattr-continue-on-error
Open

krosci wants to merge 3 commits into
uutils:mainfrom
krosci:mv-copy-xattr-continue-on-error

Conversation

@krosci

@krosci krosci commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

When a cross-device move copies a file or directory that carries several xattrs, a single rejected attribute (e.g. one larger than the destination filesystem allows) used to abort the copy loop, silently dropping every remaining xattr, and the move reported success. GNU mv reports the failing attribute on stderr, copies on through the others, and still exits 0.

copy_xattrs*/apply_xattrs* in uucore now report each failing attribute, keep copying the rest, and return the first error. mv no longer aborts the directory path on a reported failure. cp uses a silent marker so the already-reported per-attribute diagnostics are not echoed a second time.

Fixes #14598.

Comment thread src/uu/cp/src/cp.rs Outdated
#[error("{}", translate!("cp-error-not-all-files-copied"))]
NotAllFilesCopied,

/// Extended-attribute copying failed, but every failure was already

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i think it can be a one line comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

Comment thread src/uu/cp/src/cp.rs Outdated

// If copying xattrs failed, propagate that error now with context.
//
// `copy_xattrs*` already reported each failing attribute on stderr, so

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same, doesn't have to be that long

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

@krosci
krosci requested a review from sylvestre September 16, 2026 23:14
@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/printf/printf-surprise is now being skipped but was previously passing.

@krosci
krosci force-pushed the mv-copy-xattr-continue-on-error branch 2 times, most recently from 6f7d5a0 to c2bc696 Compare September 18, 2026 09:01
@krosci
krosci force-pushed the mv-copy-xattr-continue-on-error branch from c2bc696 to f61ed64 Compare September 18, 2026 10:52
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.

mv: cross-device move drops the rest of the xattrs after one failure, and reports success

2 participants