[dm-devel] [PATCH] Check region size during dirty log creation

Heinz Mauelshagen heinzm at redhat.com
Wed Oct 29 15:07:30 UTC 2008


Am Mittwoch, den 29.10.2008, 13:56 +0000 schrieb Alasdair G Kergon:
> On Wed, Oct 29, 2008 at 02:02:08PM +0100, Heinz Mauelshagen wrote:
> > This patch adds checks to the dirty log creation for region size to be
> > larger than 2 sectors and to be a power of 2.
>  
> Interesting we didn't validate that, but the userspace validation is
> tighter.
> 
>         if (lp->region_size % (pagesize >> SECTOR_SHIFT)) {
>                 log_error("Region size (%" PRIu32 ") must be a multiple of "
>                           "machine memory page size (%d)",
>                           lp->region_size, pagesize >> SECTOR_SHIFT);
> 
> The validation should be consistent between userspace and kernel.
> Alasdair

It should be sufficiently restrictive in the kernel to prevent
programming errors causing oopses. It can be called via the kernel
interface by any application anyway, so doesn't need to enforce our
uspace restrictions (think direct IOCTL calls).

Heinz





More information about the dm-devel mailing list