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

[lvm-devel] Re: [PATCH 2/6] Add devices/data_alignment_offset_detection to lvm.conf.



Mike Snitzer wrote:
> On Thu, Jul 16 2009 at  2:47pm -0400,
> Milan Broz <mbroz redhat com> wrote:
> I'll be sure to cast all MAJOR() and MINOR() calls when used with
> dm_snprintf().  Would still like to understand how not using a cast gets
> us into trouble... but that is for when I get back from vacation ;)

That's clear, we have compatibility macros for MAJOR defined,
on linux it is defined:

#  define MAJOR(dev)    ((dev & 0xfff00) >> 8)

printf %d expect on 32bit int (4 bytes) but MAJOR(dev) is long (8 bytes) here.

On x86_64 it is the same size, so it works.

Just use retype here...

Milan


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