lkml.org 
[lkml]   [2013]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 04/39] staging/lustre/build: fix 'integer handling' issues
    Date
    From: Sebastien Buisson <sebastien.buisson@bull.net>

    Fix 'program hangs' defects found by Coverity version 6.5.1:
    Improper use of negative value (NEGATIVE_RETURNS)
    Variable is passed to a parameter that cannot be negative.
    Macro compares unsigned to 0 (NO_EFFECT)
    This comparison is always true.
    Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
    Test is always false regardless of the values of its operands.
    Wrong operator used (CONSTANT_EXPRESSION_RESULT)
    Test is always true regardless of the values of its operand.

    Lustre-change: http://review.whamcloud.com/5888
    Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3069
    Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
    Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
    Reviewed-by: John L. Hammond <john.hammond@intel.com>
    Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
    Signed-off-by: Peng Tao <bergwolf@gmail.com>
    Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
    ---
    drivers/staging/lustre/lustre/llite/rw.c | 1 -
    .../staging/lustre/lustre/obdclass/llog_ioctl.c | 6 ++++--
    2 files changed, 4 insertions(+), 3 deletions(-)

    diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c
    index e9ba38a..112368f 100644
    --- a/drivers/staging/lustre/lustre/llite/rw.c
    +++ b/drivers/staging/lustre/lustre/llite/rw.c
    @@ -803,7 +803,6 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io,
    ret = ll_read_ahead_pages(env, io, queue,
    ria, &reserved, mapping, &ra_end);

    - LASSERTF(reserved >= 0, "reserved %lu\n", reserved);
    if (reserved != 0)
    ll_ra_count_put(ll_i2sbi(inode), reserved);

    diff --git a/drivers/staging/lustre/lustre/obdclass/llog_ioctl.c b/drivers/staging/lustre/lustre/obdclass/llog_ioctl.c
    index da558a5..b6ad505 100644
    --- a/drivers/staging/lustre/lustre/obdclass/llog_ioctl.c
    +++ b/drivers/staging/lustre/lustre/obdclass/llog_ioctl.c
    @@ -90,7 +90,8 @@ static int llog_check_cb(const struct lu_env *env, struct llog_handle *handle,
    struct llog_rec_hdr *rec, void *data)
    {
    struct obd_ioctl_data *ioc_data = (struct obd_ioctl_data *)data;
    - static int l, remains, from, to;
    + static int l, remains;
    + static long from, to;
    static char *out;
    char *endp;
    int cur_index, rc = 0;
    @@ -174,7 +175,8 @@ static int llog_print_cb(const struct lu_env *env, struct llog_handle *handle,
    struct llog_rec_hdr *rec, void *data)
    {
    struct obd_ioctl_data *ioc_data = (struct obd_ioctl_data *)data;
    - static int l, remains, from, to;
    + static int l, remains;
    + static long from, to;
    static char *out;
    char *endp;
    int cur_index;
    --
    1.7.9.5


    \
     
     \ /
      Last update: 2013-11-14 20:41    [W:4.032 / U:0.232 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site