lustre-devel-lustre.org archive mirror
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: lustre-devel@lists.lustre.org
Subject: [lustre-devel] [PATCH 02/20] lnet: test against LNET_STATE_RUNNING rather than LNET_STATE_SHUTDOWN
Date: Sat, 13 Jun 2020 12:26:58 -0400	[thread overview]
Message-ID: <1592065636-28333-3-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1592065636-28333-1-git-send-email-jsimmons@infradead.org>

From: NeilBrown <neilb@suse.de>

The difference between LNET_STATE_STOPPING and LNET_STATE_SHUTDOWN
is of little interest.  As soon as the state isn't
LNET_STATE_RUNNING, various API calls should refuse
to act.

So change tests for SHUTDOWN to instead compare against
RUNNING.

Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: NeilBrown <neilb@suse.de>
---
 net/lnet/lnet/api-ni.c | 2 +-
 net/lnet/lnet/peer.c   | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/lnet/lnet/api-ni.c b/net/lnet/lnet/api-ni.c
index 62b4fa7..7c91800 100644
--- a/net/lnet/lnet/api-ni.c
+++ b/net/lnet/lnet/api-ni.c
@@ -309,7 +309,7 @@ static int lnet_discover(struct lnet_process_id id, u32 force,
 	 * changing the value dynamically, we want to set it after
 	 * updating the peers
 	 */
-	if (the_lnet.ln_state == LNET_STATE_SHUTDOWN) {
+	if (the_lnet.ln_state != LNET_STATE_RUNNING) {
 		*discovery_off = value;
 		mutex_unlock(&the_lnet.ln_api_mutex);
 		return 0;
diff --git a/net/lnet/lnet/peer.c b/net/lnet/lnet/peer.c
index 5869a20..f745394 100644
--- a/net/lnet/lnet/peer.c
+++ b/net/lnet/lnet/peer.c
@@ -810,7 +810,7 @@ struct lnet_peer_ni *
 	int rc;
 
 	rc = -ESHUTDOWN;
-	if (the_lnet.ln_state == LNET_STATE_SHUTDOWN)
+	if (the_lnet.ln_state != LNET_STATE_RUNNING)
 		goto done;
 
 	lncpt = cfs_percpt_number(the_lnet.ln_peer_tables);
@@ -1805,7 +1805,7 @@ struct lnet_peer_ni *
 	lnet_net_lock(cpt);
 
 	/* Lock has been dropped, check again for shutdown. */
-	if (the_lnet.ln_state == LNET_STATE_SHUTDOWN) {
+	if (the_lnet.ln_state != LNET_STATE_RUNNING) {
 		if (!IS_ERR(lpni))
 			lnet_peer_ni_decref_locked(lpni);
 		lpni = ERR_PTR(-ESHUTDOWN);
@@ -2816,7 +2816,7 @@ static int lnet_peer_data_present(struct lnet_peer *lp)
 	 * LNET_LOCK_EX mode is used.
 	 */
 	mutex_lock(&the_lnet.ln_api_mutex);
-	if (the_lnet.ln_state == LNET_STATE_SHUTDOWN) {
+	if (the_lnet.ln_state != LNET_STATE_RUNNING) {
 		rc = -ESHUTDOWN;
 		goto out;
 	}
-- 
1.8.3.1

  parent reply	other threads:[~2020-06-13 16:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-13 16:26 [lustre-devel] [PATCH 00/20] lustre: patches landed for week of June 8 2020 James Simmons
2020-06-13 16:26 ` [lustre-devel] [PATCH 01/20] lnet: fix kmalloc size in config.c James Simmons
2020-06-13 16:26 ` James Simmons [this message]
2020-06-13 16:26 ` [lustre-devel] [PATCH 03/20] lnet: use lnet_md_free in lnet_res_container_cleanup() James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 04/20] lustre: obdclass: discard process_quota_config James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 05/20] lnet: socklnd: remove comments about "darwin" James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 06/20] lustre: uapi: change LUSTRE_*_FL defines to enum James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 07/20] lustre: SEL: Add flag & setstripe support James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 08/20] lustre: lmv: check stripe FID sanity James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 09/20] lustre: ptlrpc: Clear bd_registered in ptlrpc_unregister_bulk James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 10/20] lustre: dne: directory restripe and auto split James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 11/20] lustre: sec: documentation for client-side encryption James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 12/20] lustre: sec: enable client side encryption James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 13/20] lustre: ptlrpc: separate number MD and refrences for bulk James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 14/20] lustre: ptlrpc: fill md correctly James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 15/20] lustre: llite: don't check mirror info for page discard James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 16/20] lustre: sec: control client side encryption James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 17/20] lnet: fix uninitialize var in choose_ipv4_src() James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 18/20] lustre: obd: Rename OS_STATE flags to OS_STATFS James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 19/20] lustre: mdc: allow setting max_mod_rpcs_in_flight larger James Simmons
2020-06-13 16:27 ` [lustre-devel] [PATCH 20/20] lnet: o2iblnd: 'Timed out tx' error message James Simmons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1592065636-28333-3-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=lustre-devel@lists.lustre.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).