summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenri Doreau <henri.doreau@cea.fr>2016-10-28 01:11:58 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-30 18:02:33 +0300
commit4e724acca3af1fe377c0ce283d38fb107419a96d (patch)
tree9688413b1eb65e2993b74370dff7bbe36c4b39c0
parentd8389249f1ce4fe96c465f45dee1c848d71c06bc (diff)
downloadlinux-4e724acca3af1fe377c0ce283d38fb107419a96d.tar.xz
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>
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/nrs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs.c b/drivers/staging/lustre/lustre/ptlrpc/nrs.c
index d88faf61e740..f8566324f258 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/nrs.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/nrs.c
@@ -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