Skip to content

Commit 48ee069

Browse files
committed
Auto merge of #123928 - tbu-:pr_statx_enosys, r=<try>
`statx` probe: `ENOSYS` might come from a faulty FUSE driver Do the availability check regardless of the error returned from `statx`. CC #122079 (comment)
2 parents 29b1207 + 2325b81 commit 48ee069

File tree

1 file changed

+5
-8
lines changed
  • library/std/src/sys/pal/unix

1 file changed

+5
-8
lines changed

library/std/src/sys/pal/unix/fs.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -198,20 +198,17 @@ cfg_has_statx! {{
198198
return Some(Err(err));
199199
}
200200

201-
// Availability not checked yet.
201+
// `ENOSYS` might come from a faulty FUSE driver.
202202
//
203-
// First try the cheap way.
204-
if err.raw_os_error() == Some(libc::ENOSYS) {
205-
STATX_SAVED_STATE.store(STATX_STATE::Unavailable as u8, Ordering::Relaxed);
206-
return None;
207-
}
208-
209-
// Error other than `ENOSYS` is not a good enough indicator -- it is
203+
// Other errors are not a good enough indicator either -- it is
210204
// known that `EPERM` can be returned as a result of using seccomp to
211205
// block the syscall.
206+
//
212207
// Availability is checked by performing a call which expects `EFAULT`
213208
// if the syscall is usable.
209+
//
214210
// See: https://github.com/rust-lang/rust/issues/65662
211+
//
215212
// FIXME this can probably just do the call if `EPERM` was received, but
216213
// previous iteration of the code checked it for all errors and for now
217214
// this is retained.

0 commit comments

Comments
 (0)