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

Re: [dm-devel] [PATCH v2] dm: Fix alignment stacking on partitioned devices



On Tue, Jan 05 2010 at 10:24pm -0500,
Martin K. Petersen <martin petersen oracle com> wrote:

> >>>>> "Mike" == Mike Snitzer <snitzer redhat com> writes:
> 
> Mike,
> 
> Mike> After looking closer there seems to be various type
> Mike> inconsistencies in the alignment_offset and discard_alignment
> Mike> related routines (returning 'int' in places, etc).
> 
> Mike> The following patch is what I found; I have no problem with
> Mike> switching from 'unsigned long' to blk_off_t for LBD though.
> 
> I only use blk_off_t in the places where we're dealing with absolute
> offsets.
> 
> Blindly converting alignment_offset from int to unsigned long won't
> work.  We depend on being able to return -1 in case of
> misalignment. Hence int and not unsigned int.

Right, I realized/noticed that after I sent that patch.

But even with your blk_off_t patch (and prior to it with sector_t)
you're mixing int with blk_off_t in blk_stack_limits() by doing:

        alignment = queue_limit_alignment_offset(b, offset);

This helped motivate my "blind" conversion.

> Furthermore, the returned values are always modulo the granularity so
> int is plenty big.

OK.


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