From: Josh Durgin <josh.durgin@inktank.com>
To: Alex Elder <elder@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH] libceph: fix byte order mismatch
Date: Mon, 22 Apr 2013 15:26:31 -0700 [thread overview]
Message-ID: <5175B917.4060802@inktank.com> (raw)
In-Reply-To: <5174606B.4090906@inktank.com>
On 04/21/2013 02:55 PM, Alex Elder wrote:
> A WATCH op includes an object version. The version that's supplied
> is incorrectly byte-swapped osd_req_op_watch_init() where it's first
> assigned (it's been this way since that code was first added).
>
> The result is that the version sent to the osd is wrong, because
> that value gets byte-swapped again in osd_req_encode_op(). This
> is the source of a sparse warning related to improper byte order in
> the assignment.
>
> The approach of using the version to avoid a race is deprecated
> (see http://tracker.ceph.com/issues/3871), and the watch parameter
> is no longer even examined by the osd. So fix the assignment in
> osd_req_op_watch_init() so it no longer does the byte swap.
IIRC it was never examined by the osd. Doesn't hurt to fix the encoding
though.
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
> This resolves:
> http://tracker.ceph.com/issues/3847
>
> Signed-off-by: Alex Elder <elder@inktank.com>
> ---
> net/ceph/osd_client.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
> index 467020c..57d8db5 100644
> --- a/net/ceph/osd_client.c
> +++ b/net/ceph/osd_client.c
> @@ -577,8 +577,7 @@ void osd_req_op_watch_init(struct ceph_osd_request
> *osd_req,
> BUG_ON(opcode != CEPH_OSD_OP_NOTIFY_ACK && opcode != CEPH_OSD_OP_WATCH);
>
> op->watch.cookie = cookie;
> - /* op->watch.ver = version; */ /* XXX 3847 */
> - op->watch.ver = cpu_to_le64(version);
> + op->watch.ver = version;
> if (opcode == CEPH_OSD_OP_WATCH && flag)
> op->watch.flag = (u8)1;
> }
>
prev parent reply other threads:[~2013-04-22 22:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-21 21:55 [PATCH] libceph: fix byte order mismatch Alex Elder
2013-04-22 22:26 ` Josh Durgin [this message]
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=5175B917.4060802@inktank.com \
--to=josh.durgin@inktank.com \
--cc=ceph-devel@vger.kernel.org \
--cc=elder@inktank.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.