public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@dreamhost.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Sage Weil <sage@newdream.net>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: osd_req_encode_op() breakage?
Date: Wed, 18 Apr 2012 10:09:05 -0500	[thread overview]
Message-ID: <4F8ED911.90309@dreamhost.com> (raw)

I got dropped off the kernel.org lists for a bit and didn't see
this at first.  I don't know whether Sage responded to you or
not.  I'm getting back to you, just to be sure.

 > Date: Sat, 14 Apr 2012 03:34:20 +0100
 > From: Al Viro <viro@ZenIV.linux.org.uk>
 > To: Sage Weil <sage@newdream.net>
 > Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
 > Subject: osd_req_encode_op() breakage?
 >
 > static void osd_req_encode_op(struct ceph_osd_request *req,
 >                               struct ceph_osd_op *dst,
 >                               struct ceph_osd_req_op *src)
 > {
 >         dst->op = cpu_to_le16(src->op);
 >
 >         switch (dst->op) {
 >         case CEPH_OSD_OP_READ:
 >         case CEPH_OSD_OP_WRITE:
 >
 > is an interesting thing to say, seeing that CEPH_OSD_OP_READ et.al. are
 > all host-endian...  Should that be "switch (src->op)" instead?

Yes, you are absolutely correct.

We have obviously not done endianness checks in this code for
some time.

I will commit a fix and credit you for it.  I'll also make sure
we are doing proper testing for this sort of thing on a regular
basis.

					-Alex

 >  AFAICS, that sucker had appeared in that form back in
 > commit 68b4476b0bc13fef18266b4140309a30e86739d2
 > Author: Yehuda Sadeh <yehuda@hq.newdream.net>
 > Date:   Tue Apr 6 15:01:27 2010 -0700
 >
 >     ceph: messenger and osdc changes for rbd
 >
 > and it seems to be broken on big-endian hosts.  Doesn't look like a 
misspelled
 > le16_to_cpu() either, since dst->op ends up going on the wire...
 >
 > I'm really mystified by that - it looks like it must've shown up 
immediately
 > on big-endian hosts; it's not like it was an obscure codepath, after 
all...
 > Comments?

             reply	other threads:[~2012-04-18 15:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18 15:09 Alex Elder [this message]
2012-04-18 15:18 ` [PATCH] ceph: osd_client: fix endianness bug in osd_req_encode_op() Alex Elder
2012-04-18 15:32 ` osd_req_encode_op() breakage? Al Viro
2012-04-18 15:56   ` Yehuda Sadeh Weinraub
  -- strict thread matches above, loose matches on Subject: below --
2012-04-14  2:34 Al Viro

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=4F8ED911.90309@dreamhost.com \
    --to=elder@dreamhost.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sage@newdream.net \
    --cc=viro@ZenIV.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox