浏览代码

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 <hubcap@omnibond.com>
Mike Marshall 7 年之前
父节点
当前提交
cf546ab6b1
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      fs/orangefs/orangefs-utils.c

+ 1 - 0
fs/orangefs/orangefs-utils.c

@@ -537,6 +537,7 @@ int orangefs_normalize_to_errno(__s32 error_code)
 	 */
 	 */
 	} else {
 	} else {
 		gossip_err("orangefs: orangefs_normalize_to_errno: got error code which is not from ORANGEFS.\n");
 		gossip_err("orangefs: orangefs_normalize_to_errno: got error code which is not from ORANGEFS.\n");
+		error_code = -EINVAL;
 	}
 	}
 	return error_code;
 	return error_code;
 }
 }