aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-04-21 17:51:50 -0400
committerSage Weil <sage@inktank.com>2013-05-02 00:19:24 -0400
commit9ef1ee5a1b6ccb3220fb822523716e56c3629dbe (patch)
treec4453f58c394922cfe81517c21e28939c69cf9a6 /net/ceph
parent770eba6e295fd36e43881176ee0644b9cc2803f1 (diff)
libceph: fix byte order mismatch
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. This resolves: http://tracker.ceph.com/issues/3847 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/osd_client.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 467020c560b2..57d8db5b055a 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,
577 BUG_ON(opcode != CEPH_OSD_OP_NOTIFY_ACK && opcode != CEPH_OSD_OP_WATCH); 577 BUG_ON(opcode != CEPH_OSD_OP_NOTIFY_ACK && opcode != CEPH_OSD_OP_WATCH);
578 578
579 op->watch.cookie = cookie; 579 op->watch.cookie = cookie;
580 /* op->watch.ver = version; */ /* XXX 3847 */ 580 op->watch.ver = version;
581 op->watch.ver = cpu_to_le64(version);
582 if (opcode == CEPH_OSD_OP_WATCH && flag) 581 if (opcode == CEPH_OSD_OP_WATCH && flag)
583 op->watch.flag = (u8)1; 582 op->watch.flag = (u8)1;
584} 583}