linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rescan partitions returns EIO since 2.6.8
@ 2004-12-05 14:03 Andries.Brouwer
  2004-12-06  0:47 ` Martin Pool
  0 siblings, 1 reply; 4+ messages in thread
From: Andries.Brouwer @ 2004-12-05 14:03 UTC (permalink / raw)
  To: mbp; +Cc: linux-kernel

Martin Pool changed the behaviour of the BLKRRPART ioctl in 2.6.8.
The effect is that one now gets an I/O error when first
partitioning an empty disk:

# sfdisk /dev/sda
Checking that no-one is using this disk right now ...
BLKRRPART: Input/output error

Ugly. I am tempted to go back to the state before his patch.

Why was this patch made? Just something random that seemed like
a good idea? Is there software that needs it?

Andries


The guilty patch (called "lost error code"):

	if (!get_capacity(disk) || !(state = check_partition(disk, bdev)))
-          return 0;
+          return -EIO;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: rescan partitions returns EIO since 2.6.8
  2004-12-05 14:03 rescan partitions returns EIO since 2.6.8 Andries.Brouwer
@ 2004-12-06  0:47 ` Martin Pool
  2004-12-06  1:50   ` Andries Brouwer
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Pool @ 2004-12-06  0:47 UTC (permalink / raw)
  To: Andries.Brouwer; +Cc: linux-kernel

On  5 Dec 2004, Andries.Brouwer@cwi.nl wrote:
> Martin Pool changed the behaviour of the BLKRRPART ioctl in 2.6.8.
> The effect is that one now gets an I/O error when first
> partitioning an empty disk:

> # sfdisk /dev/sda
> Checking that no-one is using this disk right now ...
> BLKRRPART: Input/output error

To me it seems more correct that a request to read the partition table
should fail if the partition table can't be read.  I had some code
that did care to know the difference, but if you really want to roll
it back I won't object.

fdisk, cfdisk and parted all just give a warning in this case.  You
can tell sfdisk to ignore the error with --no-reread.

-- 
Martin 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: rescan partitions returns EIO since 2.6.8
  2004-12-06  0:47 ` Martin Pool
@ 2004-12-06  1:50   ` Andries Brouwer
  2004-12-14  6:31     ` Martin Pool
  0 siblings, 1 reply; 4+ messages in thread
From: Andries Brouwer @ 2004-12-06  1:50 UTC (permalink / raw)
  To: Martin Pool, Andries.Brouwer, linux-kernel

On Mon, Dec 06, 2004 at 11:47:22AM +1100, Martin Pool wrote:
> On  5 Dec 2004, Andries.Brouwer@cwi.nl wrote:
> > Martin Pool changed the behaviour of the BLKRRPART ioctl in 2.6.8.
> > The effect is that one now gets an I/O error when first
> > partitioning an empty disk:
> 
> > # sfdisk /dev/sda
> > Checking that no-one is using this disk right now ...
> > BLKRRPART: Input/output error
> 
> To me it seems more correct that a request to read the partition table
> should fail if the partition table can't be read.

I do not view BLKRRPART as a request to read the partition table.
It is a request to revalidate: "if the disk is in use, return EBUSY,
otherwise, discard any old information, read any new information".
If the disk is blank then there is no new information to read,
that is not an error, and certainly not an I/O error.

> if you really want to roll it back I won't object.

Yes, I think I want to - am getting worried mail from people
who very much dislike I/O errors on a brand-new disk.

Andries

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: rescan partitions returns EIO since 2.6.8
  2004-12-06  1:50   ` Andries Brouwer
@ 2004-12-14  6:31     ` Martin Pool
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Pool @ 2004-12-14  6:31 UTC (permalink / raw)
  To: Andries Brouwer; +Cc: linux-kernel

On  6 Dec 2004, Andries Brouwer <Andries.Brouwer@cwi.nl> wrote:
> On Mon, Dec 06, 2004 at 11:47:22AM +1100, Martin Pool wrote:
> > On  5 Dec 2004, Andries.Brouwer@cwi.nl wrote:
> > To me it seems more correct that a request to read the partition table
> > should fail if the partition table can't be read.
> 
> I do not view BLKRRPART as a request to read the partition table.
> It is a request to revalidate: "if the disk is in use, return EBUSY,
> otherwise, discard any old information, read any new information".
> If the disk is blank then there is no new information to read,
> that is not an error, and certainly not an I/O error.
> 
> > if you really want to roll it back I won't object.
> 
> Yes, I think I want to - am getting worried mail from people
> who very much dislike I/O errors on a brand-new disk.

OK, my mistake.  Please take it out.

-- 
Martin 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-12-14  6:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-05 14:03 rescan partitions returns EIO since 2.6.8 Andries.Brouwer
2004-12-06  0:47 ` Martin Pool
2004-12-06  1:50   ` Andries Brouwer
2004-12-14  6:31     ` Martin Pool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).