From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: dm-devel@redhat.com, Alasdair Kergon <agk@redhat.com>,
Zdenek Kabelac <zkabelac@redhat.com>
Subject: Re: [dm-devel] [PATCH v2] dm-ioctl: return UUID in DM_LIST_DEVICES_CMD result
Date: Thu, 11 Mar 2021 15:07:36 -0500 [thread overview]
Message-ID: <20210311200736.GA29043@redhat.com> (raw)
In-Reply-To: <alpine.LRH.2.02.2103111438170.3860@file01.intranet.prod.int.rdu2.redhat.com>
On Thu, Mar 11 2021 at 2:43pm -0500,
Mikulas Patocka <mpatocka@redhat.com> wrote:
>
>
> On Thu, 11 Mar 2021, Mike Snitzer wrote:
>
> > > Index: linux-2.6/include/uapi/linux/dm-ioctl.h
> > > ===================================================================
> > > --- linux-2.6.orig/include/uapi/linux/dm-ioctl.h 2021-03-09 12:20:23.000000000 +0100
> > > +++ linux-2.6/include/uapi/linux/dm-ioctl.h 2021-03-11 18:42:14.000000000 +0100
> > > @@ -193,8 +193,15 @@ struct dm_name_list {
> > > __u32 next; /* offset to the next record from
> > > the _start_ of this */
> > > char name[0];
> > > +
> > > + /* uint32_t event_nr; */
> > > + /* uint32_t flags; */
> > > + /* char uuid[0]; */
> > > };
> >
> > If extra padding is being leveraged here (from the __u32 next), why not
> > at least explicitly add the members and then pad out the balance of that
> > __u32? I'm not liking the usage of phantom struct members.. e.g.
> > the games played with accessing them.
> >
> > Mike
>
> What exactly do you mean?
>
> Do you want to create another structure that holds event_nr, flags and
> uuid? Or something else?
Just not liking the comments you added in lieu of explicit struct
members.
Can't you remove __u32 next; and replace with named members of
appropriate size? Adding explicit padding to end to get you to 32bit
offset? I'd need to look closer at the way the code is written, but I
just feel like this patch makes the code even more fiddley.
But I can let it go if you don't see a way forward to make it better..
Mike
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
next prev parent reply other threads:[~2021-03-11 20:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 18:26 [dm-devel] [PATCH v2] dm-ioctl: return UUID in DM_LIST_DEVICES_CMD result Mikulas Patocka
2021-03-11 18:41 ` Mike Snitzer
2021-03-11 19:43 ` Mikulas Patocka
2021-03-11 20:07 ` Mike Snitzer [this message]
2021-03-12 14:07 ` [dm-devel] [PATCH v3] " Mikulas Patocka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210311200736.GA29043@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=mpatocka@redhat.com \
--cc=zkabelac@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.