From 7d25e03e77b652651c1afb9c418a46d7aad7b476 Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 4 Mar 2004 09:06:21 +0000 Subject: [PATCH] Additional debugging. b=2765 --- lustre/ldlm/ldlm_lock.c | 15 +++++++++++---- lustre/llite/file.c | 8 ++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index eb3c50c..0e7f0b0 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -698,8 +698,13 @@ int ldlm_lock_match(struct ldlm_namespace *ns, int flags, type == LDLM_PLAIN ? res_id->name[3] : policy->l_extent.end); else if (!(flags & LDLM_FL_TEST_LOCK)) /* less verbose for test-only */ - LDLM_DEBUG_NOLOCK("not matched type %u mode %u res "LPU64"/"LPU64, - type, mode, res_id->name[0], res_id->name[1]); + LDLM_DEBUG_NOLOCK("not matched ns %p type %u mode %u res " + LPU64"/"LPU64" ("LPU64" "LPU64")", ns, + type, mode, res_id->name[0], res_id->name[1], + type == LDLM_PLAIN ? res_id->name[2] : + policy->l_extent.start, + type == LDLM_PLAIN ? res_id->name[3] : + policy->l_extent.end); if (old_lock) LDLM_LOCK_PUT(old_lock); @@ -1162,9 +1167,11 @@ void ldlm_lock_dump(int level, struct ldlm_lock *lock, int pos) "write: %d\n", (int)lock->l_req_mode, (int)lock->l_granted_mode, atomic_read(&lock->l_refc), lock->l_readers, lock->l_writers); if (lock->l_resource->lr_type == LDLM_EXTENT) - CDEBUG(level, " Extent: "LPU64" -> "LPU64"\n", + CDEBUG(level, " Extent: "LPU64" -> "LPU64 + " (req "LPU64"-"LPU64")\n", lock->l_policy_data.l_extent.start, - lock->l_policy_data.l_extent.end); + lock->l_policy_data.l_extent.end, + lock->l_req_extent.start, lock->l_req_extent.end); else if (lock->l_resource->lr_type == LDLM_FLOCK) CDEBUG(level, " Pid: %d Extent: "LPU64" -> "LPU64"\n", lock->l_policy_data.l_flock.pid, diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 64579b4..2cbc22e 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -331,7 +331,7 @@ void ll_pgcache_remove_extent(struct inode *inode, struct lov_stripe_md *lsm, struct lustre_handle lockh; ENTRY; - memcpy(&tmpex, &lock->l_policy_data.l_extent, sizeof(tmpex)); + memcpy(&tmpex, &lock->l_policy_data, sizeof(tmpex)); CDEBUG(D_INODE|D_PAGE, "inode %lu(%p) ["LPU64"->"LPU64"] size: %llu\n", inode->i_ino, inode, tmpex.l_extent.start, tmpex.l_extent.end, inode->i_size); @@ -369,7 +369,7 @@ void ll_pgcache_remove_extent(struct inode *inode, struct lov_stripe_md *lsm, * more efficient by associating locks with pages and with * batching writeback under the lock explicitly. */ for (i = start, j = start % count ; i <= end; - tmpex.l_extent.start += PAGE_CACHE_SIZE, j++, i++) { + j++, i++, tmpex.l_extent.start += PAGE_CACHE_SIZE) { LASSERTF(tmpex.l_extent.start< lock->l_policy_data.l_extent.end, LPU64" >= "LPU64" start %lu i %lu end %lu\n", tmpex.l_extent.start, lock->l_policy_data.l_extent.end, @@ -379,7 +379,7 @@ void ll_pgcache_remove_extent(struct inode *inode, struct lov_stripe_md *lsm, if (list_empty(&inode->i_mapping->dirty_pages) && list_empty(&inode->i_mapping->clean_pages) && list_empty(&inode->i_mapping->locked_pages)) { - CDEBUG(D_INODE, "nothing left\n"); + CDEBUG(D_INODE|D_PAGE, "nothing left\n"); ll_pgcache_unlock(inode->i_mapping); break; } @@ -425,12 +425,12 @@ void ll_pgcache_remove_extent(struct inode *inode, struct lov_stripe_md *lsm, } unlock_page(page); page_cache_release(page); + next_index: if (j == count) { i += skip; j = 0; } - } EXIT; } -- 1.8.3.1