Re: partition table rereading

Andries.Brouwer@cwi.nl
Sat, 3 Apr 1999 01:09:05 +0200 (MET DST)


jj writes:

: In fact, BLKRRPART could be improved: currently you get EBUSY if some
: partitions of the disk are used. But if the partitions which are busy
: have not changed at all (and kept the same number), then I think there
: is no reason not to succeed. It will require some additional code
: (checking if the busy partitions have the same start/length in kernel
: tables and in the new partition table), but IMHO is worth doing that.

I am not so sure this is very useful in practice -
think it would help only in a few cases.

The code for checking whether a reread can be done without harm
will be messy (with the danger of races). Probably it is better
to do this from user space. With routines
add_partition(int devfd, int start, int length, char *name, int flags)
del_partition_by_start(int devfd, int start, int flags)
del_partition_by_name(int devfd, char *name, int flags)
with devfd referring to the entire disk,
we need not check all possible uses of the disk, but add_partition()
needs only check that there is no overlap with any existing partition,
and del_partition() needs only check that this partition exists and
is not in use.

This looks clean and powerful: able to cope with foreign
partition table types and disks without any partition table.

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/