From patchwork Fri Feb 26 23:36:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonthan Brassow X-Patchwork-Id: 82508 Received: from mx01.colomx.prod.int.phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1QNkEDR016606 for ; Fri, 26 Feb 2010 23:46:50 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx01.colomx.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1QNi45X002533; Fri, 26 Feb 2010 18:44:05 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1QNau7P021749 for ; Fri, 26 Feb 2010 18:36:56 -0500 Received: from hydrogen.msp.redhat.com (hydrogen.msp.redhat.com [10.15.80.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1QNaoTM029028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 26 Feb 2010 18:36:51 -0500 Received: from hydrogen.msp.redhat.com (localhost.localdomain [127.0.0.1]) by hydrogen.msp.redhat.com (8.14.1/8.14.1) with ESMTP id o1QNaodl024497 for ; Fri, 26 Feb 2010 17:36:50 -0600 Received: (from jbrassow@localhost) by hydrogen.msp.redhat.com (8.14.1/8.14.1/Submit) id o1QNaooR024496 for dm-devel@redhat.com; Fri, 26 Feb 2010 17:36:50 -0600 Date: Fri, 26 Feb 2010 17:36:50 -0600 From: Jonathan Brassow Message-Id: <201002262336.o1QNaooR024496@hydrogen.msp.redhat.com> To: dm-devel@redhat.com X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH 7 of 10] LVM: monitor mirrored logs X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 26 Feb 2010 23:46:50 +0000 (UTC) Index: LVM2/lib/activate/activate.c =================================================================== --- LVM2.orig/lib/activate/activate.c +++ LVM2/lib/activate/activate.c @@ -737,6 +737,7 @@ int monitor_dev_for_events(struct cmd_co int r = 1; struct dm_list *tmp, *snh, *snht; struct lv_segment *seg; + struct lv_segment *log_seg; int (*monitor_fn) (struct lv_segment *s, int e); uint32_t s; @@ -772,6 +773,16 @@ int monitor_dev_for_events(struct cmd_co return r; } + /* + * If the volume is mirrored and its log is also mirrored, monitor + * the log volume as well. + */ + if ((seg = first_seg(lv)) != NULL && seg->log_lv != NULL && + (log_seg = first_seg(seg->log_lv)) != NULL && + seg_is_mirrored(log_seg)) + if (!monitor_dev_for_events(cmd, seg->log_lv, monitor)) + r = 0; + dm_list_iterate(tmp, &lv->segments) { seg = dm_list_item(tmp, struct lv_segment);