[dm-devel] dm log: struct log_write_super and padding (was: Re: dm: add log writes target)

Geert Uytterhoeven geert at linux-m68k.org
Sat Apr 18 22:16:05 UTC 2015


On Sat, Apr 18, 2015 at 2:34 PM, Linux Kernel Mailing List
<linux-kernel at vger.kernel.org> wrote:
> Gitweb:     http://git.kernel.org/linus/;a=commit;h=0e9cebe724597a76ab1b0ebc0a21e16f7db11b47
> Commit:     0e9cebe724597a76ab1b0ebc0a21e16f7db11b47

> --- /dev/null
> +++ b/drivers/md/dm-log-writes.c
> @@ -0,0 +1,825 @@

> +/*
> + * Basic info about the log for userspace.
> + */
> +struct log_write_super {
> +       __le64 magic;
> +       __le64 version;
> +       __le64 nr_entries;
> +       __le32 sectorsize;

Should there be an explicit padding of 4 bytes?
Does anything assume that sizeof(struct log_write_super) is always 4 * 8?

On architectures where the natural alignment of 64-bit quantities is less
than 8 bytes, sizeof(struct log_write_super) is smaller than 32 bytes
(e.g. on m68k it's 28).

> +};

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds




More information about the dm-devel mailing list