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

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

Open
sylvestre opened this issue Dec 28, 2024 · 1 comment
Labels

Comments

@sylvestre
Copy link
Contributor

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

@sylvestre
Copy link
Contributor Author

I started the work here: https://github.com/sylvestre/coreutils/tree/one-fs-2
but i didn't implement the walkdir/file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant