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

Alasdair G Kergon agk at redhat.com
Wed Oct 29 20:51:32 UTC 2008


On Wed, Oct 29, 2008 at 04:53:42PM +0100, Heinz Mauelshagen wrote:
> I'm arguing, that the kernel should only restrict to prevent against
> programming errors.
 
Indeed - but I'm asking where the existing constraint is coming
from and if it is still/was ever correct?

Also, this patch duplicates existing checks in _check_region_size()
that should be removed if the validation moves.

static inline int _check_region_size(struct dm_target *ti, uint32_t size)
{
        return !(size % (PAGE_SIZE >> 9) || !is_power_of_2(size) ||
                 size > ti->len);
}

Alasdair
-- 
agk at redhat.com




More information about the dm-devel mailing list