*/
#define flag2seqstr(flag) \
do { \
- if (imp->imp_##flag) \
+ if (imp->imp_##flag) { \
seq_printf(m, "%s" #flag, first ? "" : ", "); \
+ first = false; \
+ } \
} while (0)
-static int obd_import_flags2seqstr(struct obd_import *imp, struct seq_file *m)
+static void obd_import_flags2seqstr(struct obd_import *imp, struct seq_file *m)
{
bool first = true;
flag2seqstr(invalid);
flag2seqstr(deactive);
flag2seqstr(replayable);
+ flag2seqstr(delayed_recovery);
+ flag2seqstr(no_lock_replay);
+ flag2seqstr(vbr_failed);
flag2seqstr(pingable);
- return 0;
+ flag2seqstr(resend_replay);
+ flag2seqstr(no_pinger_recover);
+ flag2seqstr(need_mne_swab);
+ flag2seqstr(connect_tried);
}
-#undef flags2seqstr
+#undef flag2seqstr
static const char *obd_connect_names[] = {
"read_only",
}
}
if (flags & ~(mask - 1))
- seq_printf(m, "%sunknown flags "LPX64,
+ seq_printf(m, "%sunknown_"LPX64,
first ? "" : sep, flags & ~(mask - 1));
}
}
if (flags & ~(mask - 1))
ret += snprintf(page + ret, count - ret,
- "%sunknown flags "LPX64,
+ "%sunknown_"LPX64,
ret ? sep : "", flags & ~(mask - 1));
return ret;
}
" name: %s\n"
" target: %s\n"
" state: %s\n"
- " connect_flags: [",
+ " connect_flags: [ ",
obd->obd_name,
obd2cli_tgt(obd),
ptlrpc_import_state_name(imp->imp_state));
obd_connect_seq_flags2str(m, imp->imp_connect_data.ocd_connect_flags,
", ");
- seq_printf(m, "]\n");
+ seq_printf(m, " ]\n");
obd_connect_data_seqprint(m, ocd);
- seq_printf(m, " import_flags: [");
+ seq_printf(m, " import_flags: [ ");
obd_import_flags2seqstr(imp, m);
- seq_printf(m, "]\n"
+ seq_printf(m, " ]\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) {
libcfs_nid2str(conn->oic_conn->c_peer.nid));
j++;
}
- seq_printf(m, "]\n"
+ seq_printf(m, " ]\n"
" current_connection: %s\n"
" connection_attempts: %u\n"
" generation: %u\n"
&imp->imp_state_hist[(k + j) % IMP_STATE_HIST_LEN];
if (ish->ish_state == 0)
continue;
- seq_printf(m, " - ["CFS_TIME_T", %s]\n",
+ seq_printf(m, " - [ "CFS_TIME_T", %s ]\n",
ish->ish_time,
ptlrpc_import_state_name(ish->ish_state));
}
NEW=$(echo $OSTNID | sed "s/$ORIGVAL/$NEWVAL@/")
echo "Using fake nid $NEW"
- TEST="$LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids | sed -n 's/.*\($NEW\).*/\1/p'"
+ TEST="$LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import |
+ grep failover_nids | sed -n 's/.*\($NEW\).*/\1/p'"
set_conf_param_and_check client "$TEST" \
"$FSNAME-OST0000.failover.node" $NEW ||
error "didn't add failover nid $NEW"
- NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids)
+ NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import |
+ grep failover_nids)
echo $NIDS
- NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 1))
+ # The NIDS value is the failover nid strings and "[" and "]". So
+ # we need to subtract the space taken by the delimiters. This has
+ # changed from earlier version of Lustre but this test is run only
+ # locally so this change will not break interop. See LU-3386
+ NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 3))
echo "should have 2 failover nids: $NIDCOUNT"
[ $NIDCOUNT -eq 2 ] || error "Failover nid not added"
- do_facet mgs "$LCTL conf_param -d $FSNAME-OST0000.failover.node" || error "conf_param delete failed"
+ do_facet mgs "$LCTL conf_param -d $FSNAME-OST0000.failover.node" ||
+ error "conf_param delete failed"
umount_client $MOUNT
mount_client $MOUNT || return 3
- NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids)
+ NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import |
+ grep failover_nids)
echo $NIDS
- NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 1))
+ NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 3))
echo "only 1 final nid should remain: $NIDCOUNT"
[ $NIDCOUNT -eq 1 ] || error "Failover nids not removed"
# let the client reconnect
client_reconnect
- EVICT=$(do_facet client $LCTL get_param mdc.$FSNAME-MDT*.state | \
- awk -F"[ [,]" '/EVICTED]$/ { if (mx<$4) {mx=$4;} } END { print mx }')
+ EVICT=$(do_facet client $LCTL get_param mdc.$FSNAME-MDT*.state |
+ awk -F"[ [,]" '/EVICTED ]$/ \
+ { if (mx<$5) {mx=$5;} } END { print mx }')
[ ! -z "$EVICT" ] && [[ $EVICT -gt $BEFORE ]] ||
(do_facet client $LCTL get_param mdc.$FSNAME-MDT*.state;
# let the client reconnect
client_reconnect
- EVICT=$(do_facet client $LCTL get_param osc.$FSNAME-OST*.state | \
- awk -F"[ [,]" '/EVICTED]$/ { if (mx<$4) {mx=$4;} } END { print mx }')
+ EVICT=$(do_facet client $LCTL get_param osc.$FSNAME-OST*.state |
+ awk -F"[ [,]" '/EVICTED ]$/ \
+ { if (mx < $5) {mx = $5;} } END { print mx }')
[ ! -z "$EVICT" ] && [[ $EVICT -gt $BEFORE ]] ||
(do_facet client $LCTL get_param osc.$FSNAME-OST*.state;