From mboxrd@z Thu Jan 1 00:00:00 1970 From: jbrassow@sourceware.org Date: 3 Oct 2007 19:02:53 -0000 Subject: [Cluster-devel] cluster/cmirror-kernel/src dm-cmirror-client.c ... Message-ID: <20071003190253.6439.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: cluster Branch: RHEL4 Changes by: jbrassow at sourceware.org 2007-10-03 19:02:52 Modified files: cmirror-kernel/src: dm-cmirror-client.c dm-cmirror-server.c Log message: Bug 316031: dm-mirror: incorrect order of mirror presuspend ops caus... With kernel (dm-raid1.c) presuspend changes, we can now tell when recovery has been shutdown and when we can allow blocked writes. This should fix a hang issue when converting from one mirror type to another. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-client.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.54&r2=1.1.2.55 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-server.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.40&r2=1.1.2.41 --- cluster/cmirror-kernel/src/Attic/dm-cmirror-client.c 2007/09/27 20:31:18 1.1.2.54 +++ cluster/cmirror-kernel/src/Attic/dm-cmirror-client.c 2007/10/03 19:02:51 1.1.2.55 @@ -592,6 +592,8 @@ * should start out suspended. */ atomic_set(&lc->suspended, 1); + lc->recovery_halted = 1; + DMDEBUG("Secondary log... suspended and recovery_halted"); } } @@ -764,6 +766,11 @@ static int cluster_presuspend(struct dirty_log *log) { + struct log_c *lc = (struct log_c *) log->context; + + DMDEBUG("cluster_presuspend: recovery halted on %s(%d)", + lc->uuid + (strlen(lc->uuid) - 8), lc->uuid_ref); + lc->recovery_halted = 1; return 0; } @@ -834,8 +841,9 @@ struct log_c *lc = (struct log_c *) log->context; lc->sync_search = 0; - lc->recovery_halted = 0; resume_server_requests(); + DMDEBUG("cluster_resume: Setting recovery_halted = 0"); + lc->recovery_halted = 0; atomic_set(&lc->suspended, 0); return 0; @@ -1253,6 +1261,8 @@ (atomic_read(&tmp_lc->in_sync)) ? "YES" : "NO"); DMDEBUG(" suspended : %s", (atomic_read(&tmp_lc->suspended)) ? "YES" : "NO"); + DMDEBUG(" recovery_halted : %s", + (tmp_lc->recovery_halted) ? "YES" : "NO"); DMDEBUG(" server_id : %u", tmp_lc->server_id); DMDEBUG(" server_valid: %s", ((tmp_lc->server_id != 0xDEAD) && --- cluster/cmirror-kernel/src/Attic/dm-cmirror-server.c 2007/09/27 20:31:18 1.1.2.40 +++ cluster/cmirror-kernel/src/Attic/dm-cmirror-server.c 2007/10/03 19:02:51 1.1.2.41 @@ -468,9 +468,15 @@ lr->u.lr_int_rtn = 1; /* Try to make this region a priority */ + /* if ((lr->u.lr_region != lc->recovering_region) && (lc->recovering_next == (uint64_t)-1)) lc->recovering_next = lr->u.lr_region; + */ + if ((lr->u.lr_region != lc->recovering_region) && + ((lc->recovering_next == (uint64_t)-1) || + (lc->recovering_next > lr->u.lr_region))) + lc->recovering_next = lr->u.lr_region; return 0; } @@ -728,6 +734,7 @@ * failed. In this case, there will not be a record for * the region. */ + DMDEBUG("server_complete_resync_work - Setting recovery_halted = 1"); lc->recovery_halted = 1; ru = find_ru(lc, who, lr->u.lr_region);