Whamcloud - gitweb
- Add mount-epoch checking in most (all?) inode-using operations, in preparation
authorshaver <shaver>
Thu, 3 Oct 2002 16:45:43 +0000 (16:45 +0000)
committershaver <shaver>
Thu, 3 Oct 2002 16:45:43 +0000 (16:45 +0000)
  for inode poisoning during failed recovery.
- Chain superblocks off the associated connections, because they were the only
  things we weren't yet keeping in a list or three.  (Also, so we can find the
  right superblocks to poison during recovery.)
- Split l_net.c into client.c and target.c to avoid OST/MDS dependencies on
  llite, and soothe my soul.
- Build client.c and target.c as sources from other directories as needed,
  instead of symlinking them.  (Someone could do this with the rest of the
  symlinked stuff, or I'll get to it later.)

16 files changed:
lustre/include/linux/lustre_lite.h
lustre/include/linux/lustre_net.h
lustre/ldlm/Makefile.am
lustre/lib/client.c [moved from lustre/lib/l_net.c with 60% similarity]
lustre/lib/target.c [new file with mode: 0644]
lustre/llite/file.c
lustre/llite/namei.c
lustre/llite/rw.c
lustre/llite/super.c
lustre/llite/symlink.c
lustre/mdc/Makefile.am
lustre/mds/Makefile.am
lustre/obdfs/rw.c
lustre/osc/Makefile.am
lustre/ost/Makefile.am
lustre/ptlrpc/connection.c

index 23c472d..cee1737 100644 (file)
@@ -48,6 +48,7 @@ struct ll_inode_info {
         char                 *lli_symlink_name;
         struct lustre_handle  lli_intent_lock_handle;
         struct semaphore      lli_open_sem;
+        __u32                 lli_mount_epoch;
 };
 
 #define LL_SUPER_MAGIC 0x0BD00BD0
@@ -72,8 +73,15 @@ struct ll_sb_info {
         time_t                    ll_commitcbd_waketime;
         time_t                    ll_commitcbd_timeout;
         spinlock_t                ll_commitcbd_lock;
+        struct list_head          ll_conn_chain; /* per-conn chain of SBs */
+        __u32                     ll_mount_epoch;
 };
 
+#define CHECK_MOUNT_EPOCH(i)                                                    \
+do {                                                                            \
+        if (ll_i2info(i)->lli_mount_epoch != ll_i2sbi(i)->ll_mount_epoch)       \
+                RETURN(-EIO);                                                   \
+} while(0)
 
 static inline struct ll_sb_info *ll_s2sbi(struct super_block *sb)
 {
index 69c6732..a83a37c 100644 (file)
@@ -97,6 +97,7 @@ struct ptlrpc_connection {
 
         struct list_head        c_imports;
         struct list_head        c_exports;
+        struct list_head        c_sb_chain;
 };
 
 struct ptlrpc_client {
index aff493a..ed5051a 100644 (file)
@@ -8,13 +8,8 @@ MODULE = ldlm
 modulefs_DATA = ldlm.o
 EXTRA_PROGRAMS = ldlm
 
-l_net.c: 
-       test -e l_net.c || ln -sf $(top_srcdir)/lib/l_net.c
-
-LINX=l_net.c
-
 ldlm_SOURCES = l_lock.c ldlm_lock.c ldlm_resource.c ldlm_test.c ldlm_lockd.c \
-ldlm_extent.c ldlm_request.c l_net.c
+ldlm_extent.c ldlm_request.c
 
 include $(top_srcdir)/Rules
 
similarity index 60%
rename from lustre/lib/l_net.c
rename to lustre/lib/client.c
index 2d111b6..8233336 100644 (file)
@@ -4,6 +4,7 @@
  *  Copyright (C) 2001, 2002 Cluster File Systems, Inc.
  *   Author: Peter J. Braam <braam@clusterfs.com>
  *   Author: Phil Schwan <phil@clusterfs.com>
+ *   Author: Mike Shaver <shaver@clusterfs.com>
  *
  *   This file is part of Lustre, http://www.lustre.org.
  *
  *   along with Lustre; if not, write to the Free Software
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- *  Storage Target Handling functions
- *  Lustre Object Server Module (OST)
- *
- *  This server is single threaded at present (but can easily be multi
- *  threaded). For testing and management it is treated as an
- *  obd_device, although it does not export a full OBD method table
- *  (the requests are coming in over the wire, so object target
- *  modules do not have a full method table.)
+ * Client-common OBD method implementations and utility functions.
  */
 
 #define EXPORT_SYMTAB
-#define DEBUG_SUBSYSTEM S_OST
+#define DEBUG_SUBSYSTEM S_OST /* XXX WRONG */
 
 #include <linux/module.h>
 #include <linux/obd_ost.h>
@@ -166,7 +160,6 @@ int client_obd_connect(struct lustre_handle *conn, struct obd_device *obd,
         cli->cl_import.imp_handle.addr = request->rq_repmsg->addr;
         cli->cl_import.imp_handle.cookie = request->rq_repmsg->cookie;
 
-
         recovd_conn_manage(c, ptlrpc_recovd, ll_recover);
 
         EXIT;
@@ -231,143 +224,3 @@ int client_obd_disconnect(struct lustre_handle *conn)
         up(&cli->cl_sem);
         RETURN(rc);
 }
-
-int target_handle_connect(struct ptlrpc_request *req)
-{
-        struct obd_device *target;
-        struct obd_export *export;
-        struct obd_import *dlmimp;
-        struct lustre_handle conn;
-        char *tgtuuid, *cluuid;
-        int rc, i;
-        ENTRY;
-
-        tgtuuid = lustre_msg_buf(req->rq_reqmsg, 0);
-        if (req->rq_reqmsg->buflens[0] > 37) {
-                CERROR("bad target UUID for connect\n");
-                GOTO(out, rc = -EINVAL);
-        }
-
-        cluuid = lustre_msg_buf(req->rq_reqmsg, 1);
-        if (req->rq_reqmsg->buflens[1] > 37) {
-                CERROR("bad client UUID for connect\n");
-                GOTO(out, rc = -EINVAL);
-        }
-
-        i = class_uuid2dev(tgtuuid);
-        if (i == -1) {
-                CERROR("UUID '%s' not found for connect\n", tgtuuid);
-                GOTO(out, rc = -ENODEV);
-        }
-
-        target = &obd_dev[i];
-        if (!target)
-                GOTO(out, rc = -ENODEV);
-
-        conn.addr = req->rq_reqmsg->addr;
-        conn.cookie = req->rq_reqmsg->cookie;
-
-        rc = obd_connect(&conn, target, cluuid);
-        if (rc)
-                GOTO(out, rc);
-
-        rc = lustre_pack_msg(0, NULL, NULL, &req->rq_replen, &req->rq_repmsg);
-        if (rc)
-                GOTO(out, rc);
-        req->rq_repmsg->addr = conn.addr;
-        req->rq_repmsg->cookie = conn.cookie;
-
-        export = class_conn2export(&conn);
-        LASSERT(export);
-
-        req->rq_export = export;
-        export->exp_connection = ptlrpc_get_connection(&req->rq_peer, cluuid);
-        if (req->rq_connection != NULL)
-                ptlrpc_put_connection(req->rq_connection);
-        req->rq_connection = ptlrpc_connection_addref(export->exp_connection);
-
-        spin_lock(&export->exp_connection->c_lock);
-        list_add(&export->exp_conn_chain, &export->exp_connection->c_exports);
-        spin_unlock(&export->exp_connection->c_lock);
-
-        recovd_conn_manage(export->exp_connection, ptlrpc_recovd,
-                           target_revoke_connection);
-        dlmimp = &export->exp_ldlm_data.led_import;
-        dlmimp->imp_connection = req->rq_connection;
-        dlmimp->imp_client = &export->exp_obd->obd_ldlm_client;
-        dlmimp->imp_handle.addr = req->rq_reqmsg->addr;
-        dlmimp->imp_handle.cookie = req->rq_reqmsg->cookie;
-        dlmimp->imp_obd = /* LDLM! */ NULL;
-        
-#warning Peter: is this the right place to upgrade the server connection level?
-        req->rq_connection->c_level = LUSTRE_CONN_FULL;
-out:
-        req->rq_status = rc;
-        RETURN(rc);
-}
-
-int target_handle_disconnect(struct ptlrpc_request *req)
-{
-        struct lustre_handle *conn = (struct lustre_handle *)req->rq_reqmsg;
-        int rc;
-        ENTRY;
-
-        rc = lustre_pack_msg(0, NULL, NULL, &req->rq_replen, &req->rq_repmsg);
-        if (rc)
-                RETURN(rc);
-
-        req->rq_status = obd_disconnect(conn);
-
-        RETURN(0);
-}
-
-static int target_disconnect_client(struct ptlrpc_connection *conn)
-{
-        struct list_head *expiter, *n;
-        struct lustre_handle hdl;
-        struct obd_export *exp;
-        int rc;
-        ENTRY;
-
-        list_for_each_safe(expiter, n, &conn->c_exports) {
-                exp = list_entry(expiter, struct obd_export, exp_conn_chain);
-
-                hdl.addr = (__u64)(unsigned long)exp;
-                hdl.cookie = exp->exp_cookie;
-                rc = obd_disconnect(&hdl);
-                if (rc)
-                        CERROR("disconnecting export %p failed: %d\n", exp, rc);
-        }
-        RETURN(0);
-}
-
-static int target_fence_failed_connection(struct ptlrpc_connection *conn)
-{
-        ENTRY;
-
-        conn->c_level = LUSTRE_CONN_RECOVD;
-        conn->c_recovd_data.rd_phase = RD_PREPARED;
-
-        RETURN(0);
-}
-
-int target_revoke_connection(struct recovd_data *rd, int phase)
-{
-        struct ptlrpc_connection *conn = class_rd2conn(rd);
-        
-        LASSERT(conn);
-        ENTRY;
-
-        switch (phase) {
-            case PTLRPC_RECOVD_PHASE_PREPARE:
-                RETURN(target_fence_failed_connection(conn));
-            case PTLRPC_RECOVD_PHASE_RECOVER:
-                RETURN(target_disconnect_client(conn));
-            case PTLRPC_RECOVD_PHASE_FAILURE:
-                LBUG();
-                RETURN(0);
-        }
-
-        LBUG();
-        RETURN(-ENOSYS);
-}
diff --git a/lustre/lib/target.c b/lustre/lib/target.c
new file mode 100644 (file)
index 0000000..6750dbd
--- /dev/null
@@ -0,0 +1,173 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ *  Copyright (C) 2001, 2002 Cluster File Systems, Inc.
+ *   Author: Peter J. Braam <braam@clusterfs.com>
+ *   Author: Phil Schwan <phil@clusterfs.com>
+ *   Author: Mike Shaver <shaver@clusterfs.com>
+ *
+ *   This file is part of Lustre, http://www.lustre.org.
+ *
+ *   Lustre is free software; you can redistribute it and/or
+ *   modify it under the terms of version 2 of the GNU General Public
+ *   License as published by the Free Software Foundation.
+ *
+ *   Lustre is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with Lustre; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Target-common OBD method implementations and utility functions.
+ */
+
+#define EXPORT_SYMTAB
+#define DEBUG_SUBSYSTEM S_OST /* XXX WRONG */
+
+#include <linux/module.h>
+#include <linux/obd_ost.h>
+#include <linux/lustre_net.h>
+#include <linux/lustre_dlm.h>
+
+int target_handle_connect(struct ptlrpc_request *req)
+{
+        struct obd_device *target;
+        struct obd_export *export;
+        struct obd_import *dlmimp;
+        struct lustre_handle conn;
+        char *tgtuuid, *cluuid;
+        int rc, i;
+        ENTRY;
+
+        tgtuuid = lustre_msg_buf(req->rq_reqmsg, 0);
+        if (req->rq_reqmsg->buflens[0] > 37) {
+                CERROR("bad target UUID for connect\n");
+                GOTO(out, rc = -EINVAL);
+        }
+
+        cluuid = lustre_msg_buf(req->rq_reqmsg, 1);
+        if (req->rq_reqmsg->buflens[1] > 37) {
+                CERROR("bad client UUID for connect\n");
+                GOTO(out, rc = -EINVAL);
+        }
+
+        i = class_uuid2dev(tgtuuid);
+        if (i == -1) {
+                CERROR("UUID '%s' not found for connect\n", tgtuuid);
+                GOTO(out, rc = -ENODEV);
+        }
+
+        target = &obd_dev[i];
+        if (!target)
+                GOTO(out, rc = -ENODEV);
+
+        conn.addr = req->rq_reqmsg->addr;
+        conn.cookie = req->rq_reqmsg->cookie;
+
+        rc = obd_connect(&conn, target, cluuid);
+        if (rc)
+                GOTO(out, rc);
+
+        rc = lustre_pack_msg(0, NULL, NULL, &req->rq_replen, &req->rq_repmsg);
+        if (rc)
+                GOTO(out, rc);
+        req->rq_repmsg->addr = conn.addr;
+        req->rq_repmsg->cookie = conn.cookie;
+
+        export = class_conn2export(&conn);
+        LASSERT(export);
+
+        req->rq_export = export;
+        export->exp_connection = ptlrpc_get_connection(&req->rq_peer, cluuid);
+        if (req->rq_connection != NULL)
+                ptlrpc_put_connection(req->rq_connection);
+        req->rq_connection = ptlrpc_connection_addref(export->exp_connection);
+
+        spin_lock(&export->exp_connection->c_lock);
+        list_add(&export->exp_conn_chain, &export->exp_connection->c_exports);
+        spin_unlock(&export->exp_connection->c_lock);
+
+        recovd_conn_manage(export->exp_connection, ptlrpc_recovd,
+                           target_revoke_connection);
+        dlmimp = &export->exp_ldlm_data.led_import;
+        dlmimp->imp_connection = req->rq_connection;
+        dlmimp->imp_client = &export->exp_obd->obd_ldlm_client;
+        dlmimp->imp_handle.addr = req->rq_reqmsg->addr;
+        dlmimp->imp_handle.cookie = req->rq_reqmsg->cookie;
+        dlmimp->imp_obd = /* LDLM! */ NULL;
+        
+#warning Peter: is this the right place to upgrade the server connection level?
+        req->rq_connection->c_level = LUSTRE_CONN_FULL;
+out:
+        req->rq_status = rc;
+        RETURN(rc);
+}
+
+int target_handle_disconnect(struct ptlrpc_request *req)
+{
+        struct lustre_handle *conn = (struct lustre_handle *)req->rq_reqmsg;
+        int rc;
+        ENTRY;
+
+        rc = lustre_pack_msg(0, NULL, NULL, &req->rq_replen, &req->rq_repmsg);
+        if (rc)
+                RETURN(rc);
+
+        req->rq_status = obd_disconnect(conn);
+
+        RETURN(0);
+}
+
+static int target_disconnect_client(struct ptlrpc_connection *conn)
+{
+        struct list_head *expiter, *n;
+        struct lustre_handle hdl;
+        struct obd_export *exp;
+        int rc;
+        ENTRY;
+
+        list_for_each_safe(expiter, n, &conn->c_exports) {
+                exp = list_entry(expiter, struct obd_export, exp_conn_chain);
+
+                hdl.addr = (__u64)(unsigned long)exp;
+                hdl.cookie = exp->exp_cookie;
+                rc = obd_disconnect(&hdl);
+                if (rc)
+                        CERROR("disconnecting export %p failed: %d\n", exp, rc);
+        }
+        RETURN(0);
+}
+
+static int target_fence_failed_connection(struct ptlrpc_connection *conn)
+{
+        ENTRY;
+
+        conn->c_level = LUSTRE_CONN_RECOVD;
+        conn->c_recovd_data.rd_phase = RD_PREPARED;
+
+        RETURN(0);
+}
+
+int target_revoke_connection(struct recovd_data *rd, int phase)
+{
+        struct ptlrpc_connection *conn = class_rd2conn(rd);
+        
+        LASSERT(conn);
+        ENTRY;
+
+        switch (phase) {
+            case PTLRPC_RECOVD_PHASE_PREPARE:
+                RETURN(target_fence_failed_connection(conn));
+            case PTLRPC_RECOVD_PHASE_RECOVER:
+                RETURN(target_disconnect_client(conn));
+            case PTLRPC_RECOVD_PHASE_FAILURE:
+                LBUG();
+                RETURN(0);
+        }
+
+        LBUG();
+        RETURN(-ENOSYS);
+}
index 37f40c7..8cef424 100644 (file)
@@ -45,6 +45,8 @@ static int ll_file_open(struct inode *inode, struct file *file)
         if (file->private_data)
                 LBUG();
 
+        CHECK_MOUNT_EPOCH(inode);
+
         lsm = lli->lli_smd;
 
         /*  delayed create of object (intent created inode) */
@@ -236,6 +238,8 @@ static int ll_file_release(struct inode *inode, struct file *file)
         struct ll_inode_info *lli = ll_i2info(inode);
 
         ENTRY;
+        
+        CHECK_MOUNT_EPOCH(inode);
 
         fd = (struct ll_file_data *)file->private_data;
         if (!fd || !fd->fd_mdshandle) {
@@ -567,6 +571,8 @@ loff_t ll_file_seek(struct file *file, loff_t offset, int origin)
         long long retval;
         ENTRY;
 
+        CHECK_MOUNT_EPOCH(inode);
+
         switch (origin) {
         case 2: {
                 struct ll_inode_info *lli = ll_i2info(inode);
index 9746fc0..4ea1c21 100644 (file)
@@ -155,6 +155,8 @@ static struct dentry *ll_lookup2(struct inode *dir, struct dentry *dentry,
 
         ENTRY;
 
+        CHECK_MOUNT_EPOCH(dir);
+        
         if (it == NULL) {
                 it = &lookup_it;
                 dentry->d_it = it;
@@ -443,6 +445,8 @@ static int ll_create(struct inode * dir, struct dentry * dentry, int mode)
         struct ll_inode_info *lli = NULL;
         ENTRY;
 
+        CHECK_MOUNT_EPOCH(dir);
+
         if (dentry->d_it->it_disposition == 0) {
                 memset(&oa, 0, sizeof(oa));
                 oa.o_mode = S_IFREG | 0600;
@@ -520,6 +524,8 @@ static int ll_symlink(struct inode *dir, struct dentry *dentry,
         int err = 0;
         ENTRY;
 
+        CHECK_MOUNT_EPOCH(dir);
+
         inode = ll_create_node(dir, dentry->d_name.name, dentry->d_name.len,
                                symname, l, S_IFLNK | S_IRWXUGO, 0,
                                dentry->d_it, NULL);
index bb53c7d..6b8aedf 100644 (file)
@@ -80,6 +80,8 @@ static int ll_brw(int cmd, struct inode *inode, struct page *page, int create)
         int err;
         ENTRY;
 
+        CHECK_MOUNT_EPOCH(inode);
+
         if (!cbd)
                 RETURN(-ENOMEM);
 
@@ -200,6 +202,8 @@ static int ll_commit_write(struct file *file, struct page *page,
         struct io_cb_data *cbd = ll_init_cb();
         ENTRY;
 
+        CHECK_MOUNT_EPOCH(inode);
+
         pg.pg = page;
         pg.count = to;
         pg.off = (((obd_off)page->index) << PAGE_SHIFT);
@@ -283,6 +287,8 @@ static int ll_direct_IO(int rw, struct inode *inode, struct kiobuf *iobuf,
         int i, rc = 0;
         struct io_cb_data *cbd;
 
+        CHECK_MOUNT_EPOCH(inode);
+
         ENTRY;
         if (!lsm || !lsm->lsm_object_id)
                 RETURN(-ENOMEM);
index 71413a9..7163e08 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/obd_lov.h>
 #include <linux/lustre_dlm.h>
 #include <linux/init.h>
+#include <linux/fs.h>
 
 kmem_cache_t *ll_file_data_slab;
 extern struct address_space_operations ll_aops;
@@ -104,6 +105,7 @@ static struct super_block * ll_read_super(struct super_block *sb,
         __u64 last_committed;
         __u64 last_xid;
         struct ptlrpc_request *request = NULL;
+        struct ptlrpc_connection *mdc_conn;
         struct ll_read_inode2_cookie lic;
         class_uuid_t uuid;
 
@@ -116,6 +118,8 @@ static struct super_block * ll_read_super(struct super_block *sb,
                 RETURN(NULL);
         }
 
+        INIT_LIST_HEAD(&sbi->ll_conn_chain);
+        sbi->ll_mount_epoch = 0;
         generate_random_uuid(uuid);
         class_uuid_unparse(uuid, sbi->ll_sb_uuid);
 
@@ -146,7 +150,9 @@ static struct super_block * ll_read_super(struct super_block *sb,
         }
 
 #warning Peter: is this the right place to raise the connection level?
-        sbi2mdc(sbi)->cl_import.imp_connection->c_level = LUSTRE_CONN_FULL;
+        mdc_conn = sbi2mdc(sbi)->cl_import.imp_connection;
+        mdc_conn->c_level = LUSTRE_CONN_FULL;
+        list_add(&mdc_conn->c_sb_chain, &sbi->ll_conn_chain);
 
         obd = class_uuid2obd(osc);
         if (!obd) {
@@ -240,7 +246,9 @@ out_free:
 static void ll_put_super(struct super_block *sb)
 {
         struct ll_sb_info *sbi = ll_s2sbi(sb);
+
         ENTRY;
+        list_del(&sbi->ll_conn_chain);
         ll_commitcbd_cleanup(sbi);
         obd_disconnect(&sbi->ll_osc_conn);
         obd_disconnect(&sbi->ll_mdc_conn);
@@ -252,6 +260,8 @@ static void ll_put_super(struct super_block *sb)
 
 static void ll_clear_inode(struct inode *inode)
 {
+        /* XXX EPOCH */
+
         if (atomic_read(&inode->i_count) == 0) {
                 struct ll_inode_info *lli = ll_i2info(inode);
                 struct lov_stripe_md *lsm = lli->lli_smd;
@@ -450,9 +460,10 @@ static void ll_read_inode2(struct inode *inode, void *opaque)
         struct mds_body *body = lic->lic_body;
         struct ll_inode_info *lli = ll_i2info(inode);
         ENTRY;
-
+        
         sema_init(&lli->lli_open_sem, 1);
-
+        lli->lli_mount_epoch = ll_i2sbi(inode)->ll_mount_epoch;
+        
         /* core attributes first */
         ll_update_inode(inode, body);
 
@@ -526,10 +537,10 @@ struct file_system_type lustre_lite_fs_type = {
 
 static int __init init_lustre_lite(void)
 {
-        printk(KERN_INFO "Lustre Lite 0.0.1, info@clusterfs.com\n");
+        printk(KERN_INFO "Lustre Lite 0.5.14, info@clusterfs.com\n");
         ll_file_data_slab = kmem_cache_create("ll_file_data",
                                               sizeof(struct ll_file_data), 0,
-                                               SLAB_HWCACHE_ALIGN, NULL, NULL);
+                                              SLAB_HWCACHE_ALIGN, NULL, NULL);
         if (ll_file_data_slab == NULL)
                 return -ENOMEM;
         return register_filesystem(&lustre_lite_fs_type);
index 8571d39..d65220b 100644 (file)
@@ -33,6 +33,8 @@ static int ll_readlink_internal(struct inode *inode,
 
         *request = NULL;
 
+        CHECK_MOUNT_EPOCH(inode);
+
         if (lli->lli_symlink_name) {
                 *symname = lli->lli_symlink_name;
                 CDEBUG(D_INODE, "using cached symlink %s\n", *symname);
@@ -65,6 +67,8 @@ static int ll_readlink(struct dentry *dentry, char *buffer, int buflen)
         int rc;
         ENTRY;
 
+        CHECK_MOUNT_EPOCH(inode);
+
         /* on symlinks lli_open_sem protects lli_symlink_name allocation/data */
         down(&lli->lli_open_sem);
         rc = ll_readlink_internal(inode, &request, &symname);
@@ -88,6 +92,8 @@ static int ll_follow_link(struct dentry *dentry, struct nameidata *nd)
         int rc;
         ENTRY;
 
+        CHECK_MOUNT_EPOCH(inode);
+
         down(&lli->lli_open_sem);
         rc = ll_readlink_internal(inode, &request, &symname);
         if (rc)
index ab5fa58..d75fc2f 100644 (file)
@@ -9,17 +9,15 @@ MODULE = mdc
 modulefs_DATA = mdc.o
 EXTRA_PROGRAMS = mdc
 
-LINX=l_net.c mds_updates.c ll_pack.c lov_pack.c 
-mdc_SOURCES =  mdc_request.c mdc_reint.c $(LINX)
+LINX= mds_updates.c ll_pack.c lov_pack.c 
+mdc_SOURCES =  mdc_request.c mdc_reint.c ../lib/client.c $(LINX)
+
 lov_pack.c: 
        test -e lov_pack.c || ln -sf $(top_srcdir)/lib/lov_pack.c .
 
 ll_pack.c: 
        test -e ll_pack.c || ln -sf $(top_srcdir)/lib/ll_pack.c .
 
-l_net.c: 
-       test -e l_net.c || ln -sf $(top_srcdir)/lib/l_net.c .
-
 mds_updates.c: 
        test -e mds_updates.c || ln -sf $(top_srcdir)/lib/mds_updates.c .
 
index c3c8c8f..d3b9813 100644 (file)
@@ -9,7 +9,7 @@ MODULE = mds
 modulefs_DATA = mds.o mds_extN.o # mds_ext2.o mds_ext3.o
 EXTRA_PROGRAMS = mds mds_extN # mds_ext2 mds_ext3
 
-LINX= mds_updates.c simple.c ll_pack.c l_net.c lov_pack.c
+LINX= mds_updates.c simple.c ll_pack.c lov_pack.c
 
 ll_pack.c: 
        test -e ll_pack.c || ln -sf $(top_srcdir)/lib/ll_pack.c
@@ -17,13 +17,10 @@ mds_updates.c:
        test -e mds_updates.c || ln -sf $(top_srcdir)/lib/mds_updates.c
 simple.c: 
        test -e simple.c || ln -sf $(top_srcdir)/lib/simple.c
-l_net.c: 
-       test -e l_net.c || ln -sf $(top_srcdir)/lib/l_net.c
 lov_pack.c: 
        test -e lov_pack.c || ln -sf $(top_srcdir)/lib/lov_pack.c
 
-mds_SOURCES = mds_lov.c handler.c mds_reint.c mds_fs.c $(LINX)
-
+mds_SOURCES = mds_lov.c handler.c mds_reint.c mds_fs.c $(LINX) ../lib/target.c
 
 include $(top_srcdir)/Rules
 
index f79fd2e..1c94dc7 100644 (file)
@@ -160,6 +160,9 @@ static int obdfs_brw(int rw, struct inode *inode2,
 
         ENTRY;
 
+        CHECK_MOUNT_EPOCH(inode);
+        CHECK_MOUNT_EPOCH(inode2);
+
         err = obd_brw(rw == WRITE ? OBD_BRW_WRITE : OBD_BRW_READ, IID(inode),
                       md, 1, &page, &count, &offset,
                      &flags, NULL);
index 17276bc..6db3a2a 100644 (file)
@@ -9,8 +9,8 @@ MODULE = osc
 modulefs_DATA = osc.o
 EXTRA_PROGRAMS = osc
 
-LINX= obd_pack.c ll_pack.c l_net.c
-osc_SOURCES = osc_request.c $(LINX)
+LINX= obd_pack.c ll_pack.c
+osc_SOURCES = osc_request.c ../lib/client.c $(LINX)
 
 obd_pack.c: 
        test -e obd_pack.c || ln -sf $(top_srcdir)/lib/obd_pack.c
@@ -18,9 +18,6 @@ obd_pack.c:
 ll_pack.c: 
        test -e ll_pack.c || ln -sf $(top_srcdir)/lib/ll_pack.c
 
-l_net.c: 
-       test -e l_net.c || ln -sf $(top_srcdir)/lib/l_net.c .
-
 dist-hook:
        list='$(LINX)'; for f in $$list; do rm -f $(distdir)/$$f; done
 
index 6ba1c9c..6599695 100644 (file)
@@ -8,17 +8,14 @@ MODULE = ost
 modulefs_DATA = ost.o
 EXTRA_PROGRAMS = ost
 
-LINX=obd_pack.c l_net.c ll_pack.c
+LINX=obd_pack.c ll_pack.c
 ll_pack.c: 
        test -e ll_pack.c || ln -sf $(top_srcdir)/lib/ll_pack.c
 
 obd_pack.c: 
        test -e obd_pack.c || ln -sf $(top_srcdir)/lib/obd_pack.c
 
-l_net.c:
-       test -e l_net.c || ln -sf $(top_srcdir)/lib/l_net.c
-
-ost_SOURCES = $(LINX) ost_handler.c
+ost_SOURCES = $(LINX) ost_handler.c ../lib/target.c
 dist-hook:
        list='$(LINX)'; for f in $$list; do rm -f $(distdir)/$$f; done
 
index 0307ecb..07b46eb 100644 (file)
@@ -91,6 +91,7 @@ struct ptlrpc_connection *ptlrpc_get_connection(struct lustre_peer *peer,
         INIT_LIST_HEAD(&c->c_dying_head);
         INIT_LIST_HEAD(&c->c_imports);
         INIT_LIST_HEAD(&c->c_exports);
+        INIT_LIST_HEAD(&c->c_sb_chain);
         atomic_set(&c->c_refcount, 0);
         ptlrpc_connection_addref(c);
         spin_lock_init(&c->c_lock);