Skip to content

Commit 65e3bdb

Browse files
committed
statx probe: ENOSYS might come from a faulty FUSE driver
Do the availability check regardless of the error returned from `statx`. CC rust-lang#122079 (comment)
1 parent a27191d commit 65e3bdb

File tree

1 file changed

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

1 file changed

+5
-8
lines changed

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

+5-8
Original file line numberDiff line numberDiff line change
@@ -193,20 +193,17 @@ cfg_has_statx! {{
193193
return Some(Err(err));
194194
}
195195

196-
// Availability not checked yet.
196+
// `ENOSYS` might come from a faulty FUSE driver.
197197
//
198-
// First try the cheap way.
199-
if err.raw_os_error() == Some(libc::ENOSYS) {
200-
STATX_SAVED_STATE.store(STATX_STATE::Unavailable as u8, Ordering::Relaxed);
201-
return None;
202-
}
203-
204-
// Error other than `ENOSYS` is not a good enough indicator -- it is
198+
// Other errors are not a good enough indicator either -- it is
205199
// known that `EPERM` can be returned as a result of using seccomp to
206200
// block the syscall.
201+
//
207202
// Availability is checked by performing a call which expects `EFAULT`
208203
// if the syscall is usable.
204+
//
209205
// See: https://github.com/rust-lang/rust/issues/65662
206+
//
210207
// FIXME this can probably just do the call if `EPERM` was received, but
211208
// previous iteration of the code checked it for all errors and for now
212209
// this is retained.

0 commit comments

Comments
 (0)