From patchwork Mon Apr 27 11:51:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 20131 X-Patchwork-Delegate: agk@redhat.com Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3RBpQga006869 for ; Mon, 27 Apr 2009 11:51:26 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 5D4A26196FC; Mon, 27 Apr 2009 07:51:26 -0400 (EDT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n3RBpOre007041 for ; Mon, 27 Apr 2009 07:51:24 -0400 Received: from hs20-bc2-1.build.redhat.com (hs20-bc2-1.build.redhat.com [10.10.28.34]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3RBpNwY023810; Mon, 27 Apr 2009 07:51:24 -0400 Received: from hs20-bc2-1.build.redhat.com (localhost.localdomain [127.0.0.1]) by hs20-bc2-1.build.redhat.com (8.13.1/8.13.1) with ESMTP id n3RBpNvr022567; Mon, 27 Apr 2009 07:51:23 -0400 Received: from localhost (mpatocka@localhost) by hs20-bc2-1.build.redhat.com (8.13.1/8.13.1/Submit) with ESMTP id n3RBpNmk022561; Mon, 27 Apr 2009 07:51:23 -0400 X-Authentication-Warning: hs20-bc2-1.build.redhat.com: mpatocka owned process doing -bs Date: Mon, 27 Apr 2009 07:51:23 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@hs20-bc2-1.build.redhat.com To: dm-devel@redhat.com In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-loop: dm-devel@redhat.com Cc: Heinz Mauelshagen , Alasdair G Kergon Subject: [dm-devel] [PATCH 7/8] raid1 barriers X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com Call the flush callback from the log. If flush failed, we need to mark the whole log as dirty. Also, set variable flush_failed, which prevents any bits ever being marked as free. Signed-off-by: Mikulas Patocka --- drivers/md/dm-log.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel Index: linux-2.6.30-rc2-devel/drivers/md/dm-log.c =================================================================== --- linux-2.6.30-rc2-devel.orig/drivers/md/dm-log.c 2009-04-27 12:48:34.000000000 +0200 +++ linux-2.6.30-rc2-devel/drivers/md/dm-log.c 2009-04-27 12:49:00.000000000 +0200 @@ -679,6 +679,20 @@ static int disk_flush(struct dm_dirty_lo if (!lc->touched_cleaned && !lc->touched_dirtied) return 0; + if (lc->touched_cleaned && flush) { + if (flush(cookie)) { + /* + * At this point it is impossible to determine which + * regions are clean and which are dirty. So mark all + * of them dirty. + */ + int i; + lc->flush_failed = 1; + for (i = 0; i < lc->region_count; i++) + log_clear_bit(lc, lc->clean_bits, i); + } + } + r = rw_header(lc, WRITE); if (r) fail_log_device(lc);