[kernel] r14634 - in dists/sid/linux-2.6/debian: . patches/bugfix/all patches/series

Ben Hutchings benh at alioth.debian.org
Sun Nov 15 18:25:27 UTC 2009


Author: benh
Date: Sun Nov 15 18:25:26 2009
New Revision: 14634

Log:
Revert dm-snapshot ABI change in 2.6.31.6

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/all/dm-snapshot-use-unsigned-integer-chunk-size.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/2

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	Sun Nov 15 18:12:26 2009	(r14633)
+++ dists/sid/linux-2.6/debian/changelog	Sun Nov 15 18:25:26 2009	(r14634)
@@ -23,6 +23,7 @@
       in all cases (CVE-2009-3624)
     - netlink: fix typo in initialization (CVE-2009-3612)
   * Undo PCMCIA ABI change in 2.6.31.6
+  * Revert dm-snapshot ABI change in 2.6.31.6
   * Hide wireless keys and wake-on-LAN password when including network
     configuration in bug reports
   * Add Geode LX/NX to list of 686-class processors

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/dm-snapshot-use-unsigned-integer-chunk-size.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/dm-snapshot-use-unsigned-integer-chunk-size.patch	Sun Nov 15 18:25:26 2009	(r14634)
@@ -0,0 +1,179 @@
+From e676b2bd4553802a0b6211d5cca7fb3358ce66cf Mon Sep 17 00:00:00 2001
+From: Mikulas Patocka <mpatocka at redhat.com>
+Date: Fri, 16 Oct 2009 23:18:17 +0100
+Subject: [PATCH] dm snapshot: use unsigned integer chunk size
+
+commit df96eee679ba28c98cf722fa7c9f4286ee1ed0bd upstream.
+
+Use unsigned integer chunk size.
+
+Maximum chunk size is 512kB, there won't ever be need to use 4GB chunk size,
+so the number can be 32-bit. This fixes compiler failure on 32-bit systems
+with large block devices.
+
+Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>
+Signed-off-by: Mike Snitzer <snitzer at redhat.com>
+Reviewed-by: Jonathan Brassow <jbrassow at redhat.com>
+Signed-off-by: Alasdair G Kergon <agk at redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
+---
+ drivers/md/dm-exception-store.c |   20 +++++++++++---------
+ drivers/md/dm-exception-store.h |    8 ++++----
+ drivers/md/dm-snap-persistent.c |   16 ++++++++--------
+ drivers/md/dm-snap.c            |    4 ++--
+ 4 files changed, 25 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c
+index e5de762..932d1b1 100644
+--- a/drivers/md/dm-exception-store.c
++++ b/drivers/md/dm-exception-store.c
+@@ -155,7 +155,8 @@ static int set_chunk_size(struct dm_exception_store *store,
+ 	char *value;
+ 
+ 	chunk_size_ulong = simple_strtoul(chunk_size_arg, &value, 10);
+-	if (*chunk_size_arg == '\0' || *value != '\0') {
++	if (*chunk_size_arg == '\0' || *value != '\0' ||
++	    chunk_size_ulong > UINT_MAX) {
+ 		*error = "Invalid chunk size";
+ 		return -EINVAL;
+ 	}
+@@ -171,34 +172,35 @@ static int set_chunk_size(struct dm_exception_store *store,
+ 	 */
+ 	chunk_size_ulong = round_up(chunk_size_ulong, PAGE_SIZE >> 9);
+ 
+-	return dm_exception_store_set_chunk_size(store, chunk_size_ulong,
++	return dm_exception_store_set_chunk_size(store,
++						 (unsigned) chunk_size_ulong,
+ 						 error);
+ }
+ 
+ int dm_exception_store_set_chunk_size(struct dm_exception_store *store,
+-				      unsigned long chunk_size_ulong,
++				      unsigned chunk_size,
+ 				      char **error)
+ {
+ 	/* Check chunk_size is a power of 2 */
+-	if (!is_power_of_2(chunk_size_ulong)) {
++	if (!is_power_of_2(chunk_size)) {
+ 		*error = "Chunk size is not a power of 2";
+ 		return -EINVAL;
+ 	}
+ 
+ 	/* Validate the chunk size against the device block size */
+-	if (chunk_size_ulong % (bdev_logical_block_size(store->cow->bdev) >> 9)) {
++	if (chunk_size % (bdev_logical_block_size(store->cow->bdev) >> 9)) {
+ 		*error = "Chunk size is not a multiple of device blocksize";
+ 		return -EINVAL;
+ 	}
+ 
+-	if (chunk_size_ulong > INT_MAX >> SECTOR_SHIFT) {
++	if (chunk_size > INT_MAX >> SECTOR_SHIFT) {
+ 		*error = "Chunk size is too high";
+ 		return -EINVAL;
+ 	}
+ 
+-	store->chunk_size = chunk_size_ulong;
+-	store->chunk_mask = chunk_size_ulong - 1;
+-	store->chunk_shift = ffs(chunk_size_ulong) - 1;
++	store->chunk_size = chunk_size;
++	store->chunk_mask = chunk_size - 1;
++	store->chunk_shift = ffs(chunk_size) - 1;
+ 
+ 	return 0;
+ }
+diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h
+index 812c718..8a223a4 100644
+--- a/drivers/md/dm-exception-store.h
++++ b/drivers/md/dm-exception-store.h
+@@ -101,9 +101,9 @@ struct dm_exception_store {
+ 	struct dm_dev *cow;
+ 
+ 	/* Size of data blocks saved - must be a power of 2 */
+-	chunk_t chunk_size;
+-	chunk_t chunk_mask;
+-	chunk_t chunk_shift;
++	unsigned chunk_size;
++	unsigned chunk_mask;
++	unsigned chunk_shift;
+ 
+ 	void *context;
+ };
+@@ -169,7 +169,7 @@ int dm_exception_store_type_register(struct dm_exception_store_type *type);
+ int dm_exception_store_type_unregister(struct dm_exception_store_type *type);
+ 
+ int dm_exception_store_set_chunk_size(struct dm_exception_store *store,
+-				      unsigned long chunk_size_ulong,
++				      unsigned chunk_size,
+ 				      char **error);
+ 
+ int dm_exception_store_create(struct dm_target *ti, int argc, char **argv,
+diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c
+index d5b2e08..0c74642 100644
+--- a/drivers/md/dm-snap-persistent.c
++++ b/drivers/md/dm-snap-persistent.c
+@@ -284,12 +284,13 @@ static int read_header(struct pstore *ps, int *new_snapshot)
+ {
+ 	int r;
+ 	struct disk_header *dh;
+-	chunk_t chunk_size;
++	unsigned chunk_size;
+ 	int chunk_size_supplied = 1;
+ 	char *chunk_err;
+ 
+ 	/*
+-	 * Use default chunk size (or hardsect_size, if larger) if none supplied
++	 * Use default chunk size (or logical_block_size, if larger)
++	 * if none supplied
+ 	 */
+ 	if (!ps->store->chunk_size) {
+ 		ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS,
+@@ -334,10 +335,9 @@ static int read_header(struct pstore *ps, int *new_snapshot)
+ 		return 0;
+ 
+ 	if (chunk_size_supplied)
+-		DMWARN("chunk size %llu in device metadata overrides "
+-		       "table chunk size of %llu.",
+-		       (unsigned long long)chunk_size,
+-		       (unsigned long long)ps->store->chunk_size);
++		DMWARN("chunk size %u in device metadata overrides "
++		       "table chunk size of %u.",
++		       chunk_size, ps->store->chunk_size);
+ 
+ 	/* We had a bogus chunk_size. Fix stuff up. */
+ 	free_area(ps);
+@@ -345,8 +345,8 @@ static int read_header(struct pstore *ps, int *new_snapshot)
+ 	r = dm_exception_store_set_chunk_size(ps->store, chunk_size,
+ 					      &chunk_err);
+ 	if (r) {
+-		DMERR("invalid on-disk chunk size %llu: %s.",
+-		      (unsigned long long)chunk_size, chunk_err);
++		DMERR("invalid on-disk chunk size %u: %s.",
++		      chunk_size, chunk_err);
+ 		return r;
+ 	}
+ 
+diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
+index 9bc814a..3a3ba46 100644
+--- a/drivers/md/dm-snap.c
++++ b/drivers/md/dm-snap.c
+@@ -961,7 +961,7 @@ static void start_copy(struct dm_snap_pending_exception *pe)
+ 
+ 	src.bdev = bdev;
+ 	src.sector = chunk_to_sector(s->store, pe->e.old_chunk);
+-	src.count = min(s->store->chunk_size, dev_size - src.sector);
++	src.count = min((sector_t)s->store->chunk_size, dev_size - src.sector);
+ 
+ 	dest.bdev = s->store->cow->bdev;
+ 	dest.sector = chunk_to_sector(s->store, pe->e.new_chunk);
+@@ -1402,7 +1402,7 @@ static void origin_resume(struct dm_target *ti)
+ 	struct dm_dev *dev = ti->private;
+ 	struct dm_snapshot *snap;
+ 	struct origin *o;
+-	chunk_t chunk_size = 0;
++	unsigned chunk_size = 0;
+ 
+ 	down_read(&_origins_lock);
+ 	o = __lookup_origin(dev->bdev);
+-- 
+1.6.5.2
+

Modified: dists/sid/linux-2.6/debian/patches/series/2
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/2	Sun Nov 15 18:12:26 2009	(r14633)
+++ dists/sid/linux-2.6/debian/patches/series/2	Sun Nov 15 18:25:26 2009	(r14634)
@@ -7,3 +7,4 @@
 + bugfix/arm/isdn-hisax-elsa-build-fix.patch
 + bugfix/all/stable/2.6.31.6.patch
 + bugfix/all/undo-pcmcia-abi-change.patch 
+- bugfix/all/dm-snapshot-use-unsigned-integer-chunk-size.patch



More information about the Kernel-svn-changes mailing list