lkml.org 
[lkml]   [2014]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.10 098/129] libceph: fix truncate size calculation
    Date
    3.10-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: "Yan, Zheng" <zheng.z.yan@intel.com>

    commit ccca4e37b1a912da3db68aee826557ea66145273 upstream.

    check the "not truncated yet" case

    Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
    Reviewed-by: Sage Weil <sage@inktank.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    net/ceph/osd_client.c | 14 ++++++++------
    1 file changed, 8 insertions(+), 6 deletions(-)

    --- a/net/ceph/osd_client.c
    +++ b/net/ceph/osd_client.c
    @@ -733,12 +733,14 @@ struct ceph_osd_request *ceph_osdc_new_r

    object_size = le32_to_cpu(layout->fl_object_size);
    object_base = off - objoff;
    - if (truncate_size <= object_base) {
    - truncate_size = 0;
    - } else {
    - truncate_size -= object_base;
    - if (truncate_size > object_size)
    - truncate_size = object_size;
    + if (!(truncate_seq == 1 && truncate_size == -1ULL)) {
    + if (truncate_size <= object_base) {
    + truncate_size = 0;
    + } else {
    + truncate_size -= object_base;
    + if (truncate_size > object_size)
    + truncate_size = object_size;
    + }
    }

    osd_req_op_extent_init(req, 0, opcode, objoff, objlen,



    \
     
     \ /
      Last update: 2014-01-07 00:41    [W:3.201 / U:0.352 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site