Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1510720

[PATCH 24/29] staging: lustre: ptlrpc: Forbid too early NRS policy tunings

From James Simmons <jsimmons@infradead.org>
Newsgroups linux.kernel
Subject [PATCH 24/29] staging: lustre: ptlrpc: Forbid too early NRS policy tunings
Date 2016-10-28 00:20 +0200
Message-ID <sx1bJ-7Qv-65@gated-at.bofh.it> (permalink)
References <sx1bH-7Qv-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Henri Doreau <henri.doreau@cea.fr>

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>
---
 drivers/staging/lustre/lustre/ptlrpc/nrs.c |    9 +++++++++
 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 d88faf6..f856632 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
-- 
1.7.1

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 24/29] staging: lustre: ptlrpc: Forbid too early NRS policy tunings James Simmons <jsimmons@infradead.org> - 2016-10-28 00:20 +0200

csiph-web