Whamcloud - gitweb
LU-6025 lctl: remove bad error checking from nodemap_cmd() 91/13191/3
authorKit Westneat <kit.westneat@gmail.com>
Sat, 20 Dec 2014 00:25:31 +0000 (19:25 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 19 Jan 2015 17:50:57 +0000 (17:50 +0000)
There was some error checking that didn't really make sense in
nodemap_cmd() and was causing false errors. memcpy() doesn't have an
error condition, so there's no need to check it.

Signed-off-by: Kit Westneat <kit.westneat@gmail.com>
Change-Id: I58225f8ebb1d8dc0941534503f939b213d57c27f
Reviewed-on: http://review.whamcloud.com/13191
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/utils/obd.c

index b33a85a..87b0d5b 100644 (file)
@@ -3308,9 +3308,7 @@ static int nodemap_cmd(enum lcfg_command_type cmd, void *ret_data,
                if (rc != 0)
                        goto out;
 
-               memcpy(ret_data, data.ioc_pbuf1, data.ioc_plen1);
-               if (ret_data == NULL || sizeof(ret_data) != ret_size)
-                       rc = -errno;
+               memcpy(ret_data, data.ioc_pbuf1, min(data.ioc_plen1, ret_size));
        }
 out:
        lustre_cfg_free(lcfg);