* [viro-vfs:work.iov_iter_get_pages 24/33] lib/iov_iter.c:1295 iter_xarray_get_pages() warn: unsigned 'count' is never less than zero.
@ 2022-06-19 15:40 kernel test robot
2022-06-19 15:48 ` Al Viro
0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2022-06-19 15:40 UTC (permalink / raw)
To: Al Viro; +Cc: kbuild-all, linux-fsdevel
tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.iov_iter_get_pages
head: fe8e2809c7db0ec65403b31b50906f3f481a9b10
commit: e64d637d648390e4ac0643747ae174c3be15f243 [24/33] iov_iter: saner helper for page array allocation
config: mips-randconfig-m031-20220619 (https://download.01.org/0day-ci/archive/20220619/202206192306.POJg04ej-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
smatch warnings:
lib/iov_iter.c:1295 iter_xarray_get_pages() warn: unsigned 'count' is never less than zero.
vim +/count +1295 lib/iov_iter.c
1280
1281 static ssize_t iter_xarray_get_pages(struct iov_iter *i,
1282 struct page ***pages, size_t maxsize,
1283 unsigned maxpages, size_t *_start_offset)
1284 {
1285 unsigned nr, offset;
1286 pgoff_t index, count;
1287 loff_t pos;
1288
1289 pos = i->xarray_start + i->iov_offset;
1290 index = pos >> PAGE_SHIFT;
1291 offset = pos & ~PAGE_MASK;
1292 *_start_offset = offset;
1293
1294 count = want_pages_array(pages, maxsize, offset, maxpages);
> 1295 if (count < 0)
1296 return count;
1297 nr = iter_xarray_populate_pages(*pages, i->xarray, index, count);
1298 if (nr == 0)
1299 return 0;
1300
1301 return min_t(size_t, nr * PAGE_SIZE - offset, maxsize);
1302 }
1303
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [viro-vfs:work.iov_iter_get_pages 24/33] lib/iov_iter.c:1295 iter_xarray_get_pages() warn: unsigned 'count' is never less than zero.
2022-06-19 15:40 [viro-vfs:work.iov_iter_get_pages 24/33] lib/iov_iter.c:1295 iter_xarray_get_pages() warn: unsigned 'count' is never less than zero kernel test robot
@ 2022-06-19 15:48 ` Al Viro
2022-06-19 15:54 ` Matthew Wilcox
0 siblings, 1 reply; 4+ messages in thread
From: Al Viro @ 2022-06-19 15:48 UTC (permalink / raw)
To: kernel test robot; +Cc: kbuild-all, linux-fsdevel
On Sun, Jun 19, 2022 at 11:40:37PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.iov_iter_get_pages
> head: fe8e2809c7db0ec65403b31b50906f3f481a9b10
> commit: e64d637d648390e4ac0643747ae174c3be15f243 [24/33] iov_iter: saner helper for page array allocation
> config: mips-randconfig-m031-20220619 (https://download.01.org/0day-ci/archive/20220619/202206192306.POJg04ej-lkp@intel.com/config)
> compiler: mips-linux-gcc (GCC) 11.3.0
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
>
> smatch warnings:
> lib/iov_iter.c:1295 iter_xarray_get_pages() warn: unsigned 'count' is never less than zero.
Joy... Should've been int all along, obviously (pgoff_t for number of array
elements?)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [viro-vfs:work.iov_iter_get_pages 24/33] lib/iov_iter.c:1295 iter_xarray_get_pages() warn: unsigned 'count' is never less than zero.
2022-06-19 15:48 ` Al Viro
@ 2022-06-19 15:54 ` Matthew Wilcox
2022-06-19 16:19 ` Al Viro
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2022-06-19 15:54 UTC (permalink / raw)
To: Al Viro; +Cc: kernel test robot, kbuild-all, linux-fsdevel
On Sun, Jun 19, 2022 at 04:48:54PM +0100, Al Viro wrote:
> On Sun, Jun 19, 2022 at 11:40:37PM +0800, kernel test robot wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.iov_iter_get_pages
> > head: fe8e2809c7db0ec65403b31b50906f3f481a9b10
> > commit: e64d637d648390e4ac0643747ae174c3be15f243 [24/33] iov_iter: saner helper for page array allocation
> > config: mips-randconfig-m031-20220619 (https://download.01.org/0day-ci/archive/20220619/202206192306.POJg04ej-lkp@intel.com/config)
> > compiler: mips-linux-gcc (GCC) 11.3.0
> >
> > If you fix the issue, kindly add following tag where applicable
> > Reported-by: kernel test robot <lkp@intel.com>
> >
> > smatch warnings:
> > lib/iov_iter.c:1295 iter_xarray_get_pages() warn: unsigned 'count' is never less than zero.
>
> Joy... Should've been int all along, obviously (pgoff_t for number of array
> elements?)
I've been using 'long' for that just because I don't want the drama of
"we need to support 16GB pages" to have anything to do with me.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [viro-vfs:work.iov_iter_get_pages 24/33] lib/iov_iter.c:1295 iter_xarray_get_pages() warn: unsigned 'count' is never less than zero.
2022-06-19 15:54 ` Matthew Wilcox
@ 2022-06-19 16:19 ` Al Viro
0 siblings, 0 replies; 4+ messages in thread
From: Al Viro @ 2022-06-19 16:19 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: kernel test robot, kbuild-all, linux-fsdevel
On Sun, Jun 19, 2022 at 04:54:57PM +0100, Matthew Wilcox wrote:
> On Sun, Jun 19, 2022 at 04:48:54PM +0100, Al Viro wrote:
> > On Sun, Jun 19, 2022 at 11:40:37PM +0800, kernel test robot wrote:
> > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.iov_iter_get_pages
> > > head: fe8e2809c7db0ec65403b31b50906f3f481a9b10
> > > commit: e64d637d648390e4ac0643747ae174c3be15f243 [24/33] iov_iter: saner helper for page array allocation
> > > config: mips-randconfig-m031-20220619 (https://download.01.org/0day-ci/archive/20220619/202206192306.POJg04ej-lkp@intel.com/config)
> > > compiler: mips-linux-gcc (GCC) 11.3.0
> > >
> > > If you fix the issue, kindly add following tag where applicable
> > > Reported-by: kernel test robot <lkp@intel.com>
> > >
> > > smatch warnings:
> > > lib/iov_iter.c:1295 iter_xarray_get_pages() warn: unsigned 'count' is never less than zero.
> >
> > Joy... Should've been int all along, obviously (pgoff_t for number of array
> > elements?)
>
> I've been using 'long' for that just because I don't want the drama of
> "we need to support 16GB pages" to have anything to do with me.
That's "kvmalloc a flat array with that many pointers to pages in it and
and pin those suckers"...
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-06-19 16:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-19 15:40 [viro-vfs:work.iov_iter_get_pages 24/33] lib/iov_iter.c:1295 iter_xarray_get_pages() warn: unsigned 'count' is never less than zero kernel test robot
2022-06-19 15:48 ` Al Viro
2022-06-19 15:54 ` Matthew Wilcox
2022-06-19 16:19 ` Al Viro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox