- del obd_self_export from work_list in class_disconnect_exports (2908)
- don't LBUG if MDS recovery times out during orphan cleanup (2530)
- fix destroying of named logs (2325)
+ - overwrite old logs when running lconf --write_conf (2264)
2004-03-04 Cluster File Systems, Inc. <info@clusterfs.com>
* version 1.2.0
#define OBD_IOC_DORECORD _IOWR('f', 183, long)
#define OBD_IOC_PROCESS_CFG _IOWR('f', 184, long)
#define OBD_IOC_DUMP_LOG _IOWR('f', 185, long)
+#define OBD_IOC_CLEAR_LOG _IOWR('f', 186, long)
#define OBD_IOC_CATLOGLIST _IOWR('f', 190, long)
#define OBD_IOC_LLOG_INFO _IOWR('f', 191, long)
de = lookup_one_len(fidname, mds->mds_objects_dir, namelen);
if (de == NULL || de->d_inode == NULL) {
CERROR("destroying non-existent object "LPU64"\n", oa->o_id);
- GOTO(out, rc = IS_ERR(de) ? PTR_ERR(de) : -ENOENT);
+ GOTO(out_dput, rc = IS_ERR(de) ? PTR_ERR(de) : -ENOENT);
}
handle = fsfilt_start(obd, mds->mds_objects_dir->d_inode,
if (err && !rc)
rc = err;
out_dput:
- l_dput(de);
-out:
+ if (de != NULL)
+ l_dput(de);
up(&parent_inode->i_sem);
pop_ctxt(&saved, &obd->obd_ctxt, NULL);
RETURN(rc);
RETURN(rc);
}
+ case OBD_IOC_CLEAR_LOG: {
+ char *name = data->ioc_inlbuf1;
+ if (mds->mds_cfg_llh)
+ RETURN(-EBUSY);
+
+ push_ctxt(&saved, &obd->obd_ctxt, NULL);
+ rc = llog_create(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT),
+ &mds->mds_cfg_llh, NULL, name);
+ if (rc == 0) {
+ llog_init_handle(mds->mds_cfg_llh, LLOG_F_IS_PLAIN,
+ NULL);
+
+ rc = llog_destroy(mds->mds_cfg_llh);
+ llog_free_handle(mds->mds_cfg_llh);
+ }
+ pop_ctxt(&saved, &obd->obd_ctxt, NULL);
+
+ mds->mds_cfg_llh = NULL;
+ RETURN(rc);
+ }
+
case OBD_IOC_DORECORD: {
char *cfg_buf;
struct llog_rec_hdr rec;
return rc, out
+ def clear_log(self, dev, log):
+ """ clear an existing log """
+ cmds = """
+ device $%s
+ probe
+ clear_log %s
+ quit """ % (dev, log)
+ self.run(cmds)
+
def network(self, net, nid):
""" set mynid """
cmds = """
client = VOSC(self.db.lookup(obd_uuid), client_uuid, self.name,
self.name)
config.record = 1
+ lctl.clear_log(self.name, self.name)
lctl.record(self.name, self.name)
client.prepare()
lctl.mount_option(self.name, client.get_name(), "")
lctl.end_record()
config.cleanup = 1
+ lctl.clear_log(self.name, self.name + '-clean')
lctl.record(self.name, self.name + '-clean')
client.cleanup()
lctl.del_mount_option(self.name)
if config.record:
if not (config.record_device and config.record_log):
panic("When recording, both --record_log and --record_device must be specified.")
+ lctl.clear_log(config.record_device, config.record_log)
lctl.record(config.record_device, config.record_log)
doHost(db, node_list)
"usage: parse config-uuid-name"},
{"dump_log", jt_cfg_dump_log, 0, "print log of recorded commands for this config to kernel debug log\n"
"usage: dump_log config-uuid-name"},
+ {"clear_log", jt_cfg_clear_log, 0, "delete current config log of recorded commands\n"
+ "usage: clear_log config-name"},
/* Device operations */
{"=== device operations ==", jt_noop, 0, "device operations"},
return rc;
}
+int jt_cfg_clear_log(int argc, char **argv)
+{
+ struct obd_ioctl_data data;
+ int rc;
+
+ IOC_INIT(data);
+
+ if (argc != 2)
+ return CMD_HELP;
+
+ data.ioc_inllen1 = strlen(argv[1]) + 1;
+ data.ioc_inlbuf1 = argv[1];
+
+ IOC_PACK(argv[0], data);
+ rc = l_ioctl(OBD_DEV_ID, OBD_IOC_CLEAR_LOG, buf);
+ if (rc < 0)
+ fprintf(stderr, "OBD_IOC_CLEAR_LOG failed: %s\n",
+ strerror(errno));
+
+ return rc;
+}
+
+
int jt_cfg_endrecord(int argc, char **argv)
{
int jt_cfg_endrecord(int argc, char **argv);
int jt_cfg_parse(int argc, char **argv);
int jt_cfg_dump_log(int argc, char **argv);
+int jt_cfg_clear_log(int argc, char **argv);
int jt_llog_catlist(int argc, char **argv);
int jt_llog_info(int argc, char **argv);