Skip to content

rm --one-file-system should fail wih rm: skipping 'a/b', since it's on a different device #7011

Closed

Description

@sylvestre
t=/tmp/a2323
mkdir -p a/b $t/y
sudo mount --bind $t a/b
../gnu/src/rm --one-file-system -rf a
./target/debug/coreutils rm --one-file-system -rf a
sudo umount a/b /tmp/a2323

currently returns:
rm: cannot remove 'a': Device or resource busy (os error 16)

when it should return:
rm: skipping 'a/b', since it's on a different device

it will probably requires a new function to investigate all files/directories to be removed.
(fortunately, will be only called with --one-file-system)

Note that it should not regress:

mkdir -p a42/b
./target/debug/coreutils rm --one-file-system -rf a42 || fail=1
echo $fail

tested by upstream:
bash util/run-gnu-test.sh tests/rm/one-file-system.sh tests/rm/one-file-system2

Activity

  1. sylvestre commented on Dec 28, 2024

    @sylvestre
    SponsorContributorAuthor
  2. Harshit933 commented on Jan 18, 2025

    @Harshit933

    Hey, I would love to take this up. Can you explain this issue a bit more? I am new to this stuff.
    Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions