You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several points in kernel code where the internal interfaces prevent a proper passing of error codes.
For example struct dirent * fs_resolve( const *path) looks pretty, but has no way of returning a kerror to indicate why a resolve failed. As a result, the relevant syscall handlers assume a default of KERROR_NOT_FOUND which is not ideal.
To fix this, rework the following interfaces (and possibly others) to return an error code as the primary result, and fill in the new data structure via a doubly-indirect pointer.
For example, this:
struct dirent * fs_resolve( const char *path );
Should become this:
int fs_resolve( const char *path, struct dirent **d );
Similar comments apply to fs_mkdirfs_traverse and so forth. This requires fixing both the generic filesystem interface as well as the underlying filesystem drivers.
The text was updated successfully, but these errors were encountered:
dthain
changed the title
Error Handling Paths
Error Handling Code Paths
Jan 22, 2019
There are several points in kernel code where the internal interfaces prevent a proper passing of error codes.
For example
struct dirent * fs_resolve( const *path)
looks pretty, but has no way of returning a kerror to indicate why a resolve failed. As a result, the relevant syscall handlers assume a default ofKERROR_NOT_FOUND
which is not ideal.To fix this, rework the following interfaces (and possibly others) to return an error code as the primary result, and fill in the new data structure via a doubly-indirect pointer.
For example, this:
Should become this:
Similar comments apply to
fs_mkdir
fs_traverse
and so forth. This requires fixing both the generic filesystem interface as well as the underlying filesystem drivers.The text was updated successfully, but these errors were encountered: