From 52b99bc954dbba8a84c732ad9c040db51daa877a Mon Sep 17 00:00:00 2001 From: bwzhou Date: Mon, 12 Nov 2007 07:55:52 +0000 Subject: [PATCH] Branch b1_6 b=13380 revert change of 13129 for a quick fix of 13380 which is under investigation currently. --- lustre/obdclass/obd_mount.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 39d3fe2..19b4fcc 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -1307,26 +1307,28 @@ out_free: RETURN(ERR_PTR(rc)); } -/* We have to wait for everything to finish, including lnet lnd expires, - before it is safe to free the sb */ static void server_wait_finished(struct vfsmount *mnt) { wait_queue_head_t waitq; struct l_wait_info lwi; - int waited = 0; + int retries = 120; init_waitqueue_head(&waitq); - while (atomic_read(&mnt->mnt_count) > 1) { - if (waited && (waited % 30 == 0)) - LCONSOLE_WARN("Mount still busy with %d refs after " - "%d secs\n", atomic_read(&mnt->mnt_count), - waited); + while ((atomic_read(&mnt->mnt_count) > 1) && (retries > 0)) { + LCONSOLE_WARN("Mount still busy with %d refs, waiting for " + "%d secs...\n", + atomic_read(&mnt->mnt_count), retries); + /* Wait for a bit */ - waited += 3; - lwi = LWI_TIMEOUT(cfs_time_seconds(3), NULL, NULL); + retries -= 5; + lwi = LWI_TIMEOUT(5 * HZ, NULL, NULL); l_wait_event(waitq, 0, &lwi); } + if (atomic_read(&mnt->mnt_count) > 1) { + CERROR("Mount %p is still busy (%d refs), giving up.\n", + mnt, atomic_read(&mnt->mnt_count)); + } } static void server_put_super(struct super_block *sb) -- 1.8.3.1