diff options
author | Alex Elder <elder@inktank.com> | 2012-11-13 21:11:15 -0600 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2013-01-17 15:52:03 -0600 |
commit | c885837f7d4f8c4f5cb2a744cc6929bc078e9dc0 (patch) | |
tree | 2b4e60e8e7aee98e8f4e8c56119978160ba85cfd /security | |
parent | 7c3d22cf16f1bbcb37a73e88338c042bb49ff112 (diff) | |
download | kernel_goldelico_gta04-c885837f7d4f8c4f5cb2a744cc6929bc078e9dc0.zip kernel_goldelico_gta04-c885837f7d4f8c4f5cb2a744cc6929bc078e9dc0.tar.gz kernel_goldelico_gta04-c885837f7d4f8c4f5cb2a744cc6929bc078e9dc0.tar.bz2 |
libceph: always allow trail in osd request
An osd request structure contains an optional trail portion, which
if present will contain data to be passed in the payload portion of
the message containing the request. The trail field is a
ceph_pagelist pointer, and if null it indicates there is no trail.
A ceph_pagelist structure contains a length field, and it can
legitimately hold value 0. Make use of this to change the
interpretation of the "trail" of an osd request so that every osd
request has trailing data, it just might have length 0.
This means we change the r_trail field in a ceph_osd_request
structure from a pointer to a structure that is always initialized.
Note that in ceph_osdc_start_request(), the trail pointer (or now
address of that structure) is assigned to a ceph message's trail
field. Here's why that's still OK (looking at net/ceph/messenger.c):
- What would have resulted in a null pointer previously will now
refer to a 0-length page list. That message trail pointer
is used in two functions, write_partial_msg_pages() and
out_msg_pos_next().
- In write_partial_msg_pages(), a null page list pointer is
handled the same as a message with 0-length trail, and both
result in a "in_trail" variable set to false. The trail
pointer is only used if in_trail is true.
- The only other place the message trail pointer is used is
out_msg_pos_next(). That function is only called by
write_partial_msg_pages() and only touches the trail pointer
if the in_trail value it is passed is true.
Therefore a null ceph_msg->trail pointer is equivalent to a non-null
pointer referring to a 0-length page list structure.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions