Re: add disk size to struct disk?

2012-04-30 Thread Matthias Drochner
On Sat, 28 Apr 2012 15:55:35 +0200 Jean-Yves Migeon jeanyves.mig...@free.fr wrote: do you expect the checks to be performed in userland, so anyone can be free to have overlaps/overflows, or let the kernel do the checks and return errors using the size obtained through disk(9)? The kernel

Re: add disk size to struct disk?

2012-04-30 Thread Jean-Yves Migeon
Le 30/04/12 19:29, Mouse a écrit : do you expect the checks to be performed in userland, so anyone can be free to have overlaps/overflows, or let the kernel do the checks and return errors using the size obtained through disk(9)? Overflowing is clearly bogus IMHO, and should not be allowed.

Re: add disk size to struct disk?

2012-04-28 Thread Jean-Yves Migeon
Le 27/04/12 18:43, Matthias Drochner a écrit : On Fri, 27 Apr 2012 01:02:46 +0200 Jean-Yves Migeonjeanyves.mig...@free.fr wrote: Why push it to struct disk rather than letting backends handle it? As the code looks now, the functions which scan disklabels (sys/dev/dkwedge/dkwedge_*.c) get a

Re: add disk size to struct disk?

2012-04-28 Thread Mouse
Design question: do you expect the checks to be performed in userland, so anyone can be free to have overlaps/overflows, or let the kernel do the checks and return errors using the size obtained through disk(9)? Speaking as someone who occasionally causes overlaps and such deliberately: I

Re: add disk size to struct disk?

2012-04-27 Thread Matthias Drochner
On Fri, 27 Apr 2012 01:02:46 +0200 Jean-Yves Migeon jeanyves.mig...@free.fr wrote: Why push it to struct disk rather than letting backends handle it? As the code looks now, the functions which scan disklabels (sys/dev/dkwedge/dkwedge_*.c) get a struct disk *. To get the actual size, it would

Re: add disk size to struct disk?

2012-04-26 Thread Jean-Yves Migeon
Le 26/04/12 22:39, Matthias Drochner a écrit : I think it would be useful to add the total disk size to the common struct disk. It could be used in wedge discovery to reject partitions which don't fit into the usable disk space. The reason I'm proposing this is that I just had a case where