Bug#613589: /sbin/cfdisk: Bad Table error after fresh Squeeze install

2012-01-22 Thread Jonathan Nieder
Hi,

Timo Juhani Lindfors wrote:

> thanks for the report. I can reproduce the problem with the attached
> partition table image.

Thanks.  When I try to reproduce this with "cfdisk parttable1.img"
(also with -g or overriding the C/H/S values), I get "FATAL ERROR:
Cannot get disk size".  I guess I should be testing using a vm, but
I'm lazy. :)

Anyway, how about this patch for squeeze?  Possible changelog entry:

  * From upstream: cfdisk: don't use size of device based on cylinders.
Closes: #613589

Patch is against commit 5e5f7dac (changelog: release, 2011-01-25) from
git://git.debian.org/~lamont/util-linux.git.  Seems to build fine,
though that doesn't mean much.

-- >8 --
From: Karel Zak 
Date: Mon, 6 Sep 2010 13:30:48 +0200
Subject: cfdisk: don't use size of device based on cylinders

commit 73356e0553bd9ac00f556891a4798064c0ee6849 upstream.

This patch is enough to make cfdisk usable on non-DOS disks where
partitioning is not based on CHS. cfdisk should not print error
messages for such disks.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=630340
Signed-off-by: Karel Zak 
Signed-off-by: Jonathan Nieder 
---
 fdisk/cfdisk.c |   17 +
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c
index 4fb41529..5b9aaebe 100644
--- a/fdisk/cfdisk.c
+++ b/fdisk/cfdisk.c
@@ -177,7 +177,6 @@ int heads = 0;
 int sectors = 0;
 long long cylinders = 0;
 int cylinder_size = 0; /* heads * sectors */
-long long total_size = 0;  /* actual_size rounded down */
 long long actual_size = 0; /* (in 512-byte sectors) - set using ioctl */
/* explicitly given user values */
 int user_heads = 0, user_sectors = 0;
@@ -879,7 +878,7 @@ del_part(int i) {
 if (i < num_parts - 1)
p_info[i].last_sector = p_info[i+1].first_sector - 1;
 else
-   p_info[i].last_sector = total_size - 1;
+   p_info[i].last_sector = actual_size - 1;
 
 p_info[i].offset = 0;
 p_info[i].flags = 0;
@@ -928,7 +927,7 @@ add_part(int num, int id, int flags, long long first, long 
long last,
return -1;
 }
 
-if (first >= total_size) {
+if (first >= actual_size) {
*errmsg = _("Partition begins after end-of-disk");
return -1;
 }
@@ -938,11 +937,6 @@ add_part(int num, int id, int flags, long long first, long 
long last,
return -1;
 }
 
-if (last >= total_size) {
-   *errmsg = _("Partition ends in the final partial cylinder");
-   return -1;
-}
-
 for (i = 0; i < num_parts; i++) {
if (p_info[i].id > 0 && IS_PRIMARY(p_info[i].num))
pri++;
@@ -1637,8 +1631,7 @@ decide_on_geometry(void) {
 if (user_cylinders > 0)
cylinders = user_cylinders;
 
-total_size = cylinder_size*cylinders;
-if (total_size > actual_size)
+if (cylinder_size * cylinders > actual_size)
print_warning(_("You specified more cylinders than fit on disk"));
 }
 
@@ -1646,7 +1639,7 @@ static void
 clear_p_info(void) {
 num_parts = 1;
 p_info[0].first_sector = 0;
-p_info[0].last_sector = total_size - 1;
+p_info[0].last_sector = actual_size - 1;
 p_info[0].offset = 0;
 p_info[0].flags = 0;
 p_info[0].id = FREE_SPACE;
@@ -2429,7 +2422,7 @@ change_geometry(void) {
 if (ret_val) {
long long disk_end;
 
-   disk_end = total_size-1;
+   disk_end = actual_size-1;
 
if (p_info[num_parts-1].last_sector > disk_end) {
while (p_info[num_parts-1].first_sector > disk_end) {
-- 
1.7.9.rc2




-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#613589: /sbin/cfdisk: Bad Table error after fresh Squeeze install

2011-12-11 Thread Jonathan Nieder
tags 613589 + upstream patch fixed-upstream
quit

Karel Zak wrote:

>  Fixed by commit 73356e0553bd9ac00f556891a4798064c0ee6849 (v2.19).

Thanks; marking accordingly.

LaMont et al: would this fix be worth cherry-picking to squeeze?



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#613589: /sbin/cfdisk: Bad Table error after fresh Squeeze install

2011-04-14 Thread Karel Zak
On Thu, Apr 14, 2011 at 09:28:05AM +0200, Olaf van der Spek wrote:
> On Thu, Apr 14, 2011 at 9:19 AM, Karel Zak  wrote:
> > On Wed, Apr 13, 2011 at 09:36:28AM +0200, Olaf van der Spek wrote:
> >> On Wed, Apr 13, 2011 at 9:33 AM, Timo Juhani Lindfors
> >>  wrote:
> >> > Olaf van der Spek  writes:
> >> >> In that case it should be forwarded upstream.
> >> >
> >> > Sure, but I couldn't find the upstream BTS. I was just adding extra info
> >> > to the bug report since I hit the same bug.
> >>
> >> Let's CC the author of the patch.
> >>
> >> Hi Karel,
> >>
> >> We're hitting a check you added to this utility. We think it's a bug.
> >> Could you have a look at it?
> >>
> >> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613589
> >
> >  Fixed by commit 73356e0553bd9ac00f556891a4798064c0ee6849 (v2.19).
> 
> Thanks. Do you know where the upstream bug tracker can be found?

We don't have upstream bug tracker. I prefer
 
downstream -> patch -> upstream 

and I'd like to keep upstream focused on development and I don't want
to do support for end-users. This model works fine in last 5 years.

If you are not sure about any issue then you can ask at upstream
mailing list.

http://userweb.kernel.org/~kzak/util-linux/


  Karel

-- 
 Karel Zak  
 http://karelzak.blogspot.com



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#613589: /sbin/cfdisk: Bad Table error after fresh Squeeze install

2011-04-14 Thread Karel Zak
On Wed, Apr 13, 2011 at 09:36:28AM +0200, Olaf van der Spek wrote:
> On Wed, Apr 13, 2011 at 9:33 AM, Timo Juhani Lindfors
>  wrote:
> > Olaf van der Spek  writes:
> >> In that case it should be forwarded upstream.
> >
> > Sure, but I couldn't find the upstream BTS. I was just adding extra info
> > to the bug report since I hit the same bug.
> 
> Let's CC the author of the patch.
> 
> Hi Karel,
> 
> We're hitting a check you added to this utility. We think it's a bug.
> Could you have a look at it?
> 
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613589

 Fixed by commit 73356e0553bd9ac00f556891a4798064c0ee6849 (v2.19).

Karel

-- 
 Karel Zak  
 http://karelzak.blogspot.com



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#613589: /sbin/cfdisk: Bad Table error after fresh Squeeze install

2011-04-14 Thread Olaf van der Spek
On Thu, Apr 14, 2011 at 9:19 AM, Karel Zak  wrote:
> On Wed, Apr 13, 2011 at 09:36:28AM +0200, Olaf van der Spek wrote:
>> On Wed, Apr 13, 2011 at 9:33 AM, Timo Juhani Lindfors
>>  wrote:
>> > Olaf van der Spek  writes:
>> >> In that case it should be forwarded upstream.
>> >
>> > Sure, but I couldn't find the upstream BTS. I was just adding extra info
>> > to the bug report since I hit the same bug.
>>
>> Let's CC the author of the patch.
>>
>> Hi Karel,
>>
>> We're hitting a check you added to this utility. We think it's a bug.
>> Could you have a look at it?
>>
>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613589
>
>  Fixed by commit 73356e0553bd9ac00f556891a4798064c0ee6849 (v2.19).

Thanks. Do you know where the upstream bug tracker can be found?


-- 
Olaf



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#613589: /sbin/cfdisk: Bad Table error after fresh Squeeze install

2011-04-13 Thread Olaf van der Spek
On Wed, Apr 13, 2011 at 9:33 AM, Timo Juhani Lindfors
 wrote:
> Olaf van der Spek  writes:
>> In that case it should be forwarded upstream.
>
> Sure, but I couldn't find the upstream BTS. I was just adding extra info
> to the bug report since I hit the same bug.

Let's CC the author of the patch.

Hi Karel,

We're hitting a check you added to this utility. We think it's a bug.
Could you have a look at it?

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613589

-- 
Olaf



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#613589: /sbin/cfdisk: Bad Table error after fresh Squeeze install

2011-04-13 Thread Timo Juhani Lindfors
Olaf van der Spek  writes:
> In that case it should be forwarded upstream.

Sure, but I couldn't find the upstream BTS. I was just adding extra info
to the bug report since I hit the same bug.



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#613589: /sbin/cfdisk: Bad Table error after fresh Squeeze install

2011-04-13 Thread Timo Juhani Lindfors
Hi,

thanks for the report. I can reproduce the problem with the attached
partition table image.



parttable1.img.xz
Description: Binary data

I see the code has

if (last >= total_size) {
*errmsg = _("Partition ends in the final partial cylinder");
return -1;
}

and the check was added in

commit 7eda085c41faa3445b4b168ce78ab18dab87d98a
Author: Karel Zak 
Date:   Thu Dec 7 00:25:39 2006 +0100

Imported from util-linux-2.9v tarball.


but I don't really know what to do about this. Maybe the error message
could be improved to say that this is an unsupported layout and that you
might want to use fdisk change to some other layout?



Bug#613589: /sbin/cfdisk: Bad Table error after fresh Squeeze install

2011-04-13 Thread Olaf van der Spek
On Wed, Apr 13, 2011 at 9:22 AM, Timo Juhani Lindfors
 wrote:
> if (last >= total_size) {
>    *errmsg = _("Partition ends in the final partial cylinder");
>    return -1;
> }
>
> and the check was added in
>
> commit 7eda085c41faa3445b4b168ce78ab18dab87d98a
> Author: Karel Zak 
> Date:   Thu Dec 7 00:25:39 2006 +0100
>
>    Imported from util-linux-2.9v tarball.
>
>
> but I don't really know what to do about this. Maybe the error message

In that case it should be forwarded upstream.



-- 
Olaf



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#613589: /sbin/cfdisk: Bad Table error after fresh Squeeze install

2011-02-15 Thread Olaf van der Spek
Package: util-linux
Version: 2.17.2-9
Severity: serious
File: /sbin/cfdisk
Justification: Doesn't start

Hi,

Just installed Squeeze. cfdisk refuses to start: FATAL ERROR: Bad primary 
partition 1: Partition ends in the final partial cylinder

fdisk says:
Disk /dev/sda: 17.2 GB, 17179869184 bytes
255 heads, 63 sectors/track, 2088 cylinders, total 33554432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x10a0

   Device Boot  Start End  Blocks   Id  System
/dev/sda1   *20483208806316043008   83  Linux
/dev/sda23209011033552383  7311375  Extended
/dev/sda53209011233552383  731136   82  Linux swap / Solaris

Disk /dev/sdb: 17.2 GB, 17179869184 bytes
255 heads, 63 sectors/track, 2088 cylinders, total 33554432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005972d

   Device Boot  Start End  Blocks   Id  System
/dev/sdb120483354371916770836   83  Linux

Greetings,

Olaf

-- System Information:
Debian Release: wheezy/sid
  APT prefers stable
  APT policy: (500, 'stable'), (1, 'unstable'), (1, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages util-linux depends on:
ii  debconf [debconf-2.0]   1.5.38   Debian configuration management sy
ii  dpkg1.15.8.10Debian package management system
ii  initscripts 2.88dsf-13.1 scripts for initializing and shutt
ii  install-info4.13a.dfsg.1-6   Manage installed documentation in 
ii  libblkid1   2.17.2-9 block device id library
ii  libc6   2.11.2-11Embedded GNU C Library: Shared lib
ii  libncurses5 5.7+20100313-5   shared libraries for terminal hand
ii  libselinux1 2.0.96-1 SELinux runtime shared libraries
ii  libslang2   2.2.2-4  The S-Lang programming library - r
ii  libuuid12.17.2-9 Universally Unique ID library
ii  lsb-base3.2-27   Linux Standard Base 3.2 init scrip
ii  tzdata  2011a-1  time zone and daylight-saving time
ii  zlib1g  1:1.2.3.4.dfsg-3 compression library - runtime

util-linux recommends no packages.

Versions of packages util-linux suggests:
ii  console-tools1:0.2.3dbs-69.1 Linux console and font utilities
pn  dosfstools (no description available)
pn  util-linux-locales (no description available)

-- debconf information:
  util-linux/noauto-with-nonzero-passnum:



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org