-
Notifications
You must be signed in to change notification settings - Fork 13.3k
statx
probe: ENOSYS
might come from a faulty FUSE driver
#123928
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,20 +193,17 @@ cfg_has_statx! {{ | |
return Some(Err(err)); | ||
} | ||
|
||
// Availability not checked yet. | ||
// `ENOSYS` might come from a faulty FUSE driver. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment only makes sense in light of the immediately previous version. Please explain it as if the reader has encountered the first time. So: Why are you starting off by mentioning ENOSYS here? Instead say something like "Syscalls can return errors from things other than the kernel per se, like a filesystem driver, so we can't assume this is relevant for all files." |
||
// | ||
// First try the cheap way. | ||
if err.raw_os_error() == Some(libc::ENOSYS) { | ||
STATX_SAVED_STATE.store(STATX_STATE::Unavailable as u8, Ordering::Relaxed); | ||
return None; | ||
} | ||
|
||
// Error other than `ENOSYS` is not a good enough indicator -- it is | ||
// Other errors are not a good enough indicator either -- it is | ||
// known that `EPERM` can be returned as a result of using seccomp to | ||
// block the syscall. | ||
// | ||
// Availability is checked by performing a call which expects `EFAULT` | ||
// if the syscall is usable. | ||
// | ||
// See: https://github.com/rust-lang/rust/issues/65662 | ||
// | ||
// FIXME this can probably just do the call if `EPERM` was received, but | ||
// previous iteration of the code checked it for all errors and for now | ||
// this is retained. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This initial line is still relevant. Please restore it.