Another patch changed the linking flags for liblustreapi which
caused sanit-hsm 29c to fail. Debugging revealed the reason was
the extent fields in hsm_user_request sent to the kernel was
not zeroed out. For some reason the compiler flags hide this
bug. I found this is easily reproduced by removing
lhsmtool_posix_DEPENDENCIES which is not needed anyways since
the build system can calculate those dependencies for us.
Update the function llapi_hsm_user_request_alloc to zero out
the struct hsm_user_request allocated.
Change-Id: I02c1d6b5cec1ed3e89086a6a00e30ca81768409c
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/43893
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Ben Evans <beevans@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lhsmtool_posix_SOURCES = lhsmtool_posix.c pid_file.c pid_file.h
lhsmtool_posix_LDADD := liblustreapi.la $(PTHREAD_LIBS) \
$(top_builddir)/lnet/utils/lnetconfig/liblnetconfig.la
-lhsmtool_posix_DEPENDENCIES := liblustreapi.la
l_getsepol_SOURCES = l_getsepol.c
l_getsepol_LDADD := liblustreapi.la -lcrypto $(SELINUX)
len += sizeof(struct hsm_user_item) * itemcount;
len += data_len;
- return (struct hsm_user_request *)malloc(len);
+ return (struct hsm_user_request *)calloc(1, len);
}
/**