Re: [Jfs-discussion] fs/jfs: TRIM support for JFS Filesystem
Brought to you by:
blaschke-oss,
shaggyk
From: Dan C. <dan...@or...> - 2012-09-18 06:58:06
|
Hello Tino Reichardt, The patch 0d59722ea777: "fs/jfs: TRIM support for JFS Filesystem" from Aug 29, 2012, leads to the following static checker warning: fs/jfs/jfs_dmap.c:1650 dbDiscardAG() warn: check 'range_cnt' for negative values 1648 nblocks = bmp->db_agfree[agno]; 1649 range_cnt = min_t(int, range_cnt, nblocks / minlen + 1); ^^^ Could we make this unsigned? The caller checks that minlen is >= 1 and probably someone checks nblocks as well, but it's annoying to have to audit this. 1650 totrim = kmalloc(sizeof(struct range2trim) * range_cnt, GFP_NOFS); 1651 if (totrim == NULL) { 1652 jfs_error(bmp->db_ipbmap->i_sb, 1653 "dbDiscardAG: no memory for trim array"); 1654 IWRITE_UNLOCK(ipbmap); 1655 return 0; 1656 } regards, dan carpenter |