Open cyphar opened 1 month ago
ESERVERFAULT
(errno 526, a kernel-internal errno from the NFSv3 protocol) semantically makes sense (the error description is An untranslatable error occurred
) and is an errno userspace should never see returned from the kernel so we're safe remapping errors to it without causing confusion.
We can also switch away from using Mutex<HashMap<...>>
to one of these lockless alternatives:
insert
/remove
(which is our usecase!) so sharded-slab
is probably better.
While the new API makes error management much nicer, some users might just want to get raw errnos.
We can very easily switch to returning raw errnos from a type perspective, but it's a little unclear what we should do for errors that don't have an underlying errno. We can just copy the kernel and just use
-EINVAL
:sweat_smile:, or we could use an errno that the kernel rarely returns like-ENOANO
, never returns like-ENOPARAM
, or a large negative number that doesn't map to any errno (INT_MIN
if we want to be safe, I guess?).This requires us getting a nice config API first (#21).
(Suggested by @brauner.)