uutils / uutils/coreutils

mv hardlinks should be preserved when moving into a different directory

Open
#4,833 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue U - mv
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Testcase:

export C=/usr/bin/
export C="target/debug/coreutils "
dir=hlink
other_partition_tmpdir=/dev/shm/tmp769306

rm -rf $dir $other_partition_tmpdir
mkdir $dir $other_partition_tmpdir
> $dir/a
ln $dir/a $dir/b

${C}mv $dir "$other_partition_tmpdir"

ls -1i "$other_partition_tmpdir/$dir"

They should be equal. They aren't currently

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the provided mv testcase, using a directory on /dev/shm to exercise the different-filesystem path. Start at the mv command entry point and trace how hard links are handled when moving a directory; done means the inode numbers printed for a and b are equal after the move.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.