From patchwork Wed Mar 4 21:30:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonthan Brassow X-Patchwork-Id: 9927 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 n24LUnhB030126 for ; Wed, 4 Mar 2009 21:30:50 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 E3C2F618DDD; Wed, 4 Mar 2009 16:30:48 -0500 (EST) Received: from int-mx2.corp.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n24LUlFN018955 for ; Wed, 4 Mar 2009 16:30:48 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n24LUl94030551 for ; Wed, 4 Mar 2009 16:30:47 -0500 Received: from [10.15.80.1] (hydrogen.msp.redhat.com [10.15.80.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n24LUkvS026547 for ; Wed, 4 Mar 2009 16:30:47 -0500 From: Jonathan Brassow To: dm-devel@redhat.com Date: Wed, 04 Mar 2009 15:30:45 -0600 Message-Id: <1236202245.28664.5.camel@hydrogen.msp.redhat.com> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH]: dm-snap-fix-status-output.patch 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 This patch goes over the first round of exception store API patches. Prerequisites are: 1) dm-exception-store-introduce-registry.patch 2) dm-exception-store-move-dm_target-pointer.patch 3) dm-exception-store-move-chunk_fields.patch 4) dm-exception-store-move-cow-pointer.patch 5) dm-snapshot-remove-dm_snap-header-use.patch 6) dm-snapshot-remove-dm_snap-header.patch 7) dm-snapshot-use-DMEMIT-macro-for-status.patch 8) dm-snapshot-move-ctr-parsing-to-exception-store.patch 9) dm-snapshot-move-status-to-exception-store.patch 10) dm-exception-store-generalize-table-args.patch 11) dm-snapshot-new-ctr-table-format.patch 12) dm-snapshot-cleanup.patch 13) dm-snap-minor-fix.patch brassow Failure to take into account what has already been put into the status buffer via 'DMEMIT' will result in the exception store status printing over what snapshot_status put into the buffer. Signed-off-by: Jonathan Brassow --- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel Index: linux-2.6/drivers/md/dm-snap.c =================================================================== --- linux-2.6.orig/drivers/md/dm-snap.c +++ linux-2.6/drivers/md/dm-snap.c @@ -1193,7 +1193,7 @@ static void snapshot_resume(struct dm_ta static int snapshot_status(struct dm_target *ti, status_type_t type, char *result, unsigned int maxlen) { - int sz = 0; + unsigned int sz = 0; struct dm_snapshot *snap = ti->private; switch (type) { @@ -1221,8 +1221,9 @@ static int snapshot_status(struct dm_tar * to make private copies if the output is to * make sense. */ - DMEMIT("%s", snap->origin->name); - snap->store->type->status(snap->store, type, result, maxlen); + DMEMIT("%s ", snap->origin->name); + snap->store->type->status(snap->store, type, + result+sz, maxlen-sz); break; }