Re: [RFC] PATCH to fix rescan_partitions to return errors properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Erik Mouw wrote:
On Wed, Oct 04, 2006 at 09:50:51AM -0700, Suzuki Kp wrote:

Erik Mouw wrote:

On Tue, Oct 03, 2006 at 06:00:36PM -0700, Suzuki Kp wrote:


Currently the rescan_partition returns 0 (success), even if it is unable
to rescan the partition information ( may be due to disks offline, I/O
error reading the table or unknown partition ). This would make ioctl()
calls succeed for BLKRRPART requests even if partitions were not scanned
properly, which is not a good thing to do.

Attached here is patch to fix the issue. The patch makes
rescan_partition to return -EINVAL for unknown partitions and -EIO for
disk I/O errors ( or when disks are offline ).
I don't think it's a good idea to return an error when there's an
unknown partition table. How do you differentiate between a device that
isn't partitioned at all and a device with an unknown partition table?
Returning -EINVAL in both the above cases would inform the user that,
the partition table was not read properly due to an invalid arguemnt
(the disk) passed, which holds good for both the above cases.
What do you think ?

I disagree. It's perfectly valid for a disk not to have a partition
table (for example: components of a RAID5 MD device) and we shouldn't
scare users about that. Also an unrecognised partition table format
(DEC VMS, Novell Netware, etc.) is not a reason to throw an error, it's
just unrecognised and as far as the kernel knows it's unpartioned.
Erik,

Thank you very much for the clarification.

But don't you think that, we should let know the user that he/she is trying to re-read a partition table from a device, which doesn't have it or is not useful for the kernel or to him, rather than making him happy with a success ?
It's OK to tell the user that there was some kind of device error when
scanning the partition table but IMHO an unpartitioned disk is not a
device error.


Erik

Thanks,

Suzuki
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux