From 23705dfce979ae95722b6708d14c54ae490a64f1 Mon Sep 17 00:00:00 2001 From: wangdi Date: Sat, 30 Sep 2006 10:04:42 +0000 Subject: [PATCH] Branch: b_new_cmd fixes for recovery-small 18. 1) we should use ldlm_lock_match in extent lock revokation, since it might happen when obd inactive. and the page should be truncated anyway, even lock match failed. 2) fix osc name of test 18 in recovery-small --- lustre/llite/file.c | 9 +++++---- lustre/tests/recovery-small.sh | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 51e5b74..e042728 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -839,10 +839,11 @@ void ll_pgcache_remove_extent(struct inode *inode, struct lov_stripe_md *lsm, tmpex.l_extent.end = tmpex.l_extent.start + PAGE_CACHE_SIZE - 1; l_flags = LDLM_FL_BLOCK_GRANTED | LDLM_FL_CBPENDING | LDLM_FL_TEST_LOCK; /* check to see if another DLM lock covers this page b=2765 */ - rc2 = obd_match(ll_s2dtexp(inode->i_sb), lsm, LDLM_EXTENT, - &tmpex, LCK_PR | LCK_PW, &l_flags, inode, - &lockh); - if (rc2 == 0 && page->mapping != NULL) { + rc2 = ldlm_lock_match(lock->l_resource->lr_namespace, + l_flags, &lock->l_resource->lr_name, + LDLM_EXTENT, &tmpex, LCK_PR | LCK_PW, &lockh); + + if (rc2 <= 0 && page->mapping != NULL) { struct ll_async_page *llap = llap_cast_private(page); // checking again to account for writeback's lock_page() LL_CDEBUG_PAGE(D_PAGE, page, "truncating\n"); diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index 30270ee..72510d0 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -238,7 +238,7 @@ test_18a() { do_facet client cp /etc/termcap $f sync - local osc2dev=`grep ${ost2_svc}-osc-MDT0000 $LPROC/devices | awk '{print $1}'` + local osc2dev=`grep ${ost2_svc}-osc- $LPROC/devices | egrep -v 'MDT' | awk '{print $1}'` $LCTL --device $osc2dev deactivate || return 3 # my understanding is that there should be nothing in the page # cache after the client reconnects? -- 1.8.3.1