From patchwork Sat May 11 08:20:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinar Valeev X-Patchwork-Id: 243116 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 1B76D2C016B for ; Sat, 11 May 2013 18:21:30 +1000 (EST) Received: from mail-ea0-x22f.google.com (mail-ea0-x22f.google.com [IPv6:2a00:1450:4013:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 43E272C0152 for ; Sat, 11 May 2013 18:21:26 +1000 (EST) Received: by mail-ea0-f175.google.com with SMTP id q10so2559074eaj.6 for ; Sat, 11 May 2013 01:21:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=9zEGtuAt7kNmSyQew2nQQwurgLj8qMZhljpBRQcayPU=; b=gAWyF1naxGWHbeKOOPu2mUwSmlyaZlFRI9GOR10DevrAtfzyypxdbx3SyKOklPuEr5 D0C2xgVOm5hn05xLaoyeRRKsYalXet12oSPKgNnDpL6NVrSIMc2iVUpSY4CK8eeRDKbj iKxIsx+fYx4McALQXlHfNgO3Ni1sZVf7JMBY0drYr3BKZuzxNV+qcrzS8/vqtggeKK6t 18XyVtNR50KHy3I6Bd0YKtisuPHJLT1HwIMH0AUZSDI9mxcMpoUQfNN9/inIN09P5zM8 bA4+t89RhNfZSWJCGVAdgeid7cFo0tvrQniRuTDuxI3vfGitn2bTZwcQLydsPISrNanA Su2Q== X-Received: by 10.14.216.201 with SMTP id g49mr20670851eep.42.1368260482430; Sat, 11 May 2013 01:21:22 -0700 (PDT) Received: from petersburg.suse.cz.cz (gw1.mbsirotkova.cz.gsnet.cz. [92.43.26.62]) by mx.google.com with ESMTPSA id bj12sm8567467eeb.8.2013.05.11.01.21.21 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 11 May 2013 01:21:21 -0700 (PDT) From: Dinar valeev To: yaboot-devel@lists.ozlabs.org Subject: [PATCH 2/2] Fix partitions bigger than 2TB Date: Sat, 11 May 2013 10:20:10 +0200 Message-Id: <1368260410-31303-2-git-send-email-k0da@opensuse.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1368260410-31303-1-git-send-email-k0da@opensuse.org> References: <1368260410-31303-1-git-send-email-k0da@opensuse.org> Cc: Dinar Valeev X-BeenThere: yaboot-devel@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Technical and development discussion regarding yaboot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: yaboot-devel-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Yaboot-devel" From: Dinar Valeev Partitions which are bigger than 2TB doesn't fit unsigned long, change it ot unsigned long long. Signed-off-by: Dinar Valeev --- include/partition.h | 4 ++-- second/file.c | 2 +- second/fs_ext2.c | 4 ++-- second/partition.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) 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/fs_ext2.c b/second/fs_ext2.c index a85958f..742af27 100644 --- a/second/fs_ext2.c +++ b/second/fs_ext2.c @@ -164,8 +164,8 @@ ext2_open( struct boot_file_t* file, */ doff = dend = 0; if (part) { - doff = (unsigned long long)(part->part_start) * part->blocksize; - dend = doff + (unsigned long long)part->part_size * part->blocksize; + doff = part->part_start * part->blocksize; + dend = doff + part->part_size * part->blocksize; } cur_file = file; diff --git a/second/partition.c b/second/partition.c index 7facbc4..64b4725 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, 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);