Mountpoint reports non-mount point directories like /etc as mount points while it shouldn't
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 50/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- cli, operating-systems
Research direction
Start from the mountpoint command's is_mountpoint function shown in the issue and reproduce the behavior with mountpoint /etc on the affected filesystem. Compare the result with GNU util-linux and verify that ordinary directories are reported as non-mount points while actual mount points remain recognized.
Written by the indexing model from the issue text.
Description
Version of uutils util-linux is master
Uutils version:
./target/release/util-linux mountpoint /etc
/etc is a mountpoint
Version of GNU util-linux is 2.40
GNU version:
mountpoint /etc
/etc is not a mountpoint
It seems to be getting confused on BTRFS? especially in the inode check since when I checked inode was 293 for /etc on my system
#[cfg(not(windows))]
fn is_mountpoint(path: &str) -> bool {
let metadata = match fs::metadata(path) {
Ok(metadata) => metadata,
Err(_) => return false,
};
let dev = metadata.dev();
let inode = metadata.ino();
// Root inode (typically 2 in most Unix filesystems) indicates a mount point
inode == 2
|| match fs::metadata("..") {
Ok(parent_metadata) => parent_metadata.dev() != dev,
Err(_) => false,
}
}
- Dominant language
- Rust
- Stars
- 219
- Forks
- 59
- Avg merge
- 4h 8m
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uutils/util-linux
-
Implement `chrt` Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
uutils/util-linux#641 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
uutils/util-linux#638 ·
-
Implement `rename` Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
uutils/util-linux#629 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
uutils/util-linux#624 ·
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
uutils/util-linux#620 · 1 comment ·
All issues in uutils/util-linux
Similar issues
-
risk:low runtime status:in-progress type:test
Difficulty 1/5 Under an hour Newbie friendliness 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·