coreutils
coreutils copied to clipboard
df: detect over-mounted device
Addresses #3970 - Still needs some cleanup around the error handling. Feedback appreciated!
I added Filesystem::from_mount to ensure only valid (i.e. non-overmounted) Filesystem structs are created. I guess the next step for that would be making Filesystem::new unavailable outside of filesystem.rs
what are the two binaries? (they are quite big btw)
Would it be possible to write a test for this?
Yup, shouldn't have pushed those blobs.
RE: tests - Isn't it sufficient that a GNU test covers this?
RE: tests - Isn't it sufficient that a GNU test covers this?
nope, the GNU testsuite takes an hour to run in the CI. The Rust one just a minute or two :)
GNU testsuite comparison:
GNU test failed: tests/misc/timeout. tests/misc/timeout is passing on 'main'. Maybe you have to rebase?
GNU testsuite comparison:
GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?
Looks good to me, but under the
Run GNU root testsjob, we still have aFAIL: tests/df/over-mount-device.sh. Any idea why that might be? Were you able to run that test on a local machine or virtual machine?
There are quotes missing around the path :)
This should fix the spell checks, I believe that's all that's left to do?
not yet, needs some love on Windows:
---- test_df::test_exclude_all_types stdout ----
run: D:\a\coreutils\coreutils\target\debug\coreutils.exe df --output=fstype
run: D:\a\coreutils\coreutils\target\debug\coreutils.exe df -x NTFS
thread 'test_df::test_exclude_all_types' panicked at 'Command was expected to fail.
stdout = Filesystem 1K-blocks Used Available Use% Mounted on
\Device\HarddiskVolume1 512000 35788 0 100%
stderr = ', tests\by-util\test_df.rs:315:10
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/31f858d9a511f24fedb8ed997b28304fec809630/library\std\src\panicking.rs:579
1: core::panicking::panic_fmt
at /rustc/31f858d9a511f24fedb8ed997b28304fec809630/library\core\src\panicking.rs:64
2: tests::common::util::CmdResult::failure
at .\tests\common\util.rs:397
3: tests::common::util::UCommand::fails
at .\tests\common\util.rs:1549
4: tests::test_df::test_exclude_all_types
at .\tests\by-util\test_df.rs:313
5: tests::test_df::test_exclude_all_types::closure$0
at .\tests\by-util\test_df.rs:299
6: core::ops::function::FnOnce::call_once<tests::test_df::test_exclude_all_types::closure_env$0,tuple$<> >
at /rustc/31f858d9a511f24fedb8ed997b28304fec809630\library\core\src\ops\function.rs:250
7: core::ops::function::FnOnce::call_once
at /rustc/31f858d9a511f24fedb8ed997b28304fec809630/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@ctsk ping?
@ctsk ping?
Hey, got caught up with other matters. Might get to it later this week.
It seems like over-mounting is not a thing on windows, hopefully all that's needed is a platform check,