Whamcloud - gitweb
Minor changes to sync b1_2 with HEAD that shouldn't affect anything.
authoradilger <adilger>
Thu, 1 Apr 2004 12:03:07 +0000 (12:03 +0000)
committeradilger <adilger>
Thu, 1 Apr 2004 12:03:07 +0000 (12:03 +0000)
21 files changed:
lustre/include/liblustre.h
lustre/include/linux/lustre_compat25.h
lustre/include/linux/obd_support.h
lustre/ldlm/l_lock.c
lustre/ldlm/ldlm_flock.c
lustre/ldlm/ldlm_internal.h
lustre/mds/mds_fs.c
lustre/mds/mds_open.c
lustre/obdclass/llog_lvfs.c
lustre/obdfilter/filter.c
lustre/obdfilter/filter_san.c
lustre/tests/cfg/insanity-adev.sh
lustre/tests/cfg/insanity-local.sh
lustre/tests/cfg/insanity-mdev.sh
lustre/tests/oos2.sh
lustre/tests/recovery-small.sh
lustre/tests/replay-ost-single.sh
lustre/tests/replay-single.sh
lustre/tests/sanity.sh
lustre/tests/test-framework.sh
lustre/utils/lconf

index 287f4f9..d859bfc 100644 (file)
@@ -578,6 +578,10 @@ extern struct task_struct *current;
 #define del_wait_queue(p) do { list_del(&(p)->sleeping); } while (0)
 #define remove_wait_queue(q,p) do { list_del(&(p)->sleeping); } while (0)
 
+#define DECLARE_WAIT_QUEUE_HEAD(HEAD)                           \
+        wait_queue_head_t HEAD = {                              \
+                .sleepers = LIST_HEAD_INIT(HEAD.sleepers)       \
+        }
 #define init_waitqueue_head(l) INIT_LIST_HEAD(&(l)->sleepers)
 #define wake_up(l) do { int a; a++; } while (0)
 #define TASK_INTERRUPTIBLE 0
index fb97fa6..58ba03e 100644 (file)
@@ -52,7 +52,7 @@
 
 #define LTIME_S(time)                   (time.tv_sec)
 #define ll_path_lookup                  path_lookup
-#define ll_permission(a,b,c)            permission(a,b,c)
+#define ll_permission(inode,mask,nd)    permission(inode,mask,nd)
 
 #define ll_pgcache_lock(mapping)          spin_lock(&mapping->page_lock)
 #define ll_pgcache_unlock(mapping)        spin_unlock(&mapping->page_lock)
@@ -111,7 +111,7 @@ static inline int cleanup_group_info(void)
 #else /* 2.4.. */
 
 #define ll_vfs_create(a,b,c,d)              vfs_create(a,b,c)
-#define ll_permission(a,b,c)                permission(a,b)
+#define ll_permission(inode,mask,nd)        permission(inode,mask)
 #define ILOOKUP(sb, ino, test, data)        ilookup4(sb, ino, test, data);
 #define DCACHE_DISCONNECTED                 DCACHE_NFSD_DISCONNECTED
 #define ll_dev_t                            int
@@ -144,15 +144,15 @@ static inline void clear_page_dirty(struct page *page)
 #define cpu_online(cpu)                 (cpu_online_map & (1<<cpu))
 #endif
 
-static inline int ll_path_lookup(const char *path, unsigned flags, 
-                              struct nameidata *nd)
+static inline int ll_path_lookup(const char *path, unsigned flags,
+                                 struct nameidata *nd)
 {
         int error = 0;
         if (path_init(path, flags, nd))
                 error = path_walk(path, nd);
         return error;
 }
-#define ll_permission(a,b,c)  permission(a,b)
+#define ll_permission(inode,mask,nd)    permission(inode,mask)
 typedef long sector_t;
 
 #define ll_pgcache_lock(mapping)        spin_lock(&pagecache_lock)
index 2daa927..9d7957e 100644 (file)
@@ -126,6 +126,8 @@ extern wait_queue_head_t obd_race_waitq;
 #define OBD_FAIL_PTLRPC                  0x500
 #define OBD_FAIL_PTLRPC_ACK              0x501
 #define OBD_FAIL_PTLRPC_RQBD             0x502
+#define OBD_FAIL_PTLRPC_BULK_GET_NET     0x503
+#define OBD_FAIL_PTLRPC_BULK_PUT_NET     0x504
 
 #define OBD_FAIL_OBD_PING_NET            0x600
 #define OBD_FAIL_OBD_LOG_CANCEL_NET      0x601
@@ -178,6 +180,7 @@ do {                                                                         \
        }                                                                     \
 } while(0)
 
+#ifdef __KERNEL__
 /* The idea here is to synchronise two threads to force a race. The
  * first thread that calls this with a matching fail_loc is put to
  * sleep. The next thread that calls with the same fail_loc wakes up
@@ -193,6 +196,10 @@ do {                                                            \
                 wake_up(&obd_race_waitq);                       \
         }                                                       \
 } while(0)
+#else
+/* sigh.  an expedient fix until OBD_RACE is fixed up */
+#define OBD_RACE(foo) LBUG()
+#endif
 
 #define fixme() CDEBUG(D_OTHER, "FIXME\n");
 
index f9c5592..69d3f14 100644 (file)
@@ -136,5 +136,6 @@ void l_check_no_ns_lock(struct ldlm_namespace *ns)
         if (l_has_lock(&ns->ns_lock)) {
                 CERROR("namespace %s lock held illegally; tell phil\n",
                        ns->ns_name);
+        }
 }
 #endif /* __KERNEL__ */
index 148be59..b1c5b2f 100644 (file)
@@ -512,7 +512,7 @@ granted:
                 getlk->fl_end = lock->l_policy_data.l_flock.end;
         } else {
                 /* We need to reprocess the lock to do merges or splits
-                 * with existing locks owne by this process. */
+                 * with existing locks owned by this process. */
                 flags = LDLM_FL_WAIT_NOREPROC;
                 ldlm_process_flock_lock(lock, &flags, 1, &err);
         }
index edee657..d0b081c 100644 (file)
@@ -1,14 +1,37 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ *  Copyright (c) 2002, 2003 Cluster File Systems, Inc.
+ *   Author: Peter Braam <braam@clusterfs.com>
+ *   Author: Phil Schwan <phil@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.
+ */
+
 /* ldlm_request.c */
 typedef enum {
-       LDLM_ASYNC,
-       LDLM_SYNC,
+        LDLM_ASYNC,
+        LDLM_SYNC,
 } ldlm_sync_t;
 
 int ldlm_cancel_lru(struct ldlm_namespace *ns, ldlm_sync_t sync);
 
 /* ldlm_lock.c */
 void ldlm_grant_lock(struct ldlm_lock *lock, void *data, int datalen,
-                    int run_ast);
+                     int run_ast);
 struct ldlm_lock *
 ldlm_lock_create(struct ldlm_namespace *ns,
                  struct lustre_handle *parent_lock_handle, struct ldlm_res_id,
index 774e72b..c4d0d11 100644 (file)
@@ -647,7 +647,8 @@ int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
         down(&parent_inode->i_sem);
         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);
+                CERROR("destroying non-existent object "LPU64" %s\n",
+                       oa->o_id, fidname);
                 GOTO(out_dput, rc = IS_ERR(de) ? PTR_ERR(de) : -ENOENT);
         }
 
index 63d26b0..b474283 100644 (file)
@@ -1081,8 +1081,7 @@ int mds_mfd_close(struct ptlrpc_request *req, struct obd_device *obd,
 
                 cleanup_phase = 2; /* dput(pending_child) when finished */
                 if (req != NULL) {
-                        lmm = lustre_msg_buf(req->rq_repmsg,
-                                                                1, 0);
+                        lmm = lustre_msg_buf(req->rq_repmsg, 1, 0);
                         stripe_count = le32_to_cpu(lmm->lmm_stripe_count);
                 }
 
index 28503f2..9d99e9a 100644 (file)
@@ -740,14 +740,14 @@ static int llog_lvfs_destroy(struct llog_handle *handle)
 }
 
 int llog_get_cat_list(struct obd_device *obd, struct obd_device *disk_obd,
-                      char *name, int count, struct llog_logid *idarray)
+                      char *name, int count, struct llog_catid *idarray)
 {
         LBUG();
         return 0;
 }
 
 int llog_put_cat_list(struct obd_device *obd, struct obd_device *disk_obd,
-                      char *name, int count, struct llog_logid *idarray)
+                      char *name, int count, struct llog_catid *idarray)
 {
         LBUG();
         return 0;
index 0d901fd..3aba19a 100644 (file)
@@ -560,10 +560,8 @@ static int filter_cleanup_groups(struct obd_device *obd)
         if (filter->fo_last_objid_files != NULL)
                 OBD_FREE(filter->fo_last_objid_files,
                          FILTER_GROUPS * sizeof(struct file *));
-        if (filter->fo_dentry_O != NULL) {
+        if (filter->fo_dentry_O != NULL)
                 f_dput(filter->fo_dentry_O);
-                filter->fo_dentry_O = NULL;
-        }
         RETURN(0);
 }
 
@@ -1160,6 +1158,9 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf,
 
         dev_clear_rdonly(2);
 
+        if (!lcfg->lcfg_inlbuf1 || !lcfg->lcfg_inlbuf2)
+                RETURN(-EINVAL);
+
         obd->obd_fsops = fsfilt_get_ops(lcfg->lcfg_inlbuf2);
         if (IS_ERR(obd->obd_fsops))
                 RETURN(PTR_ERR(obd->obd_fsops));
index 9863174..f6d8d06 100644 (file)
@@ -40,7 +40,7 @@ int filter_san_setup(struct obd_device *obd, obd_count len, void *buf)
         struct lustre_cfg* lcfg = buf;
         char *option = NULL;
 
-        if (!lcfg->lcfg_inlbuf1 || !lcfg->lcfg_inlbuf2)
+        if (!lcfg->lcfg_inlbuf2)
                 RETURN(-EINVAL);
 
         /* for extN/ext3 filesystem, we must mount it with 'writeback' mode */
index b7cf033..8da018d 100644 (file)
@@ -22,7 +22,7 @@ MDSDEV=${MDSDEV:-/dev/sdc}
 MDSSIZE=${MDSSIZE:-50000}
 MDSJOURNALSIZE=${MDSJOURNALSIZE:-0}
 
-OSTDEV=${OSTDEV:-/tmp/ost-`hostname`}
+OSTDEV=${OSTDEV:-$TMP/ost%d-`hostname`}
 OSTSIZE=${OSTSIZE:=50000}
 OSTJOURNALSIZE=${OSTJOURNALSIZE:-0}
 
index 56a8779..c6de54c 100644 (file)
@@ -16,11 +16,11 @@ MOUNT=${MOUNT:-"/mnt/lustre"}
 #CLIENT_UPCALL=${CLIENT_UPCALL:-`pwd`/client-upcall-mdev.sh}
 UPCALL=${CLIENT_UPCALL:-`pwd`/replay-single-upcall.sh}
 
-MDSDEV=${MDSDEV:-$ROOT/tmp/mds1-`hostname`}
+MDSDEV=${MDSDEV:-$TMP/mds1-`hostname`}
 MDSSIZE=${MDSSIZE:-10000} #50000000
 MDSJOURNALSIZE=${MDSJOURNALSIZE:-0}
 
-OSTDEV=${OSTDEV:-"$ROOT/tmp/ost%d-`hostname`"}
+OSTDEV=${OSTDEV:-"$TMP/ost%d-`hostname`"}
 OSTSIZE=${OSTSIZE:=10000} #50000000
 OSTJOURNALSIZE=${OSTJOURNALSIZE:-0}
 
index ff34d6d..d3f0c6e 100644 (file)
@@ -20,7 +20,7 @@ UPCALL=${CLIENT_UPCALL:-`pwd`/replay-single-upcall.sh}
 MDSDEV=${MDSDEV:-/dev/sda1}
 MDSSIZE=${MDSSIZE:-50000}
 
-OSTDEV=${OSTDEV:-/tmp/ost-`hostname`}
+OSTDEV=${OSTDEV:-$TMP/ost%d-`hostname`}
 OSTSIZE=${OSTSIZE:=50000}
 FSTYPE=${FSTYPE:-ext3}
 STRIPE_BYTES=${STRIPE_BYTES:-1048576} 
index 42b5571..22c6893 100644 (file)
@@ -1,7 +1,6 @@
 #!/bin/bash
 
 set -e
-set -vx
 
 export PATH=`dirname $0`/../utils:$PATH
 LFS=${LFS:-lfs}
index c7090a8..ad0fe67 100755 (executable)
@@ -5,6 +5,7 @@ set -e
 #         bug 2732 2986 2762 2766
 ALWAYS_EXCEPT="17   20b  16   18"
 
+
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 UPCALL=${UPCALL:-$PWD/recovery-small-upcall.sh}
 . $LUSTRE/tests/test-framework.sh
@@ -69,6 +70,12 @@ if [ "$ONLY" == "cleanup" ]; then
     exit
 fi
 
+if [ "$ONLY" == "cleanup" ]; then
+    sysctl -w portals.debug=0 || true
+    cleanup
+    exit
+fi
+
 REFORMAT=--reformat $SETUP
 unset REFORMAT
 
@@ -116,7 +123,6 @@ test_7() {
 }
 run_test 7 "unlink: drop req, drop rep"
 
-
 #bug 1423
 test_8() {
     drop_reply "touch $MOUNT/renamed"    || return 1
@@ -220,19 +226,19 @@ test_16() {
     do_facet client "diff /etc/termcap $MOUNT/termcap"  || return 2
 }
 run_test 16 "timeout bulk put, evict client (2732)"
-  
+
 test_17() {
-#define OBD_FAIL_PTLRPC_BULK_GET_NET 0x504 | OBD_FAIL_ONCE
+# OBD_FAIL_PTLRPC_BULK_GET_NET 0x0503 | OBD_FAIL_ONCE
     # will get evicted here
     sysctl -w lustre.fail_loc=0x80000503
     do_facet client cp /etc/termcap $MOUNT && return 1
 
-    do_facet client "diff /etc/termcap $MOUNT/termcap"  && return 2
+    do_facet client "diff /etc/termcap $MOUNT/termcap"  && return 1
     sysctl -w lustre.fail_loc=0
-    do_facet client "diff /etc/termcap $MOUNT/termcap"  || return 3
+    do_facet client "diff /etc/termcap $MOUNT/termcap"  || return 2
 }
 run_test 17 "timeout bulk get, evict client (2732)"
-  
+
 test_18a() {
     do_facet client mkdir -p $MOUNT/$tdir
     f=$MOUNT/$tdir/$tfile
@@ -266,9 +272,16 @@ test_18b() {
 
     cancel_lru_locks OSC
     pgcache_empty || return 1
+
     # shouldn't have to set stripe size of count==1
     lfs setstripe $f $((128 * 1024)) 0 1
+    lfs setstripe $f2 $((128 * 1024)) 0 1
+
+    do_facet client cp /etc/termcap $f
+    sync
+    # just use this write to trigger the client's eviction from the ost
+    sysctl -w lustre.fail_loc=0x80000503
+    do_facet client dd if=/dev/zero of=$f2 bs=4k count=1
     sync
     sysctl -w lustre.fail_loc=0
     # allow recovery to complete
index 7aff5ec..4331be5 100755 (executable)
@@ -132,7 +132,7 @@ test_5() {
 run_test 5 "Fail OST during iozone"
 
 kbytesfree() {
-   cat /proc/fs/lustre/osc/OSC_*MNT*/kbytesfree | awk '{total+=$1} END {print total}'
+   awk '{total+=$1} END {print total}' /proc/fs/lustre/osc/OSC_*MNT*/kbytesfree
 }
 
 test_6() {
index 3ab2ad8..a6fb3a2 100755 (executable)
@@ -14,7 +14,7 @@ init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
 
 # Skip these tests
-ALWAYS_EXCEPT="45"
+ALWAYS_EXCEPT=""
 
 
 gen_config() {
@@ -823,14 +823,15 @@ run_test 41 "read from a valid osc while other oscs are invalid"
 
 # test MDS recovery after ost failure
 test_42() {
+    blocks=`df $MOUNT | tail -1 | awk '{ print $1 }'`
     createmany -o $DIR/$tfile-%d 800
     replay_barrier ost
     unlinkmany $DIR/$tfile-%d 0 400
     facet_failover ost
     
-    # osc is evicted after
-    df $MOUNT && return 1
-    df $MOUNT || return 2
+    # osc is evicted, fs is smaller
+    blocks_after=`df $MOUNT | tail -1 | awk '{ print $1 }'`
+    [ $blocks_after -lt $blocks ] || return 1
     echo wait for MDS to timeout and recover
     sleep $((TIMEOUT * 2))
     unlinkmany $DIR/$tfile-%d 400 400
@@ -864,24 +865,6 @@ test_44() {
 }
 run_test 44 "race in target handle connect"
 
-test_45() {
-    d=$MOUNT/$tdir
-
-    mkdir $d
-    ls -l $d
-    cp /etc/termcap $d
-    cat $d/termcap > /dev/null
-
-    zconf_umount client $MOUNT -f
-    zconf_mount `hostname` $MOUNT
-
-    rm -rf $d || return 1
-    $CHECKSTAT -t dir $d && return 1 || true
-
-    sleep 10
-}
-run_test 45 "test client eviction after client crash"
-
 equals_msg test complete, cleaning up
 $CLEANUP
 
index 9bf843d..fa0a05a 100644 (file)
@@ -7,7 +7,7 @@
 set -e
 
 ONLY=${ONLY:-"$*"}
-# bug number for skipped test: 
+# bug number for skipped test:
 ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-""}
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
@@ -1133,6 +1133,7 @@ test_34c() {
 run_test 34c "O_RDWR opening file-with-size works =============="
 
 test_34d() {
+       [ ! -f $DIR/f34 ] && test_34a 
        dd if=/dev/zero of=$DIR/f34 conv=notrunc bs=4k count=1 || error
        $CHECKSTAT -s $TEST_34_SIZE $DIR/f34 || error
        rm $DIR/f34
@@ -1878,6 +1879,7 @@ run_test 65d "directory setstripe $STRIPESIZE -1 $sc ======================"
 
 test_65e() {
        mkdir -p $DIR/d65
+
        $LSTRIPE $DIR/d65 0 -1 0 || error "setstripe"
        touch $DIR/d65/f6
        $LVERIFY $DIR/d65 $DIR/d65/f6 || error "lverify failed"
index 2181547..36eceb9 100644 (file)
@@ -126,7 +126,6 @@ reboot_facet() {
 wait_for_host() {
    HOST=$1
    check_network  $HOST 900
-   while ! do_node $HOST "$CHECKSTAT -t dir $LUSTRE"; do sleep 5; done
    while ! do_node $HOST "ls -d $LUSTRE " > /dev/null; do sleep 5; done
 }
 
index 2b3f0e2..ac22336 100755 (executable)
@@ -1113,7 +1113,8 @@ class Network(Module):
                 panic("unable to set hostaddr for", self.net_type, self.hostaddr, self.cluster_id)
             debug("hostaddr:", self.hostaddr)
 
-        self.add_portals_module("libcfs", 'portals')
+        self.add_portals_module("libcfs", 'libcfs')
+        self.add_portals_module("portals", 'portals')
         if node_needs_router():
             self.add_portals_module("router", 'kptlrouter')
         if self.net_type == 'tcp':