bug-parted
[Top][All Lists]
Advanced

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

Re: DevFS and Partition Table Resync (PATCH)


From: Andrew Clausen
Subject: Re: DevFS and Partition Table Resync (PATCH)
Date: Tue, 18 Dec 2001 23:49:44 +1100
User-agent: Mutt/1.2.5i

Hi Hong,

Thanks for the patch.  Just some nitpicks about the patch:
* please delete irrelevant bits from the patch (eg spec files...)
* if you want to delete a function, do it!  Don't #ifdef 0 it out.
If we want to resurrect it, we can get it from an old version.
* you really only need to label code you wrote if you think it's
really subtle, and people might want to ask you for clarification.
(in which case there would be some kind of comment...)

On Mon, Dec 17, 2001 at 02:54:26PM -0500, Hong H. Pham wrote:
> When DevFS is active, after _disk_sync_part_table() has been called, the
> partition table in /proc/partition is not correct, and the proper device
> links in the /dev directory are not created.  This is actually a kernel
> problem; the ioctl() handler for BLKPG_ADD_PARTITION in the kernel does
> not notify the devfs system.  Note that the device path in
> blkg_partition.devname, generated by _device_get_part_path(), is not used
> by the kernel during the ioctl() call.

Is there any reason why kernel problems shouldn't be fixed, as opposed
to complicating parted?

> The work around for this is to check if DevFS is active, and if so,
> _disk_sync_part_table() calls _kernel_reread_part_table() rather than
> trying to resync the partition table.

which is really a non-solution, because that doesn't work if there
are any partitions mounted / swapped on whatever (true 99% of the
time).  So, you gain nothing.
 
>  A brief summary of the patch is below.

Good, I like summaries :)  Bonus marks are available for putting them
in ChangeLog format, so I can cut&paste...

> - added _have_devfs(), which checks if the system is using DevFS.
>   Modified linux_disk_commit() and _device_get_part_path() to use this.

makes sense

> - modified _get_linux_version() to use uname(2), rather than probing
>   /proc/sys/kernel/osrelease.  Kernel version checking is done using by
>   using the KERNEL_VERSION() macro in <linux/version.h>
>   Affected functions are _device_get_sector_size() and _have_blkpg().

ok

> - Modified linux_probe_all(); if _probe_proc_partitions() fail, resort
>   to doing a blind device probe (_probe_standard_devices()).  Since
>   /proc/partitions contains all the block devices and partitions that
>   the kernel has detected and is currently using, I do not see why we
>   have to waste time probing for devices that do not exist, or devices
>   that have already been probed.  A few seconds in initialisation time
>   can be saved if we avoid the blind device probe.

yep, good idea.

Anyway, I've applied it with my own cleanups.
You should probably be signing a disclaimer, because you have made
a few small changes now... is this ok?  (feel free to discuss privately)

Thanks!
Andrew




reply via email to

[Prev in Thread] Current Thread [Next in Thread]