X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lnet%2Fselftest%2Fconctl.c;h=9c2f39f90f5e542753f31d298df6eff0eb4f04ad;hb=ad173173fe6b67e41c2c232a15c5eb6939836871;hp=6e11275ad2fcca84b7c54dd5ad53b2af82fde098;hpb=e3a7c58aebafce40323db54bf6056029e5af4a70;p=fs%2Flustre-release.git diff --git a/lnet/selftest/conctl.c b/lnet/selftest/conctl.c index 6e11275..9c2f39f 100644 --- a/lnet/selftest/conctl.c +++ b/lnet/selftest/conctl.c @@ -70,15 +70,15 @@ lst_session_new_ioctl(lstio_session_new_args_t *args) name[args->lstio_ses_nmlen] = 0; - rc = lstcon_session_new(name, - args->lstio_ses_key, - args->lstio_ses_timeout, - args->lstio_ses_force, - args->lstio_ses_idp); - - LIBCFS_FREE(name, args->lstio_ses_nmlen + 1); - - return rc; + rc = lstcon_session_new(name, + args->lstio_ses_key, + args->lstio_ses_feats, + args->lstio_ses_force, + args->lstio_ses_timeout, + args->lstio_ses_idp); + + LIBCFS_FREE(name, args->lstio_ses_nmlen + 1); + return rc; } int @@ -97,6 +97,7 @@ lst_session_info_ioctl(lstio_session_info_args_t *args) if (args->lstio_ses_idp == NULL || /* address for ouput sid */ args->lstio_ses_keyp == NULL || /* address for ouput key */ + args->lstio_ses_featp == NULL || /* address for ouput features */ args->lstio_ses_ndinfo == NULL || /* address for output ndinfo */ args->lstio_ses_namep == NULL || /* address for ouput name */ args->lstio_ses_nmlen <= 0 || @@ -105,6 +106,7 @@ lst_session_info_ioctl(lstio_session_info_args_t *args) return lstcon_session_info(args->lstio_ses_idp, args->lstio_ses_keyp, + args->lstio_ses_featp, args->lstio_ses_ndinfo, args->lstio_ses_namep, args->lstio_ses_nmlen); @@ -320,6 +322,7 @@ lst_group_update_ioctl(lstio_group_update_args_t *args) int lst_nodes_add_ioctl(lstio_group_nodes_args_t *args) { + unsigned feats; int rc; char *name; @@ -329,8 +332,9 @@ lst_nodes_add_ioctl(lstio_group_nodes_args_t *args) if (args->lstio_grp_idsp == NULL || /* array of ids */ args->lstio_grp_count <= 0 || args->lstio_grp_resultp == NULL || - args->lstio_grp_namep == NULL || - args->lstio_grp_nmlen <= 0 || + args->lstio_grp_featp == NULL || + args->lstio_grp_namep == NULL || + args->lstio_grp_nmlen <= 0 || args->lstio_grp_nmlen > LST_NAME_SIZE) return -EINVAL; @@ -348,10 +352,14 @@ lst_nodes_add_ioctl(lstio_group_nodes_args_t *args) name[args->lstio_grp_nmlen] = 0; rc = lstcon_nodes_add(name, args->lstio_grp_count, - args->lstio_grp_idsp, - args->lstio_grp_resultp); + args->lstio_grp_idsp, &feats, + args->lstio_grp_resultp); - LIBCFS_FREE(name, args->lstio_grp_nmlen + 1); + LIBCFS_FREE(name, args->lstio_grp_nmlen + 1); + if (rc == 0 && + cfs_copy_to_user(args->lstio_grp_featp, &feats, sizeof(feats))) { + return -EINVAL; + } return rc; } @@ -734,6 +742,12 @@ int lst_test_add_ioctl(lstio_test_args_t *args) args->lstio_tes_dgrp_nmlen > LST_NAME_SIZE) return -EINVAL; + if (args->lstio_tes_loop == 0 || /* negative is infinite */ + args->lstio_tes_concur <= 0 || + args->lstio_tes_dist <= 0 || + args->lstio_tes_span <= 0) + return -EINVAL; + /* have parameter, check if parameter length is valid */ if (args->lstio_tes_param != NULL && (args->lstio_tes_param_len <= 0 || @@ -749,7 +763,7 @@ int lst_test_add_ioctl(lstio_test_args_t *args) goto out; LIBCFS_ALLOC(dstgrp, args->lstio_tes_dgrp_nmlen + 1); - if (srcgrp == NULL) + if (dstgrp == NULL) goto out; if (args->lstio_tes_param != NULL) {