Skip to content
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

Error Handling Code Paths #238

Open
dthain opened this issue Jan 18, 2019 · 0 comments
Open

Error Handling Code Paths #238

dthain opened this issue Jan 18, 2019 · 0 comments
Assignees

Comments

@dthain
Copy link
Owner

dthain commented Jan 18, 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 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_mkdir fs_traverse and so forth. This requires fixing both the generic filesystem interface as well as the underlying filesystem drivers.

@dthain dthain changed the title Error Handling Paths Error Handling Code Paths Jan 22, 2019
@dsmith47 dsmith47 self-assigned this Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants