Whamcloud - gitweb
merge b_devel to b_eq: 20031010
authorericm <ericm>
Fri, 10 Oct 2003 09:32:10 +0000 (09:32 +0000)
committerericm <ericm>
Fri, 10 Oct 2003 09:32:10 +0000 (09:32 +0000)
kernel only

lustre/kernel_patches/patches/ext-2.4-patch-1-chaos.patch
lustre/kernel_patches/patches/ext-2.4-patch-1.patch
lustre/kernel_patches/patches/htree-ext3-2.4.18.patch
lustre/kernel_patches/series/vanilla-2.4.20
lustre/ldlm/ldlm_lib.c
lustre/mdc/mdc_lib.c
lustre/mds/mds_lib.c
lustre/osc/osc_lib.c
lustre/ptlrpc/ptlrpc_lib.c
lustre/tests/munlink.c
lustre/utils/wirecheck.c

index 31e499c..3de6a8f 100644 (file)
 +      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);
index 6f9b884..748671f 100644 (file)
 +      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);
index 1bba90a..2bfd0b9 100644 (file)
 +              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);
index 78a6820..ce7e43e 100644 (file)
@@ -39,3 +39,5 @@ removepage-2.4.20.patch
 jbd-ctx_switch.patch
 jbd-flushtime.patch
 jbd-get_write_access.patch
+nfs_export_kernel-2.4.20.patch
+ext3-raw-lookup.patch
index c760e45..67d2dc2 100644 (file)
@@ -164,7 +164,7 @@ int target_handle_reconnect(struct lustre_handle *conn, struct obd_export *exp,
 {
         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);
@@ -197,7 +197,7 @@ int target_handle_connect(struct ptlrpc_request *req, svc_handler_t handler)
 {
         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;
@@ -339,16 +339,16 @@ int target_handle_connect(struct ptlrpc_request *req, svc_handler_t handler)
         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;
@@ -373,8 +373,8 @@ void target_destroy_export(struct obd_export *exp)
 {
         /* 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);
 }
 
 /*
@@ -430,6 +430,7 @@ static void abort_recovery_queue(struct obd_device *obd)
 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);
@@ -450,6 +451,12 @@ void target_abort_recovery(void *data)
         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);
@@ -475,7 +482,8 @@ static void reset_recovery_timer(struct obd_device *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);
 }
 
@@ -488,7 +496,8 @@ void target_start_recovery_timer(struct obd_device *obd, svc_handler_t handler)
                 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;
@@ -693,6 +702,7 @@ int target_queue_final_reply(struct ptlrpc_request *req, int rc)
         struct ptlrpc_request *saved_req;
         struct lustre_msg *reqmsg;
         int recovery_done = 0;
+        int rc2;
 
         LASSERT ((rc == 0) == (req->rq_reply_state != NULL));
 
@@ -732,6 +742,14 @@ int target_queue_final_reply(struct ptlrpc_request *req, int rc)
                        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);
 
@@ -898,4 +916,3 @@ int target_handle_ping(struct ptlrpc_request *req)
         return lustre_pack_reply (req, 0, NULL, NULL);
 }
 
-
index 148b883..0c634eb 100644 (file)
@@ -269,3 +269,4 @@ void mdc_getattr_pack(struct ptlrpc_request *req, int valid, int offset,
                 LOGL0(data->name, data->namelen, tmp);
         }
 }
+
index 54dd14b..650c771 100644 (file)
@@ -66,7 +66,7 @@ void mds_pack_inode2body(struct mds_body *b, struct inode *inode)
 
         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);
@@ -78,7 +78,7 @@ void mds_pack_inode2body(struct mds_body *b, struct inode *inode)
         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;
index 1a50314..79b4b6b 100644 (file)
@@ -54,20 +54,20 @@ static kdev_t path2dev(char *path)
 
 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);
         }
 
index 8ae2c6e..c2e90f8 100644 (file)
@@ -38,7 +38,7 @@
 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;
@@ -66,29 +66,29 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf)
                 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);
@@ -124,7 +124,7 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf)
         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;
@@ -133,8 +133,8 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf)
         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;
index a3c18c5..0f42434 100755 (executable)
@@ -1,3 +1,6 @@
+/* -*- 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;
 } 
index c1e7995..27c6aab 100644 (file)
@@ -328,6 +328,16 @@ check_ldlm_extent (void)
 }
 
 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 ();
@@ -353,7 +363,7 @@ check_ldlm_lock_desc (void)
        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]);
 }
 
@@ -377,7 +387,7 @@ check_ldlm_reply (void)
        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);
 }
@@ -571,6 +581,7 @@ main (int argc, char **argv)
        check_lov_desc ();
        check_ldlm_res_id ();
        check_ldlm_extent ();
+       check_ldlm_flock ();
        check_ldlm_intent ();
        check_ldlm_resource_desc ();
        check_ldlm_lock_desc ();