Skip to contentSkip to conversation

Few misc Lustre fixes

PATCH New [email protected] 1 participant 6 messages Feb 10, 2016 Staging

lore
Share & tools
lore
#0 lore raw

cover Few misc Lustre fixes

From: Oleg Drokin <[email protected]>

This patchset fixes some minor Lustre problems and also updates the internal version.

Please consider.

Oleg Drokin (5):
staging/lustre/obdecho: Remove always true condition staging/lustre/obdecho: Better handle invalid create requests staging/lustre: Adjust import state history output format staging/lustre: Update internal client version. staging/lustre: Remove unused LUSTRE_VERSION_ALLOWED_OFFSET define

 drivers/staging/lustre/lustre/include/lustre_ver.h     | 18 ++++++------------
 .../staging/lustre/lustre/obdclass/lprocfs_status.c    | 14 +++++++-------
 drivers/staging/lustre/lustre/obdecho/echo_client.c    | 15 +++++----------
 3 files changed, 18 insertions(+), 29 deletions(-)
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/5 staging/lustre/obdecho: Remove always true condition

From: Oleg Drokin <[email protected]>

Dan Carpenter noticed that since we already checked for (oa->o_valid & OBD_MD_FLID) == 0, that means (oa->o_valid & OBD_MD_FLID) is always true after that so no point in checking for it.

---
 drivers/staging/lustre/lustre/obdecho/echo_client.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/lustre/lustre/obdecho/echo_client.c +2 -4
index d3e398f..e1c9d11 100644
@@ -1222,10 +1222,8 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
 	}
 
 	/* setup object ID here */
-	if (oa->o_valid & OBD_MD_FLID) {
-		LASSERT(oa->o_valid & OBD_MD_FLGROUP);
-		lsm->lsm_oi = oa->o_oi;
-	}
+	LASSERT(oa->o_valid & OBD_MD_FLGROUP);
+	lsm->lsm_oi = oa->o_oi;
 
 	if (ostid_id(&lsm->lsm_oi) == 0)
 		ostid_set_id(&lsm->lsm_oi, ++last_object_id);
Signature · 1 line
2.1.0
#2 lore raw

PATCH 2/5 staging/lustre/obdecho: Better handle invalid create requests

In reply to [email protected]

From: Oleg Drokin <[email protected]>

When gettng an invalid create request in echo code (wrong group, or no group at all), just return an error instead of crashing.

---
 drivers/staging/lustre/lustre/obdecho/echo_client.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/staging/lustre/lustre/obdecho/echo_client.c +4 -7
index e1c9d11..4ca82af 100644
@@ -1210,8 +1210,10 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
 	int		     rc;
 	int		     created = 0;
 
-	if ((oa->o_valid & OBD_MD_FLID) == 0) { /* no obj id */
-		CERROR("No valid oid\n");
+	if (!(oa->o_valid & OBD_MD_FLID) ||
+	    !(oa->o_valid & OBD_MD_FLGROUP) ||
+	    !fid_seq_is_echo(ostid_seq(&oa->o_oi))) {
+		CERROR("invalid oid " DOSTID "\n", POSTID(&oa->o_oi));
 		return -EINVAL;
 	}
 
@@ -1222,16 +1224,11 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
 	}
 
 	/* setup object ID here */
-	LASSERT(oa->o_valid & OBD_MD_FLGROUP);
 	lsm->lsm_oi = oa->o_oi;
 
 	if (ostid_id(&lsm->lsm_oi) == 0)
 		ostid_set_id(&lsm->lsm_oi, ++last_object_id);
 
-	/* Only echo objects are allowed to be created */
-	LASSERT((oa->o_valid & OBD_MD_FLGROUP) &&
-		(ostid_seq(&oa->o_oi) == FID_SEQ_ECHO));
-
 	rc = obd_create(env, ec->ec_exp, oa, &lsm, oti);
 	if (rc != 0) {
 		CERROR("Cannot create objects: rc = %d\n", rc);
Signature · 1 line
2.1.0
#3 lore raw

PATCH 3/5 staging/lustre: Adjust import state history output format

In reply to [email protected]

From: Oleg Drokin <[email protected]>

New test scripts expect spaces around state names and square brackets when parsing debugfs output, so add them to avoid false failures.

---
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +7 -7
index 9a1434d..eda44d8 100644
@@ -642,21 +642,21 @@ int lprocfs_rd_import(struct seq_file *m, void *data)
 		     "    target: %s\n"
 		     "    state: %s\n"
 		     "    instance: %u\n"
-		     "    connect_flags: [",
+		     "    connect_flags: [ ",
 		     obd->obd_name,
 		     obd2cli_tgt(obd),
 		     ptlrpc_import_state_name(imp->imp_state),
 		     imp->imp_connect_data.ocd_instance);
 	obd_connect_seq_flags2str(m, imp->imp_connect_data.ocd_connect_flags, ", ");
 	seq_printf(m,
-		      "]\n"
-		      "    import_flags: [");
+		      " ]\n"
+		      "    import_flags: [ ");
 	obd_import_flags2str(imp, m);
 
 	seq_printf(m,
-		      "]\n"
+		      " ]\n"
 		      "    connection:\n"
-		      "       failover_nids: [");
+		      "       failover_nids: [ ");
 	spin_lock(&imp->imp_lock);
 	j = 0;
 	list_for_each_entry(conn, &imp->imp_conn_list, oic_item) {
@@ -671,7 +671,7 @@ int lprocfs_rd_import(struct seq_file *m, void *data)
 	else
 		strncpy(nidstr, "<none>", sizeof(nidstr));
 	seq_printf(m,
-		      "]\n"
+		      " ]\n"
 		      "       current_connection: %s\n"
 		      "       connection_attempts: %u\n"
 		      "       generation: %u\n"
@@ -795,7 +795,7 @@ int lprocfs_rd_state(struct seq_file *m, void *data)
 			&imp->imp_state_hist[(k + j) % IMP_STATE_HIST_LEN];
 		if (ish->ish_state == 0)
 			continue;
-		seq_printf(m, " - [%lld, %s]\n", (s64)ish->ish_time,
+		seq_printf(m, " - [ %lld, %s ]\n", (s64)ish->ish_time,
 			   ptlrpc_import_state_name(ish->ish_state));
 	}
 
Signature · 1 line
2.1.0
#4 lore raw

PATCH 4/5 staging/lustre: Update internal client version.

In reply to [email protected]

From: Oleg Drokin <[email protected]>

While initial code drop was corresponding to 2.3.64, lots of different changes went in since then, and also quite a bunch of fixes, but almost none of the new features.
Code-wise we are almost at 2.5.0, so let's call it 2.4.60 - this is a version that was never reached in the actual pre-2.5 development, so it should be a clear distinction of where we are now.

---
 drivers/staging/lustre/lustre/include/lustre_ver.h | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/staging/lustre/lustre/include/lustre_ver.h +3 -6
index caa4da1..01205b8 100644
@@ -1,14 +1,11 @@
 #ifndef _LUSTRE_VER_H_
 #define _LUSTRE_VER_H_
-/* This file automatically generated from lustre/include/lustre_ver.h.in,
- * based on parameters in lustre/autoconf/lustre-version.ac.
- * Changes made directly to this file will be lost. */
 
 #define LUSTRE_MAJOR 2
-#define LUSTRE_MINOR 3
-#define LUSTRE_PATCH 64
+#define LUSTRE_MINOR 4
+#define LUSTRE_PATCH 60
 #define LUSTRE_FIX 0
-#define LUSTRE_VERSION_STRING "2.3.64"
+#define LUSTRE_VERSION_STRING "2.4.60"
 
 #define LUSTRE_VERSION_CODE OBD_OCD_VERSION(LUSTRE_MAJOR, \
 					    LUSTRE_MINOR, LUSTRE_PATCH, \
Signature · 1 line
2.1.0
#5 lore raw

PATCH 5/5 staging/lustre: Remove unused LUSTRE_VERSION_ALLOWED_OFFSET define

In reply to [email protected]

From: Oleg Drokin <[email protected]>

LUSTRE_VERSION_ALLOWED_OFFSET is only used on the server to disallow connection of old userspace clients.

---
 drivers/staging/lustre/lustre/include/lustre_ver.h | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/staging/lustre/lustre/include/lustre_ver.h +3 -6
index 01205b8..64559a1 100644
@@ -11,13 +11,10 @@
 					    LUSTRE_MINOR, LUSTRE_PATCH, \
 					    LUSTRE_FIX)
 
-/* liblustre clients are only allowed to connect if their LUSTRE_FIX mismatches
- * by this amount (set in lustre/autoconf/lustre-version.ac). */
-#define LUSTRE_VERSION_ALLOWED_OFFSET OBD_OCD_VERSION(0, 0, 1, 32)
-
-/* If lustre version of client and servers it connects to differs by more
+/*
+ * If lustre version of client and servers it connects to differs by more
  * than this amount, client would issue a warning.
- * (set in lustre/autoconf/lustre-version.ac) */
+ */
 #define LUSTRE_VERSION_OFFSET_WARN OBD_OCD_VERSION(0, 4, 0, 0)
 
 #endif
Signature · 1 line
2.1.0