[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Wed May 5 16:34:42 UTC 2010


 gnulib                        |    2 +-
 libparted/fs/ext2/parted_io.c |    8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 1b0b0fd0362da004cd8b9a869273649a700e4630
Author: Jim Meyering <meyering at redhat.com>
Date:   Wed May 5 18:25:38 2010 +0200

    build: update gnulib submodule to latest

diff --git a/gnulib b/gnulib
index 092a816..e2843e3 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 092a81622804491f13fb73f4df610db0db45b35a
+Subproject commit e2843e30e8c2885eb8cbc77e20c4e0f4d562d44d

commit 31d0a1a21631a716736fc6998c0f730230ec1b99
Author: Martin Poole <mpoole at redhat.com>
Date:   Wed May 5 18:24:22 2010 +0200

    ext2: don't overflow when creating a partition of size 2TiB or larger
    
    Without this patch, mkpartfs would succeed in creating an ext2
    partition, but the resulting partition would fail a mkfs.ext2 -f check.
    * libparted/fs/ext2/parted_io.c (do_read): Avoid overflow 32-bit
    sector count overflow for a partition of size 2TiB or larger.
    (do_write): Likewise.
    See http://bugzilla.redhat.com/584057#c16 a reproducer.

diff --git a/libparted/fs/ext2/parted_io.c b/libparted/fs/ext2/parted_io.c
index 522ea98..f6154d6 100644
--- a/libparted/fs/ext2/parted_io.c
+++ b/libparted/fs/ext2/parted_io.c
@@ -82,7 +82,9 @@ static int do_read(void *cookie, void *ptr, blk_t block, blk_t num)
 {
 	struct my_cookie *monster = cookie;
 
-	return ped_geometry_read(monster->geom, ptr, block << (monster->logsize - 9), num << (monster->logsize - 9));
+	return ped_geometry_read(monster->geom, ptr,
+				 (PedSector) block << (monster->logsize - 9),
+				 (PedSector) num << (monster->logsize - 9));
 }
 
 static int do_set_blocksize(void *cookie, int logsize)
@@ -98,8 +100,8 @@ static int do_write(void *cookie, void *ptr, blk_t block, blk_t num)
 	struct my_cookie *monster = cookie;
 
 	return ped_geometry_write(monster->geom, ptr,
-				  block << (monster->logsize - 9),
-				  num << (monster->logsize - 9));
+				  (PedSector) block << (monster->logsize - 9),
+				  (PedSector) num << (monster->logsize - 9));
 }
 
 



More information about the Parted-commits mailing list