+ data1 = bh2->b_data;
+
+ /* The 0th block becomes the root, move the dirents out */
-+ de = &root->dotdot;
++ de = (struct ext3_dir_entry_2 *) &root->dotdot;
+ de = (struct ext3_dir_entry_2 *) ((char *)de + de->rec_len);
+ len = ((char *) root) + blocksize - (char *) de;
+ memcpy (data1, de, len);
+ data1 = bh2->b_data;
+
+ /* The 0th block becomes the root, move the dirents out */
-+ de = &root->dotdot;
++ de = (struct ext3_dir_entry_2 *) &root->dotdot;
+ de = (struct ext3_dir_entry_2 *) ((char *)de + de->rec_len);
+ len = ((char *) root) + blocksize - (char *) de;
+ memcpy (data1, de, len);
+ data1 = bh2->b_data;
+
+ /* The 0th block becomes the root, move the dirents out */
-+ de = &root->dotdot;
++ de = (struct ext3_dir_entry_2 *) &root->dotdot;
+ de = (struct ext3_dir_entry_2 *) ((char *)de + de->rec_len);
+ len = ((char *) root) + sb->s_blocksize - (char *) de;
+ memcpy (data1, de, len);
jbd-ctx_switch.patch
jbd-flushtime.patch
jbd-get_write_access.patch
+nfs_export_kernel-2.4.20.patch
+ext3-raw-lookup.patch
{
if (exp->exp_connection) {
struct lustre_handle *hdl;
- hdl = &exp->exp_ldlm_data.led_import->imp_remote_handle;
+ hdl = &exp->exp_imp_reverse->imp_remote_handle;
/* Might be a re-connect after a partition. */
if (!memcmp(&conn->cookie, &hdl->cookie, sizeof conn->cookie)) {
CERROR("%s reconnecting\n", cluuid->uuid);
{
struct obd_device *target;
struct obd_export *export = NULL;
- struct obd_import *dlmimp;
+ struct obd_import *revimp;
struct lustre_handle conn;
struct obd_uuid tgtuuid;
struct obd_uuid cluuid;
memcpy(&conn, lustre_msg_buf(req->rq_reqmsg, 2, sizeof conn),
sizeof conn);
- if (export->exp_ldlm_data.led_import != NULL)
- class_destroy_import(export->exp_ldlm_data.led_import);
- dlmimp = export->exp_ldlm_data.led_import = class_new_import();
- dlmimp->imp_connection = ptlrpc_connection_addref(req->rq_connection);
- dlmimp->imp_client = &export->exp_obd->obd_ldlm_client;
- dlmimp->imp_remote_handle = conn;
- dlmimp->imp_obd = target;
- dlmimp->imp_dlm_fake = 1;
- dlmimp->imp_state = LUSTRE_IMP_FULL;
- class_import_put(dlmimp);
+ if (export->exp_imp_reverse != NULL)
+ class_destroy_import(export->exp_imp_reverse);
+ revimp = export->exp_imp_reverse = class_new_import();
+ revimp->imp_connection = ptlrpc_connection_addref(req->rq_connection);
+ revimp->imp_client = &export->exp_obd->obd_ldlm_client;
+ revimp->imp_remote_handle = conn;
+ revimp->imp_obd = target;
+ revimp->imp_dlm_fake = 1;
+ revimp->imp_state = LUSTRE_IMP_FULL;
+ class_import_put(revimp);
out:
if (rc)
req->rq_status = rc;
{
/* exports created from last_rcvd data, and "fake"
exports created by lctl don't have an import */
- if (exp->exp_ldlm_data.led_import != NULL)
- class_destroy_import(exp->exp_ldlm_data.led_import);
+ if (exp->exp_imp_reverse != NULL)
+ class_destroy_import(exp->exp_imp_reverse);
}
/*
void target_abort_recovery(void *data)
{
struct obd_device *obd = data;
+ int rc;
CERROR("disconnecting clients and aborting recovery\n");
spin_lock_bh(&obd->obd_processing_task_lock);
if (OBT(obd) && OBP(obd, postsetup))
OBP(obd, postsetup)(obd);
+ /* when recovery was abort, cleanup orphans for mds */
+ if (OBT(obd) && OBP(obd, postcleanup)) {
+ rc = OBP(obd, postcleanup)(obd);
+ CERROR("Cleanup %d orphans after recovery was abort!\n", rc);
+ }
+
class_disconnect_exports(obd, 0);
abort_delayed_replies(obd);
abort_recovery_queue(obd);
if (!recovering)
return;
- CERROR("timer will expire in %d seconds\n", OBD_RECOVERY_TIMEOUT / HZ);
+ CDEBUG(D_HA, "timer will expire in %u seconds\n",
+ OBD_RECOVERY_TIMEOUT / HZ);
mod_timer(&obd->obd_recovery_timer, jiffies + OBD_RECOVERY_TIMEOUT);
}
spin_unlock_bh(&obd->obd_processing_task_lock);
return;
}
- CERROR("%s: starting recovery timer\n", obd->obd_name);
+ CERROR("%s: starting recovery timer (%us)\n", obd->obd_name,
+ OBD_RECOVERY_TIMEOUT / HZ);
obd->obd_recovery_handler = handler;
obd->obd_recovery_timer.function = target_recovery_expired;
obd->obd_recovery_timer.data = (unsigned long)obd;
struct ptlrpc_request *saved_req;
struct lustre_msg *reqmsg;
int recovery_done = 0;
+ int rc2;
LASSERT ((rc == 0) == (req->rq_reply_state != NULL));
obd->obd_name);
obd->obd_recovering = 0;
+ /* when recovering finished, cleanup orphans for mds */
+ /* there should be no orphan cleaned up for this condition */
+ if (OBT(obd) && OBP(obd, postcleanup)) {
+ CERROR("cleanup orphans after all clients recovered\n");
+ rc2 = OBP(obd, postcleanup)(obd);
+ LASSERT(rc2 == 0);
+ }
+
if (OBT(obd) && OBP(obd, postsetup))
OBP(obd, postsetup)(obd);
return lustre_pack_reply (req, 0, NULL, NULL);
}
-
LOGL0(data->name, data->namelen, tmp);
}
}
+
if (!S_ISREG(inode->i_mode))
b->valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS | OBD_MD_FLATIME |
- OBD_MD_FLMTIME;
+ OBD_MD_FLMTIME | OBD_MD_FLRDEV;
b->ino = inode->i_ino;
b->atime = LTIME_S(inode->i_atime);
b->uid = inode->i_uid;
b->gid = inode->i_gid;
b->flags = inode->i_flags;
- b->rdev = b->rdev;
+ b->rdev = inode->i_rdev;
/* Return the correct link count for orphan inodes */
b->nlink = mds_inode_is_orphan(inode) ? 0 : inode->i_nlink;
b->generation = inode->i_generation;
int client_sanobd_setup(struct obd_device *obddev, obd_count len, void *buf)
{
- struct obd_ioctl_data* data = buf;
+ struct lustre_cfg* lcfg = buf;
struct client_obd *cli = &obddev->u.cli;
ENTRY;
- if (data->ioc_inllen3 < 1) {
+ if (lcfg->lcfg_inllen3 < 1) {
CERROR("setup requires a SAN device pathname\n");
RETURN(-EINVAL);
}
client_obd_setup(obddev, len, buf);
- cli->cl_sandev = path2dev(data->ioc_inlbuf3);
+ cli->cl_sandev = path2dev(lcfg->lcfg_inlbuf3);
if (!kdev_t_to_nr(cli->cl_sandev)) {
- CERROR("%s seems not a valid SAN device\n", data->ioc_inlbuf3);
+ CERROR("%s seems not a valid SAN device\n", lcfg->lcfg_inlbuf3);
RETURN(-EINVAL);
}
int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf)
{
struct ptlrpc_connection *conn;
- struct obd_ioctl_data* data = buf;
+ struct lustre_cfg* lcfg = buf;
struct client_obd *cli = &obddev->u.cli;
struct obd_import *imp;
struct obd_uuid server_uuid;
RETURN(-EINVAL);
}
- if (data->ioc_inllen1 < 1) {
+ if (lcfg->lcfg_inllen1 < 1) {
CERROR("requires a TARGET UUID\n");
RETURN(-EINVAL);
}
- if (data->ioc_inllen1 > 37) {
+ if (lcfg->lcfg_inllen1 > 37) {
CERROR("client UUID must be less than 38 characters\n");
RETURN(-EINVAL);
}
- if (data->ioc_inllen2 < 1) {
+ if (lcfg->lcfg_inllen2 < 1) {
CERROR("setup requires a SERVER UUID\n");
RETURN(-EINVAL);
}
- if (data->ioc_inllen2 > 37) {
+ if (lcfg->lcfg_inllen2 > 37) {
CERROR("target UUID must be less than 38 characters\n");
RETURN(-EINVAL);
}
sema_init(&cli->cl_sem, 1);
cli->cl_conn_count = 0;
- memcpy(server_uuid.uuid, data->ioc_inlbuf2, MIN(data->ioc_inllen2,
+ memcpy(server_uuid.uuid, lcfg->lcfg_inlbuf2, MIN(lcfg->lcfg_inllen2,
sizeof(server_uuid)));
init_MUTEX(&cli->cl_dirty_sem);
imp->imp_connect_op = connect_op;
imp->imp_generation = 0;
INIT_LIST_HEAD(&imp->imp_pinger_chain);
- memcpy(imp->imp_target_uuid.uuid, data->ioc_inlbuf1, data->ioc_inllen1);
+ memcpy(imp->imp_target_uuid.uuid, lcfg->lcfg_inlbuf1, lcfg->lcfg_inllen1);
class_import_put(imp);
cli->cl_import = imp;
cli->cl_sandev = to_kdev_t(0);
/* Register with management client if we need to. */
- if (data->ioc_inllen3 > 0) {
- char *mgmt_name = data->ioc_inlbuf3;
+ if (lcfg->lcfg_inllen3 > 0) {
+ char *mgmt_name = lcfg->lcfg_inlbuf3;
int rc;
struct obd_device *mgmt_obd;
mgmtcli_register_for_events_t register_f;
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
int main(int argc, char ** argv)
{
- int rc;
+ int rc, i;
if (argc < 2) {
printf("Usage %s filename\n", argv[0]);
return 1;
}
- rc = unlink(argv[1]);
- if (rc) {
- printf("unlink(%s) error: %s\n", argv[1], strerror(errno));
+ for (i = 1; i < argc; i++) {
+ rc = unlink(argv[i]);
+ if (rc)
+ printf("unlink(%s) error: %s\n", argv[i],
+ strerror(errno));
}
return rc;
}
}
void
+check_ldlm_flock (void)
+{
+ BLANK_LINE ();
+ CHECK_STRUCT (ldlm_flock);
+ CHECK_MEMBER (ldlm_flock, start);
+ CHECK_MEMBER (ldlm_flock, end);
+ CHECK_MEMBER (ldlm_flock, pid);
+}
+
+void
check_ldlm_intent (void)
{
BLANK_LINE ();
CHECK_MEMBER (ldlm_lock_desc, l_resource);
CHECK_MEMBER (ldlm_lock_desc, l_req_mode);
CHECK_MEMBER (ldlm_lock_desc, l_granted_mode);
- CHECK_MEMBER (ldlm_lock_desc, l_extent);
+ CHECK_MEMBER (ldlm_lock_desc, l_policy_data);
CHECK_MEMBER (ldlm_lock_desc, l_version[RES_VERSION_SIZE]);
}
CHECK_MEMBER (ldlm_reply, lock_mode);
CHECK_MEMBER (ldlm_reply, lock_resource_name);
CHECK_MEMBER (ldlm_reply, lock_handle);
- CHECK_MEMBER (ldlm_reply, lock_extent);
+ CHECK_MEMBER (ldlm_reply, lock_policy_data);
CHECK_MEMBER (ldlm_reply, lock_policy_res1);
CHECK_MEMBER (ldlm_reply, lock_policy_res2);
}
check_lov_desc ();
check_ldlm_res_id ();
check_ldlm_extent ();
+ check_ldlm_flock ();
check_ldlm_intent ();
check_ldlm_resource_desc ();
check_ldlm_lock_desc ();