coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

df: detect over-mounted device

Open ctsk opened this issue 2 years ago • 7 comments

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

ctsk avatar Feb 01 '23 12:02 ctsk

what are the two binaries? (they are quite big btw)

Would it be possible to write a test for this?

sylvestre avatar Feb 01 '23 12:02 sylvestre

Yup, shouldn't have pushed those blobs.

RE: tests - Isn't it sufficient that a GNU test covers this?

ctsk avatar Feb 01 '23 12:02 ctsk

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 :)

sylvestre avatar Feb 01 '23 14:02 sylvestre

GNU testsuite comparison:

GNU test failed: tests/misc/timeout. tests/misc/timeout is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Feb 01 '23 17:02 github-actions[bot]

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?

github-actions[bot] avatar Feb 02 '23 17:02 github-actions[bot]

Looks good to me, but under the Run GNU root tests job, we still have a FAIL: 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 :)

ctsk avatar Feb 07 '23 10:02 ctsk

This should fix the spell checks, I believe that's all that's left to do?

ctsk avatar Mar 01 '23 12:03 ctsk

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.

sylvestre avatar Mar 01 '23 17:03 sylvestre

@ctsk ping?

sylvestre avatar Mar 14 '23 07:03 sylvestre

@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,

ctsk avatar Mar 14 '23 09:03 ctsk