Re: [kbuild] [block:for-3.18/core 4/16] fs/nfs/direct.c:225 nfs_direct_IO() warn: impossible condition '(rw == (0 | (1 31))) = (0-2147483647, 18446744071562067968-u64max == 2147483648)'
On Fri, Aug 29, 2014 at 10:59:08AM -0400, Martin K. Petersen wrote: Dan == Dan Carpenter dan.carpen...@oracle.com writes: Dan [ Huh... This is an odd one. At first I thought it was a bug in Dan Smatch and then I wondered why Fengguang's scripts blame Martin but Dan it turns out the tools are correct. Dan Adding __REQ_INTEGRITY means that rw can never equal Dan KERNEL_READ because the negative INT_MIN gets sign expanded to Dan 0x8000 which is not equal to 1 31. -dan ] Dan fs/nfs/direct.c:225 nfs_direct_IO() warn: impossible condition '(rw Dan == (0 | (1 31))) = (0-2147483647,18446744071562067968-u64max == Dan 2147483648)' Interesting. I guess the extra flag pushed it over the edge. rw should really be an unsigned long. It should be u64 so 32 bit system still work. regards, dan carpenter ___ kbuild mailing list kbuild@lists.01.org https://lists.01.org/mailman/listinfo/kbuild
[kbuild] [block:for-3.18/core 4/16] fs/nfs/direct.c:225 nfs_direct_IO() warn: impossible condition '(rw == (0 | (1 31))) = (0-2147483647, 18446744071562067968-u64max == 2147483648)'
TO: Martin K. Petersen martin.peter...@oracle.com CC: Jens Axboe ax...@kernel.dk tree: git://git.kernel.dk/linux-block.git for-3.18/core head: 073deb5787aca4569a184a1c541d251f34c9c0a9 commit: 7128b3ac3b84b4f80d77e94c1c221a68334904f6 [4/16] block: Replace bi_integrity with bi_special :: branch date: 20 minutes ago :: commit date: 76 minutes ago fs/nfs/direct.c:225 nfs_direct_IO() warn: impossible condition '(rw == (0 | (1 31))) = (0-2147483647,18446744071562067968-u64max == 2147483648)' git remote add block git://git.kernel.dk/linux-block.git git remote update block git checkout 7128b3ac3b84b4f80d77e94c1c221a68334904f6 vim +225 fs/nfs/direct.c b8a32e2b8 Chuck Lever2006-03-20 209 * b8a32e2b8 Chuck Lever2006-03-20 210 * The presence of this routine in the address space ops vector means a564b8f03 Mel Gorman 2012-07-31 211 * the NFS client supports direct I/O. However, for most direct IO, we a564b8f03 Mel Gorman 2012-07-31 212 * shunt off direct read and write requests before the VFS gets them, a564b8f03 Mel Gorman 2012-07-31 213 * so this method is only ever called for swap. ^1da177e4 Linus Torvalds 2005-04-16 214 */ d8d3d94b8 Al Viro2014-03-04 215 ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, loff_t pos) b8a32e2b8 Chuck Lever2006-03-20 216 { a564b8f03 Mel Gorman 2012-07-31 217 #ifndef CONFIG_NFS_SWAP 6de1472f1 Al Viro2013-09-16 218dprintk(NFS: nfs_direct_IO (%pD) off/no(%Ld/%lu) EINVAL\n, d8d3d94b8 Al Viro2014-03-04 219iocb-ki_filp, (long long) pos, iter-nr_segs); b8a32e2b8 Chuck Lever2006-03-20 220 b8a32e2b8 Chuck Lever2006-03-20 221return -EINVAL; a564b8f03 Mel Gorman 2012-07-31 222 #else a564b8f03 Mel Gorman 2012-07-31 223VM_BUG_ON(iocb-ki_nbytes != PAGE_SIZE); a564b8f03 Mel Gorman 2012-07-31 224 a564b8f03 Mel Gorman 2012-07-31 @225if (rw == READ || rw == KERNEL_READ) 619d30b4b Al Viro2014-03-04 226return nfs_file_direct_read(iocb, iter, pos, a564b8f03 Mel Gorman 2012-07-31 227rw == READ ? true : false); 619d30b4b Al Viro2014-03-04 228return nfs_file_direct_write(iocb, iter, pos, a564b8f03 Mel Gorman 2012-07-31 229rw == WRITE ? true : false); a564b8f03 Mel Gorman 2012-07-31 230 #endif /* CONFIG_NFS_SWAP */ b8a32e2b8 Chuck Lever2006-03-20 231 } b8a32e2b8 Chuck Lever2006-03-20 232 749e146e0 Chuck Lever2007-05-19 233 static void nfs_direct_release_pages(struct page **pages, unsigned int npages) :: The code at line 225 was first introduced by commit :: a564b8f0398636ba30b07c0eaebdef7ff7837249 nfs: enable swap on NFS :: TO: Mel Gorman mgor...@suse.de :: CC: Linus Torvalds torva...@linux-foundation.org --- 0-DAY kernel build testing backend Open Source Technology Center http://lists.01.org/mailman/listinfo/kbuild Intel Corporation ___ kbuild mailing list kbuild@lists.01.org https://lists.01.org/mailman/listinfo/kbuild
[kbuild] [block:for-3.18/core 4/16] fs/nfs/direct.c:225 nfs_direct_IO() warn: impossible condition '(rw == (0 | (1 31))) = (0-2147483647, 18446744071562067968-u64max == 2147483648)'
[ Huh... This is an odd one. At first I thought it was a bug in Smatch and then I wondered why Fengguang's scripts blame Martin but it turns out the tools are correct. Adding __REQ_INTEGRITY means that rw can never equal KERNEL_READ because the negative INT_MIN gets sign expanded to 0x8000 which is not equal to 1 31. -dan ] tree: git://git.kernel.dk/linux-block.git for-3.18/core head: 073deb5787aca4569a184a1c541d251f34c9c0a9 commit: 7128b3ac3b84b4f80d77e94c1c221a68334904f6 [4/16] block: Replace bi_integrity with bi_special fs/nfs/direct.c:225 nfs_direct_IO() warn: impossible condition '(rw == (0 | (1 31))) = (0-2147483647,18446744071562067968-u64max == 2147483648)' git remote add block git://git.kernel.dk/linux-block.git git remote update block git checkout 7128b3ac3b84b4f80d77e94c1c221a68334904f6 vim +225 fs/nfs/direct.c b8a32e2b8 Chuck Lever2006-03-20 209 * b8a32e2b8 Chuck Lever2006-03-20 210 * The presence of this routine in the address space ops vector means a564b8f03 Mel Gorman 2012-07-31 211 * the NFS client supports direct I/O. However, for most direct IO, we a564b8f03 Mel Gorman 2012-07-31 212 * shunt off direct read and write requests before the VFS gets them, a564b8f03 Mel Gorman 2012-07-31 213 * so this method is only ever called for swap. ^1da177e4 Linus Torvalds 2005-04-16 214 */ d8d3d94b8 Al Viro2014-03-04 215 ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, loff_t pos) b8a32e2b8 Chuck Lever2006-03-20 216 { a564b8f03 Mel Gorman 2012-07-31 217 #ifndef CONFIG_NFS_SWAP 6de1472f1 Al Viro2013-09-16 218dprintk(NFS: nfs_direct_IO (%pD) off/no(%Ld/%lu) EINVAL\n, d8d3d94b8 Al Viro2014-03-04 219iocb-ki_filp, (long long) pos, iter-nr_segs); b8a32e2b8 Chuck Lever2006-03-20 220 b8a32e2b8 Chuck Lever2006-03-20 221return -EINVAL; a564b8f03 Mel Gorman 2012-07-31 222 #else a564b8f03 Mel Gorman 2012-07-31 223VM_BUG_ON(iocb-ki_nbytes != PAGE_SIZE); a564b8f03 Mel Gorman 2012-07-31 224 a564b8f03 Mel Gorman 2012-07-31 @225if (rw == READ || rw == KERNEL_READ) 619d30b4b Al Viro2014-03-04 226return nfs_file_direct_read(iocb, iter, pos, a564b8f03 Mel Gorman 2012-07-31 227rw == READ ? true : false); 619d30b4b Al Viro2014-03-04 228return nfs_file_direct_write(iocb, iter, pos, a564b8f03 Mel Gorman 2012-07-31 229rw == WRITE ? true : false); a564b8f03 Mel Gorman 2012-07-31 230 #endif /* CONFIG_NFS_SWAP */ b8a32e2b8 Chuck Lever2006-03-20 231 } b8a32e2b8 Chuck Lever2006-03-20 232 749e146e0 Chuck Lever2007-05-19 233 static void nfs_direct_release_pages(struct page **pages, unsigned int npages) :: The code at line 225 was first introduced by commit :: a564b8f0398636ba30b07c0eaebdef7ff7837249 nfs: enable swap on NFS :: TO: Mel Gorman mgor...@suse.de :: CC: Linus Torvalds torva...@linux-foundation.org --- 0-DAY kernel build testing backend Open Source Technology Center http://lists.01.org/mailman/listinfo/kbuild Intel Corporation ___ kbuild mailing list kbuild@lists.01.org https://lists.01.org/mailman/listinfo/kbuild