Orangefs: don't propogate whacky error codes

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/cf546ab6b189ab8b3acb26bbc2f0af4df21f16c7
Commit:     cf546ab6b189ab8b3acb26bbc2f0af4df21f16c7
Parent:     6bdfb48dae8e1b98735bf9387557298d17510be9
Refname:    refs/heads/master
Author:     Mike Marshall <[email protected]>
AuthorDate: Thu Jan 25 14:43:28 2018 -0500
Committer:  Mike Marshall <[email protected]>
CommitDate: Tue Feb 6 16:38:12 2018 -0500

    Orangefs: don't propogate whacky error codes
    
    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 <[email protected]>
---
 fs/orangefs/orangefs-utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c
index 3098c2ee7b5f..ccddfcab7fc0 100644
--- a/fs/orangefs/orangefs-utils.c
+++ b/fs/orangefs/orangefs-utils.c
@@ -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;
 }
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.