X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Fselftest%2Fconctl.c;h=9c2f39f90f5e542753f31d298df6eff0eb4f04ad;hp=9ab124265485e45e548ba20bf043ba6ceaadc4e7;hb=e97ce7c6bfe0bd5663840f8087e573a66e8d068f;hpb=d016a086b68ca4af2dcbfefc3917b9291efd8d62 diff --git a/lnet/selftest/conctl.c b/lnet/selftest/conctl.c index 9ab1242..9c2f39f 100644 --- a/lnet/selftest/conctl.c +++ b/lnet/selftest/conctl.c @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -72,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); + 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); - return rc; + LIBCFS_FREE(name, args->lstio_ses_nmlen + 1); + return rc; } int @@ -99,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 || @@ -107,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); @@ -322,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; @@ -331,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; @@ -350,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; } @@ -736,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 || @@ -751,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) {