> cli->cl_avail_grant has type unsigned long, so the code in line 1039-1045
> will have to be handled in some other way.
> 
> julia

Thank you Julia for reporting this. I have created a patch that is being
tested right now. I will post it shortly.

  
> ---------- Forwarded message ----------
> Date: Mon, 3 Oct 2016 13:20:40 +0800
> From: kbuild test robot <fengguang...@intel.com>
> To: kbu...@01.org
> Cc: Julia Lawall <julia.law...@lip6.fr>
> Subject: [staging:staging-next 761/1248]
>     drivers/staging/lustre/lustre/osc/osc_request.c:1045:5-24: WARNING: 
> Unsigned
>      expression compared with zero: cli -> cl_avail_grant < 0
> 
> CC: kbuild-...@01.org
> CC: de...@driverdev.osuosl.org
> TO: Dmitry Eremin <dmitry.ere...@intel.com>
> CC: "Greg Kroah-Hartman" <gre...@linuxfoundation.org>
> CC: "John L. Hammond" <john.hamm...@intel.com>
> CC: Fan Yong <fan.y...@intel.com>
> CC: Oleg Drokin <oleg.dro...@intel.com>
> CC: James Simmons <jsimm...@infradead.org>
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
> staging-next
> head:   fc1e2c8ea85e109acf09e74789e9b852f6eed251
> commit: 97cba1302d8994b9a573b6274133475e85ef7630 [761/1248] staging: lustre: 
> fix comparison between signed and unsigned
> :::::: branch date: 12 hours ago
> :::::: commit date: 2 weeks ago
> 
> >> drivers/staging/lustre/lustre/osc/osc_request.c:1045:5-24: WARNING: 
> >> Unsigned expression compared with zero: cli -> cl_avail_grant < 0
> 
> git remote add staging 
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> git remote update staging
> git checkout 97cba1302d8994b9a573b6274133475e85ef7630
> vim +1045 drivers/staging/lustre/lustre/osc/osc_request.c
> 
> d7e09d039 Peng Tao        2013-05-02  1029    /*
> d7e09d039 Peng Tao        2013-05-02  1030     * ocd_grant is the total grant 
> amount we're expect to hold: if we've
> 3147b2684 Hongchao Zhang  2016-08-16  1031     * been evicted, it's the new 
> avail_grant amount, cl_dirty_pages will
> 3147b2684 Hongchao Zhang  2016-08-16  1032     * drop to 0 as inflight RPCs 
> fail out; otherwise, it's avail_grant +
> 3147b2684 Hongchao Zhang  2016-08-16  1033     * dirty.
> d7e09d039 Peng Tao        2013-05-02  1034     *
> d7e09d039 Peng Tao        2013-05-02  1035     * race is tolerable here: if 
> we're evicted, but imp_state already
> 3147b2684 Hongchao Zhang  2016-08-16  1036     * left EVICTED state, then 
> cl_dirty_pages must be 0 already.
> d7e09d039 Peng Tao        2013-05-02  1037     */
> 7d53d8f42 John L. Hammond 2016-03-30  1038    
> spin_lock(&cli->cl_loi_list_lock);
> d7e09d039 Peng Tao        2013-05-02  1039    if (cli->cl_import->imp_state 
> == LUSTRE_IMP_EVICTED)
> d7e09d039 Peng Tao        2013-05-02  1040            cli->cl_avail_grant = 
> ocd->ocd_grant;
> d7e09d039 Peng Tao        2013-05-02  1041    else
> 3147b2684 Hongchao Zhang  2016-08-16  1042            cli->cl_avail_grant = 
> ocd->ocd_grant -
> 3147b2684 Hongchao Zhang  2016-08-16  1043                                  
> (cli->cl_dirty_pages << PAGE_SHIFT);
> d7e09d039 Peng Tao        2013-05-02  1044
> d7e09d039 Peng Tao        2013-05-02 @1045    if (cli->cl_avail_grant < 0) {
> d7e09d039 Peng Tao        2013-05-02  1046            CWARN("%s: available 
> grant < 0: avail/ocd/dirty %ld/%u/%ld\n",
> d7e09d039 Peng Tao        2013-05-02  1047                  
> cli->cl_import->imp_obd->obd_name, cli->cl_avail_grant,
> 3147b2684 Hongchao Zhang  2016-08-16  1048                  ocd->ocd_grant, 
> cli->cl_dirty_pages << PAGE_SHIFT);
> d7e09d039 Peng Tao        2013-05-02  1049            /* workaround for 
> servers which do not have the patch from
> 30aa9c526 Oleg Drokin     2016-02-24  1050             * LU-2679
> 30aa9c526 Oleg Drokin     2016-02-24  1051             */
> d7e09d039 Peng Tao        2013-05-02  1052            cli->cl_avail_grant = 
> ocd->ocd_grant;
> d7e09d039 Peng Tao        2013-05-02  1053    }
> 
> :::::: The code at line 1045 was first introduced by commit
> :::::: d7e09d0397e84eefbabfd9cb353221f3c6448d83 staging: add Lustre file 
> system client support
> 
> :::::: TO: Peng Tao <bergw...@gmail.com>
> :::::: CC: Greg Kroah-Hartman <gre...@linuxfoundation.org>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> 
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to