Whamcloud - gitweb
LU-2111 echo_cleint: Wrong error code returns for MDS echo
authorJames Simmons <uja.ornl@gmail.com>
Mon, 8 Oct 2012 18:45:39 +0000 (14:45 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 11 Oct 2012 15:14:52 +0000 (11:14 -0400)
If MD echo client fails to resolve a path a error is
returned by PTR_ERR but the rc variable is never updated
with this value to return back thus the application
thinks it worked. This patch properly sets the returned
rc variable to let the application testing know a failure
has occured.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: If7d2e9fbb28bcb239f7cc5021efebdcf0784ea14
Reviewed-on: http://review.whamcloud.com/4225
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Liang Zhen <liang@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdecho/echo_client.c

index f1901d8..b33ad4b 100644 (file)
@@ -2136,7 +2136,7 @@ static int echo_md_handler(struct echo_device *ed, int command,
         if (IS_ERR(parent)) {
                 CERROR("Can not resolve the path %s: rc = %ld\n", path,
                         PTR_ERR(parent));
         if (IS_ERR(parent)) {
                 CERROR("Can not resolve the path %s: rc = %ld\n", path,
                         PTR_ERR(parent));
-               GOTO(out_free, PTR_ERR(parent));
+               GOTO(out_free, rc = PTR_ERR(parent));
         }
 
         if (namelen > 0) {
         }
 
         if (namelen > 0) {