Commit 4e724acc authored by Henri Doreau's avatar Henri Doreau Committed by Greg Kroah-Hartman

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: default avatarHenri Doreau <henri.doreau@cea.fr>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6673
Reviewed-on: http://review.whamcloud.com/15104Reviewed-by: default avatarEmoly Liu <emoly.liu@intel.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d8389249
...@@ -619,6 +619,15 @@ static int nrs_policy_ctl(struct ptlrpc_nrs *nrs, char *name, ...@@ -619,6 +619,15 @@ static int nrs_policy_ctl(struct ptlrpc_nrs *nrs, char *name,
goto out; 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) { switch (opc) {
/** /**
* Unknown opcode, pass it down to the policy-specific control * Unknown opcode, pass it down to the policy-specific control
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment