Skip to contentSkip to conversation

rescan partitions returns EIO since 2.6.8

DISCUSSION [email protected] 2 participants 4 messages Dec 5, 2004 – Dec 14, 2004

lore
Share & tools
lore
#0 lore raw

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;

#1 lore raw
Quoted 7 lines · On 5 Dec 2004, [email protected] 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.

Signature · 1 line
Martin 
#2 lore raw
Quoted 11 lines · Martin Pool
Quoted 7 lines · On 5 Dec 2004, [email protected] 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.

Quoted 1 line

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

#3 lore raw
Quoted 11 lines · Andries Brouwer
Quoted 3 lines · Martin Pool

On 5 Dec 2004, [email protected] 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.

Quoted 4 lines
Quoted 1 line

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.

Signature · 1 line
Martin