Replace mnt-rs with libmount#1007
Conversation
|
Rebased |
| Ok(mount) => { | ||
| if mount.contains(&MountParam::Spec(search)) { | ||
| return Ok(Some(mount.file)); | ||
| if mount.mount_source == *search { |
There was a problem hiding this comment.
Yeah, I think we just want to use maj/min for comparison here, is all. Something like:
let major = self.thin_dev.device().major as u64;
let minor = self.thin_dev.device().minor as u64;
if mount.major == major && mount.minor == minor {
584b6d4 to
060326b
Compare
|
Why 060326b? Aren't mount.major and .minor already u64? |
|
Fixes #820 |
|
ok thanks. One of THOSE situations. 👍 once Clippy is made happy. |
mulkieran
left a comment
There was a problem hiding this comment.
I'ld like an explanation in the PR message as to why this approach works and the previous didn't.
|
I already read #695. It didn't give me any idea of why this fixes the problem. |
|
@mulkieran @agrover Please see updated PR message. Hopefully this clears things up. |
|
A 21 comment bz from 2009 in which the last entry is a promise to fix this once and for all in util-linux couldn't really be said to clear anything up :( But I guess it's a starting point for further research if necessary. |
|
I expect there will be some more minor clippy errors, but once those are fixed, I'm fine w/ it. |
|
Except that you might as well close this and start a new PR that squashes the commits that should be squashed, like the clippy fixes. |
Signed-off-by: Tony Asleson <tasleson@redhat.com>
Addresses: stratis-storage#695 Signed-off-by: Tony Asleson <tasleson@redhat.com>
|
Passing all checks, I squashed, should be able to merge when CI is done |
The library
mnt-rsutilzes/proc/mountswhich contains inaccurate information and caused issue #695. After doing some research, it appears that/proc/self/mountinfois the correct place to look for mount information, ref. https://bugzilla.redhat.com/show_bug.cgi?id=491924 . @agrover did a PR to utilize/proc/self/mountinfotomnt-rsref. stemjail/mnt-rs#4 , but that PR has stalled. Thus the decision was made to utilizelibmountinstead as it does utilize/proc/self/mountinfo.