From: Jason Dillaman <dillaman@redhat.com>
To: Mykola Golub <mgolub@mirantis.com>
Cc: ceph-devel@vger.kernel.org, Josh Durgin <jdurgin@redhat.com>
Subject: Re: CEPH_RBD_API: options on image create
Date: Thu, 15 Oct 2015 08:05:07 -0400 (EDT) [thread overview]
Message-ID: <446012806.46791295.1444910707804.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20151015063308.GA7834@gmail.com>
> > I am concerned about passing a void* + length to specify the option
> > value since you really can't protect against the user providing data
> > in the incorrect format. For example, if the backend treated
> > RBD_OPTION_STRIPE_UNIT as a 4byte int, what happens if someone
> > passes a 2- or 8-byte int or a 4-byte char* string?
>
> Then rbd_image_options_set() will fail with EINVAL, because the option
> type (size) is a part of interface.
>
> I do this by analogy to setsockopt(2):
>
> http://pubs.opengroup.org/onlinepubs/009695399/functions/setsockopt.html
>
> Note option type documented for every option there, and it works
> fairly well.
>
> Following a common practice is an additional argument to this
> approach to me.
Except for the following cases:
sizeof(char*) == sizeof(uint32_t) (32bit)
sizeof(char*) == sizeof(uint64_t) (64bit)
--
Jason Dillaman
next prev parent reply other threads:[~2015-10-15 12:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-30 6:50 CEPH_RBD_API: options on image create Mykola Golub
2015-10-14 19:34 ` Jason Dillaman
2015-10-15 3:12 ` Josh Durgin
2015-10-15 6:56 ` Mykola Golub
2015-10-15 6:33 ` Mykola Golub
2015-10-15 12:05 ` Jason Dillaman [this message]
2015-10-15 12:33 ` Mykola Golub
2015-10-15 12:47 ` Jason Dillaman
2015-10-15 13:28 ` Mykola Golub
2015-10-15 13:45 ` Sage Weil
2015-10-15 18:29 ` Josh Durgin
2015-10-16 5:32 ` Mykola Golub
2015-10-24 13:16 ` Mykola Golub
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=446012806.46791295.1444910707804.JavaMail.zimbra@redhat.com \
--to=dillaman@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=jdurgin@redhat.com \
--cc=mgolub@mirantis.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.