diff options
author | Alex Elder <elder@inktank.com> | 2013-04-19 22:34:49 +0200 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 06:19:05 +0200 |
commit | a51b272e9e99f912e8e07d4c9f58c1d433afea7c (patch) | |
tree | 2ddc1a7fcae1585618d192e5ab8ddfa4b41200bf /net/nonet.c | |
parent | rbd: issue stat request before layered write (diff) | |
download | linux-a51b272e9e99f912e8e07d4c9f58c1d433afea7c.tar.xz linux-a51b272e9e99f912e8e07d4c9f58c1d433afea7c.zip |
libceph: fix two messenger bugs
This patch makes four small changes in the ceph messenger.
While getting copyup functionality working I found two bugs in the
messenger. Existing paths through the code did not trigger these
problems, but they're fixed here:
- In ceph_msg_data_pagelist_cursor_init(), the cursor's
last_piece field was being checked against the length
supplied. This was OK until this commit: ccba6d98 libceph:
implement multiple data items in a message That commit changed
the cursor init routines to allow lengths to be supplied that
exceeded the size of the current data item. Because of this,
we have to use the assigned cursor resid field rather than the
provided length in determining whether the cursor points to
the last piece of a data item.
- In ceph_msg_data_add_pages(), a BUG_ON() was erroneously
catching attempts to add page data to a message if the message
already had data assigned to it. That was OK until that same
commit, at which point it was fine for messages to have
multiple data items. It slipped through because that BUG_ON()
call was present twice in that function. (You can never be too
careful.)
In addition two other minor things are changed:
- In ceph_msg_data_cursor_init(), the local variable "data" was
getting assigned twice.
- In ceph_msg_data_advance(), it was assumed that the
type-specific advance routine would set new_piece to true
after it advanced past the last piece. That may have been
fine, but since we check for that case we might as well set it
explicitly in ceph_msg_data_advance().
This resolves:
http://tracker.ceph.com/issues/4762
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'net/nonet.c')
0 files changed, 0 insertions, 0 deletions