Patchwork Fix partitions bigger than 2TB

login
register
mail settings
Submitter Dinar Valeev
Date May 3, 2013, 8:16 p.m.
Message ID <CADqALGTr5-8M_wXF-E0VEiMWhiixafW6gUmxP4Y1sokDxokXAg@mail.gmail.com>
Download mbox | patch
Permalink /patch/241373/
State Under Review
Headers show

Comments

Dinar Valeev - May 3, 2013, 8:16 p.m.
Partitions which are bigger than 2TB doesn't fit unsigned long,
change it ot unsigned long long.
---
 include/partition.h | 4 ++--
 second/file.c       | 2 +-
 second/partition.c  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

           unsigned short part_blocksize, int sys_ind)
 {
      struct partition_t*    part;
@@ -452,7 +452,7 @@ get_part_type(char *device, int partition)
       return '\0';

      for (p = parts; p && !found; p=p->next) {
-      DEBUG_F("number: %02d, start: 0x%08lx, length: 0x%08lx, type:
%s, name: %s\n",
+      DEBUG_F("number: %02d, start: 0x%08Lx, length: 0x%08Lx, type:
%s, name: %s\n",
           p->part_number, p->part_start, p->part_size, p->part_type,
p->part_name);
       if ((partition >= 0) && (partition == p->part_number)) {
            type = strdup(p->part_type);
--
1.8.1.4
Tony Breeds - May 11, 2013, 4:53 a.m.
On Fri, May 03, 2013 at 10:16:24PM +0200, Dinar Valeev wrote:
> Partitions which are bigger than 2TB doesn't fit unsigned long,
> change it ot unsigned long long.

Again you forgot to sign off on the patch.

I can't take these patches without your sign off.

> --- a/second/partition.c
> +++ b/second/partition.c
> @@ -68,7 +68,7 @@ static unsigned char block_buffer[MAX_BLOCK_SIZE];
> 
>  static void
>  add_new_partition(struct partition_t**    list, int part_number,
> const char *part_type,
> -          const char *part_name, unsigned long part_start, unsigned
> long part_size,
> +          const char *part_name, unsigned long long part_start,
> unsigned long long part_size,

As with your previous patch it's whitespace damaged.  You might want to
look at using git send-email as gmail seems to be doign bad things :(

Yours Tony

Patch

diff --git a/include/partition.h b/include/partition.h
index 23c99ba..c9c4d0b 100644
--- a/include/partition.h
+++ b/include/partition.h
@@ -37,8 +37,8 @@  struct partition_t {
     int            part_number;
     char            part_type[MAX_PART_NAME];
         char                    part_name[MAX_PART_NAME];
-    unsigned long          part_start; /* In blocks */
-    unsigned long          part_size; /* In blocks */
+    unsigned long long    part_start; /* In blocks */
+    unsigned long long    part_size; /* In blocks */
     unsigned short        blocksize;
     int            sys_ind; /* fs type */
 };
diff --git a/second/file.c b/second/file.c
index fd081a3..a276a72 100644
--- a/second/file.c
+++ b/second/file.c
@@ -582,7 +582,7 @@  file_block_open(    struct boot_file_t*    file,
       prom_printf("no partitions found.\n");
 #endif
      for (p = parts; p && !found; p=p->next) {
-      DEBUG_F("number: %02d, start: 0x%08lx, length: 0x%08lx\n",
+      DEBUG_F("number: %02d, start: 0x%08Lx, length: 0x%08Lx\n",
           p->part_number, p->part_start, p->part_size );
       if (partition == -1) {
            file->fs = fs_open( file, p, fspec );
diff --git a/second/partition.c b/second/partition.c
index f5be637..6f94722 100644
--- a/second/partition.c
+++ b/second/partition.c
@@ -68,7 +68,7 @@  static unsigned char block_buffer[MAX_BLOCK_SIZE];

 static void
 add_new_partition(struct partition_t**    list, int part_number,
const char *part_type,
-          const char *part_name, unsigned long part_start, unsigned
long part_size,
+          const char *part_name, unsigned long long part_start,
unsigned long long part_size,