Skip to content

Commit

Permalink
Orangefs: don't propogate whacky error codes
Browse files Browse the repository at this point in the history
When we get an error return code from userspace (the client-core)
we check to make sure it is a valid code.

This patch maps the whacky return code to -EINVAL instead of
propagating garbage back up the call chain potentially resulting
in a hard-to-find train-wreck.

The client-core doesn't have any business returning whacky return
codes, but if it does, we don't want the kernel to crash as a result.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
  • Loading branch information
hubcapsc committed Feb 6, 2018
1 parent 6bdfb48 commit cf546ab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/orangefs/orangefs-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ int orangefs_normalize_to_errno(__s32 error_code)
*/
} else {
gossip_err("orangefs: orangefs_normalize_to_errno: got error code which is not from ORANGEFS.\n");
error_code = -EINVAL;
}
return error_code;
}
Expand Down

0 comments on commit cf546ab

Please sign in to comment.