- drop filter export grants atomically with removal from device (2663)
- 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)
2004-03-04 Cluster File Systems, Inc. <info@clusterfs.com>
* version 1.2.0
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;
case OBD_IOC_LLOG_REMOVE: {
struct llog_ctxt *ctxt =
llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
+ int rc2;
obd_llog_finish(obd, mds->mds_lov_desc.ld_tgt_count);
push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
rc = llog_ioctl(ctxt, cmd, data);
pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
llog_cat_initialize(obd, mds->mds_lov_desc.ld_tgt_count);
-
+ rc2 = obd_set_info(mds->mds_osc_exp, strlen("mds_conn"), "mds_conn",
+ 0, NULL);
+ if (!rc)
+ rc = rc2;
RETURN(rc);
}
case OBD_IOC_LLOG_INFO:
RETURN(-EINVAL);
*end = '\0';
- logid->lgl_oid = simple_strtoull(start, &endp, 16);
+ logid->lgl_oid = simple_strtoull(start, &endp, 0);
if (endp != end)
RETURN(-EINVAL);
RETURN(-EINVAL);
*end = '\0';
- logid->lgl_ogr = simple_strtoull(start, &endp, 16);
+ logid->lgl_ogr = simple_strtoull(start, &endp, 0);
if (endp != end)
RETURN(-EINVAL);
struct llog_logid plain;
char *endp;
- if (!(handle->lgh_hdr->llh_flags & LLOG_F_IS_CAT))
+ cookie.lgc_index = simple_strtoul(data->ioc_inlbuf3, &endp, 0);
+ if (*endp != '\0')
GOTO(out_close, err = -EINVAL);
+ if (handle->lgh_hdr->llh_flags & LLOG_F_IS_CAT) {
+ down_write(&handle->lgh_lock);
+ err = llog_cancel_rec(handle, cookie.lgc_index);
+ up_write(&handle->lgh_lock);
+ GOTO(out_close, err);
+ }
+
err = str2logid(&plain, data->ioc_inlbuf2, data->ioc_inllen2);
if (err)
GOTO(out_close, err);
cookie.lgc_lgl = plain;
- cookie.lgc_index = simple_strtoul(data->ioc_inlbuf3, &endp, 0);
- if (*endp != '\0')
+
+ if (!(handle->lgh_hdr->llh_flags & LLOG_F_IS_CAT))
GOTO(out_close, err = -EINVAL);
err = llog_cat_cancel_records(handle, 1, &cookie);
case OBD_IOC_LLOG_REMOVE: {
struct llog_logid plain;
+ if (handle->lgh_hdr->llh_flags & cpu_to_le32(LLOG_F_IS_PLAIN)) {
+ err = llog_destroy(handle);
+ if (!err)
+ llog_free_handle(handle);
+ GOTO(out, err);
+ }
+
if (!(handle->lgh_hdr->llh_flags & LLOG_F_IS_CAT))
GOTO(out_close, err = -EINVAL);
static int llog_lvfs_destroy(struct llog_handle *handle)
{
+ struct dentry *fdentry;
struct obdo *oa;
int rc;
ENTRY;
+ fdentry = handle->lgh_file->f_dentry;
+ if (!strcmp(fdentry->d_parent->d_name.name, "LOGS")) {
+ struct inode *inode = fdentry->d_parent->d_inode;
+ rc = llog_lvfs_close(handle);
+ if (rc)
+ RETURN(rc);
+
+ down(&inode->i_sem);
+ rc = vfs_unlink(inode, fdentry);
+ up(&inode->i_sem);
+ RETURN(rc);
+ }
+
oa = obdo_alloc();
if (oa == NULL)
RETURN(-ENOMEM);
RETURN(rc);
}
+static int llog_test_7(struct obd_device *obd)
+{
+ struct llog_ctxt *ctxt = llog_get_context(obd, LLOG_TEST_ORIG_CTXT);
+ struct llog_handle *llh;
+ struct llog_create_rec lcr;
+ char name[10];
+ int rc;
+ ENTRY;
+
+ sprintf(name, "%x", llog_test_rand+2);
+ CWARN("7: create a log with name: %s\n", name);
+ LASSERT(ctxt);
+
+ rc = llog_create(ctxt, &llh, NULL, name);
+ if (rc) {
+ CERROR("7: llog_create with name %s failed: %d\n", name, rc);
+ RETURN(rc);
+ }
+ llog_init_handle(llh, LLOG_F_IS_PLAIN, &uuid);
+
+ lcr.lcr_hdr.lrh_len = lcr.lcr_tail.lrt_len = cpu_to_le32(sizeof(lcr));
+ lcr.lcr_hdr.lrh_type = cpu_to_le32(OST_SZ_REC);
+ rc = llog_write_rec(llh, &lcr.lcr_hdr, NULL, 0, NULL, -1);
+ if (rc) {
+ CERROR("7: write one log record failed: %d\n", rc);
+ RETURN(rc);
+ }
+
+ rc = llog_destroy(llh);
+ if (rc)
+ CERROR("7: llog_destroy failed: %d\n", rc);
+ else
+ llog_free_handle(llh);
+ RETURN(rc);
+}
+
/* -------------------------------------------------------------------------
* Tests above, boring obd functions below
* ------------------------------------------------------------------------- */
if (rc)
GOTO(cleanup, rc);
+ rc = llog_test_7(obd);
+ if (rc)
+ GOTO(cleanup, rc);
+
cleanup:
switch (cleanup_phase) {
case 1: