rc = mgc_llog_local_copy(env, mgc, ctxt, lctxt,
cld->cld_logname);
if (local_only || rc) {
- if (llog_is_empty(env, lctxt, cld->cld_logname)) {
+ if (strcmp(cld->cld_logname, PARAMS_FILENAME) != 0 &&
+ llog_is_empty(env, lctxt, cld->cld_logname)) {
LCONSOLE_ERROR_MSG(0x13a, "Failed to get MGS "
"log %s and no local copy."
"\n", cld->cld_logname);
CDEBUG(D_MGC, "Failed to get MGS log %s, using local "
"copy for now, will try to update later.\n",
cld->cld_logname);
+ rc = 0;
}
/* Now, whether we copied or not, start using the local llog.
* If we failed to copy, we'll start using whatever the old
char *ptr = strchr(logname, '-');
int len = (int)(ptr - logname);
- if (ptr == NULL || len >= sizeof(mgi->mgi_fsname)) {
+ if ((ptr == NULL && strcmp(logname, PARAMS_FILENAME) != 0) ||
+ len >= sizeof(mgi->mgi_fsname)) {
LCONSOLE_WARN("%s: non-config logname received: %s\n",
tgt_name(tsi->tsi_tgt), logname);
/* not error, this can be llog test name */
struct list_head log_list;
struct mgs_direntry *dirent, *n;
char *fsname = mti->mti_fsname;
- char *logname;
int rc = 0, len = strlen(fsname);
ENTRY;
- /* We need to set params for any future logs
- * as well.
- * FIXME Append this file to every new log.
- * Actually, we should store as params (text), not llogs,
- * or in a database. */
- rc = name_create(&logname, fsname, "-params");
- if (rc)
- RETURN(rc);
- if (mgs_log_is_empty(env, mgs, logname)) {
- struct llog_handle *llh = NULL;
-
- rc = record_start_log(env, mgs, &llh, logname);
- if (rc == 0)
- record_end_log(env, &llh);
- }
- name_destroy(&logname);
- if (rc)
- RETURN(rc);
-
/* Find all the logs in the CONFIGS directory */
rc = class_dentry_readdir(env, mgs, &log_list);
if (rc)
}
EXPORT_SYMBOL(llog_close);
+/**
+ * Helper function to get the llog size in records. It is used by MGS
+ * mostly to check that config llog exists and contains data.
+ *
+ * \param[in] env execution environment
+ * \param[in] ctxt llog context
+ * \param[in] name llog name
+ *
+ * \retval true if there are records in llog besides a header
+ * \retval false on error or llog without records
+ */
int llog_is_empty(const struct lu_env *env, struct llog_ctxt *ctxt,
char *name)
{
out_close:
llog_close(env, llh);
out:
- /* header is record 1 */
+ /* The header is record 1, the llog is still considered as empty
+ * if there is only header */
return (rc <= 1);
}
EXPORT_SYMBOL(llog_is_empty);
fi
[ $(facet_fstype $SINGLEMDS) = "zfs" ] &&
-# bug number for skipped test: LU-2778 LU-2059 LU-4444
- ALWAYS_EXCEPT="$ALWAYS_EXCEPT 57b 50h 69"
+# bug number for skipped test: LU-2778 LU-4444
+ ALWAYS_EXCEPT="$ALWAYS_EXCEPT 57b 69"
init_logging
grep " $MOUNT " /etc/mtab && \
error false "unexpected entry in mtab before mount" && return 10
- [ "$(facet_fstype ost1)" = "zfs" ] &&
- skip "LU-2059: no local config for ZFS OSTs" && return
-
local rc=0
start_ost
start_mds
run_test 19a "start/stop MDS without OSTs"
test_19b() {
- [ "$(facet_fstype ost1)" = "zfs" ] &&
- skip "LU-2059: no local config for ZFS OSTs" && return
-
start_ost || return 1
stop_ost -f || return 2
}
run_test 21a "start mds before ost, stop ost first"
test_21b() {
- [ "$(facet_fstype ost1)" = "zfs" ] &&
- skip "LU-2059: no local config for ZFS OSTs" && return
-
start_ost
start_mds
wait_osc_import_state mds ost FULL
run_test 26 "MDT startup failure cleans LOV (should return errs)"
test_27a() {
- [ "$(facet_fstype ost1)" = "zfs" ] &&
- skip "LU-2059: no local config for ZFS OSTs" && return
-
start_ost || return 1
start_mds || return 2
echo "Requeue thread should have started: "
test_50h() {
# prepare MDT/OST, make OSC inactive for OST1
[ "$OSTCOUNT" -lt "2" ] && skip_env "$OSTCOUNT < 2, skipping" && return
+
+ [ $(facet_fstype ost1) == zfs ] && import_zpool ost1
do_facet ost1 "$TUNEFS --param osc.active=0 `ostdevname 1`" ||
error "tunefs OST1 failed"
start_mds || error "Unable to start MDT"
echo "Verify Lustre filesystem is up and running"
[ -z "$(mounted_lustre_filesystems)" ] && error "Lustre is not running"
- [ "$(facet_fstype ost1)" = "zfs" ] &&
- skip "LU-2059: no local config for ZFS OSTs" && return
-
- clients_up
+ clients_up
for i in $(seq $MDSCOUNT) ; do
shutdown_facet mds$i
test_4() {
echo "Fourth Failure Mode: OST/MDS `date`"
- [ "$(facet_fstype ost1)" = "zfs" ] &&
- skip "LU-2059: no local config for ZFS OSTs" && return
-
#OST Portion
shutdown_facet ost1
test_10() {
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
- #XXX Disable the test now for LU-4409
- [ $MDSCOUNT -ge 2 ] && skip "skip for DNE due to LU-4409" && return
-
- [ "$(facet_fstype ost1)" = "zfs" ] &&
- skip "LU-2059: no local config for ZFS OSTs" && return
-
shutdown_facet mds1
reboot_facet mds1