From 29f8cd0a30bbdfecbe00123ccc3f1fcda63f7cf1 Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 1 Apr 2004 12:03:07 +0000 Subject: [PATCH] Minor changes to sync b1_2 with HEAD that shouldn't affect anything. --- lustre/include/liblustre.h | 4 ++++ lustre/include/linux/lustre_compat25.h | 10 +++++----- lustre/include/linux/obd_support.h | 7 +++++++ lustre/ldlm/l_lock.c | 1 + lustre/ldlm/ldlm_flock.c | 2 +- lustre/ldlm/ldlm_internal.h | 29 ++++++++++++++++++++++++++--- lustre/mds/mds_fs.c | 3 ++- lustre/mds/mds_open.c | 3 +-- lustre/obdclass/llog_lvfs.c | 4 ++-- lustre/obdfilter/filter.c | 7 ++++--- lustre/obdfilter/filter_san.c | 2 +- lustre/tests/cfg/insanity-adev.sh | 2 +- lustre/tests/cfg/insanity-local.sh | 4 ++-- lustre/tests/cfg/insanity-mdev.sh | 2 +- lustre/tests/oos2.sh | 1 - lustre/tests/recovery-small.sh | 27 ++++++++++++++++++++------- lustre/tests/replay-ost-single.sh | 2 +- lustre/tests/replay-single.sh | 27 +++++---------------------- lustre/tests/sanity.sh | 4 +++- lustre/tests/test-framework.sh | 1 - lustre/utils/lconf | 3 ++- 21 files changed, 89 insertions(+), 56 deletions(-) diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index 287f4f9..d859bfc 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -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 diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index fb97fa6..58ba03e 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -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<ns_lock)) { CERROR("namespace %s lock held illegally; tell phil\n", ns->ns_name); + } } #endif /* __KERNEL__ */ diff --git a/lustre/ldlm/ldlm_flock.c b/lustre/ldlm/ldlm_flock.c index 148be59..b1c5b2f 100644 --- a/lustre/ldlm/ldlm_flock.c +++ b/lustre/ldlm/ldlm_flock.c @@ -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); } diff --git a/lustre/ldlm/ldlm_internal.h b/lustre/ldlm/ldlm_internal.h index edee657..d0b081c 100644 --- a/lustre/ldlm/ldlm_internal.h +++ b/lustre/ldlm/ldlm_internal.h @@ -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 + * Author: Phil Schwan + * + * 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, diff --git a/lustre/mds/mds_fs.c b/lustre/mds/mds_fs.c index 774e72b..c4d0d11 100644 --- a/lustre/mds/mds_fs.c +++ b/lustre/mds/mds_fs.c @@ -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); } diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 63d26b0..b474283 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -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); } diff --git a/lustre/obdclass/llog_lvfs.c b/lustre/obdclass/llog_lvfs.c index 28503f2..9d99e9a 100644 --- a/lustre/obdclass/llog_lvfs.c +++ b/lustre/obdclass/llog_lvfs.c @@ -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; diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 0d901fd..3aba19a 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -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)); diff --git a/lustre/obdfilter/filter_san.c b/lustre/obdfilter/filter_san.c index 9863174..f6d8d06 100644 --- a/lustre/obdfilter/filter_san.c +++ b/lustre/obdfilter/filter_san.c @@ -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 */ diff --git a/lustre/tests/cfg/insanity-adev.sh b/lustre/tests/cfg/insanity-adev.sh index b7cf033..8da018d 100644 --- a/lustre/tests/cfg/insanity-adev.sh +++ b/lustre/tests/cfg/insanity-adev.sh @@ -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} diff --git a/lustre/tests/cfg/insanity-local.sh b/lustre/tests/cfg/insanity-local.sh index 56a8779..c6de54c 100644 --- a/lustre/tests/cfg/insanity-local.sh +++ b/lustre/tests/cfg/insanity-local.sh @@ -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} diff --git a/lustre/tests/cfg/insanity-mdev.sh b/lustre/tests/cfg/insanity-mdev.sh index ff34d6d..d3f0c6e 100644 --- a/lustre/tests/cfg/insanity-mdev.sh +++ b/lustre/tests/cfg/insanity-mdev.sh @@ -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} diff --git a/lustre/tests/oos2.sh b/lustre/tests/oos2.sh index 42b5571..22c6893 100644 --- a/lustre/tests/oos2.sh +++ b/lustre/tests/oos2.sh @@ -1,7 +1,6 @@ #!/bin/bash set -e -set -vx export PATH=`dirname $0`/../utils:$PATH LFS=${LFS:-lfs} diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index c7090a8..ad0fe67 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -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 diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh index 7aff5ec..4331be5 100755 --- a/lustre/tests/replay-ost-single.sh +++ b/lustre/tests/replay-ost-single.sh @@ -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() { diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 3ab2ad8..a6fb3a2 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -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 diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 9bf843d..fa0a05a 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 2181547..36eceb9 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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 } diff --git a/lustre/utils/lconf b/lustre/utils/lconf index 2b3f0e2..ac22336 100755 --- a/lustre/utils/lconf +++ b/lustre/utils/lconf @@ -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': -- 1.8.3.1