#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
#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)
#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
#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)
#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
} \
} 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
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");
if (l_has_lock(&ns->ns_lock)) {
CERROR("namespace %s lock held illegally; tell phil\n",
ns->ns_name);
+ }
}
#endif /* __KERNEL__ */
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);
}
+/* -*- 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,
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);
}
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);
}
}
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;
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);
}
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));
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 */
MDSSIZE=${MDSSIZE:-50000}
MDSJOURNALSIZE=${MDSJOURNALSIZE:-0}
-OSTDEV=${OSTDEV:-/tmp/ost-`hostname`}
+OSTDEV=${OSTDEV:-$TMP/ost%d-`hostname`}
OSTSIZE=${OSTSIZE:=50000}
OSTJOURNALSIZE=${OSTJOURNALSIZE:-0}
#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}
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}
#!/bin/bash
set -e
-set -vx
export PATH=`dirname $0`/../utils:$PATH
LFS=${LFS:-lfs}
# 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
exit
fi
+if [ "$ONLY" == "cleanup" ]; then
+ sysctl -w portals.debug=0 || true
+ cleanup
+ exit
+fi
+
REFORMAT=--reformat $SETUP
unset REFORMAT
}
run_test 7 "unlink: drop req, drop rep"
-
#bug 1423
test_8() {
drop_reply "touch $MOUNT/renamed" || return 1
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
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
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() {
. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
# Skip these tests
-ALWAYS_EXCEPT="45"
+ALWAYS_EXCEPT=""
gen_config() {
# 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
}
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
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!
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
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"
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
}
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':