Project

General

Profile

Actions

Bug #3847

closed

rbd: figure out correct byte order for watch version

Added by Alex Elder over 11 years ago. Updated almost 11 years ago.

Status:
Resolved
Priority:
Low
Assignee:
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

In the process of refactoring rbd code that builds up osd
operations I noticed that for NOTIFY_ACK and WATCH operations
the op->watch.ver field was being converted to little-endian
byte order.

Doing that byte conversion is unlike what's done for the
op structures built up for all other operation types. I
believe it's an error, but haven't had time to verify it.

I'm creating this issue to track this potential bug (rather
than keeping a "XXX" comment in the code).

Actions #1

Updated by Ian Colle about 11 years ago

  • Priority changed from Normal to High
Actions #2

Updated by Sage Weil about 11 years ago

  • Priority changed from High to Low
Actions #3

Updated by Alex Elder almost 11 years ago

  • Status changed from New to In Progress

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 <>

Actions #4

Updated by Alex Elder almost 11 years ago

  • Status changed from In Progress to Fix Under Review

The following has been posted for review:

[PATCH] libceph: fix byte order mismatch

It is available in the "review/wip-enable-layering"
branch of the ceph-client git repository.

Actions #5

Updated by Alex Elder almost 11 years ago

  • Status changed from Fix Under Review to Resolved

The following has been committed to the "testing" branch
of the ceph-client git repository:

42c6070 libceph: fix byte order mismatch

Actions

Also available in: Atom PDF