From patchwork Mon Apr 27 11:45:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 20123 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 n3RBj7dt006269 for ; Mon, 27 Apr 2009 11:45:08 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 7D46E61953D; Mon, 27 Apr 2009 07:45:07 -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 n3RBj5fr006287 for ; Mon, 27 Apr 2009 07:45:05 -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 n3RBj45G019943; Mon, 27 Apr 2009 07:45:04 -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 n3RBj4sj021361; Mon, 27 Apr 2009 07:45:04 -0400 Received: from localhost (mpatocka@localhost) by hs20-bc2-1.build.redhat.com (8.13.1/8.13.1/Submit) with ESMTP id n3RBj4Et021355; Mon, 27 Apr 2009 07:45:04 -0400 X-Authentication-Warning: hs20-bc2-1.build.redhat.com: mpatocka owned process doing -bs Date: Mon, 27 Apr 2009 07:45:04 -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 1/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 Accept empty barriers in dm-io. dm-io will process empty write barrier requests just like the other read/write requests. Signed-off-by: Mikulas Patocka --- drivers/md/dm-io.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 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-io.c =================================================================== --- linux-2.6.30-rc2-devel.orig/drivers/md/dm-io.c 2009-04-24 09:24:26.000000000 +0200 +++ linux-2.6.30-rc2-devel/drivers/md/dm-io.c 2009-04-24 09:27:07.000000000 +0200 @@ -285,8 +285,12 @@ static void do_region(int rw, unsigned r unsigned offset; unsigned num_bvecs; sector_t remaining = where->count; + /* + * "count" may be zero when "rw" indicates a write barrier request. + * In this case, we must send a zero-sized barrier. + */ - while (remaining) { + do { /* * Allocate a suitably sized-bio: we add an extra * bvec for bio_get/set_region() and decrement bi_max_vecs @@ -323,7 +327,7 @@ static void do_region(int rw, unsigned r atomic_inc(&io->count); submit_bio(rw, bio); - } + } while (remaining); } static void dispatch_io(int rw, unsigned int num_regions, @@ -342,7 +346,7 @@ static void dispatch_io(int rw, unsigned */ for (i = 0; i < num_regions; i++) { *dp = old_pages; - if (where[i].count) + if (where[i].count || (rw & (1 << BIO_RW_BARRIER))) do_region(rw, i, where + i, dp, io); }