staging: lustre: ptlrpc: Forbid too early NRS policy tunings

Wait for a NRS policy to be fully started before allowing
to apply related tunings, so that all fields are properly
initialized.

Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6673
Reviewed-on: http://review.whamcloud.com/15104
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Henri Doreau 2016-10-27 18:11:58 -04:00 committed by Greg Kroah-Hartman
parent d8389249f1
commit 4e724acca3
1 changed files with 9 additions and 0 deletions

View File

@ -619,6 +619,15 @@ static int nrs_policy_ctl(struct ptlrpc_nrs *nrs, char *name,
goto out;
}
/**
* Wait for the policy to be fully started before attempting
* to operate it.
*/
if (policy->pol_state == NRS_POL_STATE_STARTING) {
rc = -EAGAIN;
goto out;
}
switch (opc) {
/**
* Unknown opcode, pass it down to the policy-specific control