GEOM/fdisk/USB drive problem

2002-10-15 Thread Nate Lawson
fdisk against my USB flash drive crashes with divide by zero. It turns out that get_params() starts with some default values (since there is no disklabel) and then runs some ioctls: DIOCGFWSECTORS and DIOCGFWHEADS. The problem is that fdisk checks the error from that ioctl and then happily uses

Re: GEOM/fdisk/USB drive problem

2002-10-15 Thread Poul-Henning Kamp
In message [EMAIL PROTECTED], Nate Lawson wri tes: fdisk against my USB flash drive crashes with divide by zero. It turns out that get_params() starts with some default values (since there is no disklabel) and then runs some ioctls: DIOCGFWSECTORS and DIOCGFWHEADS. The problem is that fdisk

Re: GEOM/fdisk/USB drive problem

2002-10-15 Thread Nate Lawson
On Tue, 15 Oct 2002, Poul-Henning Kamp wrote: In message [EMAIL PROTECTED], Nate Lawson wri tes: fdisk against my USB flash drive crashes with divide by zero. It turns out that get_params() starts with some default values (since there is no disklabel) and then runs some ioctls:

Re: GEOM/fdisk/USB drive problem

2002-10-15 Thread Poul-Henning Kamp
In message [EMAIL PROTECTED], Nate Lawson wri tes: I could agree to make g_dev_ioctl fail the ioctl with some errno if they came back as zero, but not substituting another value. The attached patch makes everything work fine for my drive (64 MB USB flash). Apart from the choice of EINVAL,