[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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


---------- Forwarded message ----------
Date: Mon, 3 Oct 2016 13:20:40 +0800
From: kbuild test robot <fengguang.wu@xxxxxxxxx>
To: kbuild@xxxxxx
Cc: Julia Lawall <julia.lawall@xxxxxxx>
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-all@xxxxxx
CC: devel@xxxxxxxxxxxxxxxxxxxx
TO: Dmitry Eremin <dmitry.eremin@xxxxxxxxx>
CC: "Greg Kroah-Hartman" <gregkh@xxxxxxxxxxxxxxxxxxx>
CC: "John L. Hammond" <john.hammond@xxxxxxxxx>
CC: Fan Yong <fan.yong@xxxxxxxxx>
CC: Oleg Drokin <oleg.drokin@xxxxxxxxx>
CC: James Simmons <jsimmons@xxxxxxxxxxxxx>

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 <bergwolf@xxxxxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux