All of lore.kernel.org
 help / color / mirror / Atom feed
* [dhowells-fs:netfs-crypt 34/34] fs/netfs/direct_write.c:53 netfs_rmw_read_one() warn: signedness bug returning '(-12)'
@ 2026-05-20  8:42 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-05-20  8:32 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: David Howells <dhowells@redhat.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-crypt
head:   13cee75c8b683f7c4382573f8c27adfbd49ffc47
commit: 13cee75c8b683f7c4382573f8c27adfbd49ffc47 [34/34] netfs: Support encryption on Unbuffered/DIO write
:::::: branch date: 22 hours ago
:::::: commit date: 22 hours ago
config: microblaze-randconfig-r072-20260520 (https://download.01.org/0day-ci/archive/20260520/202605201613.76Hj6Ulj-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 10.5.0
smatch: v0.5.0-9185-gbcc58b9c

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202605201613.76Hj6Ulj-lkp@intel.com/

smatch warnings:
fs/netfs/direct_write.c:53 netfs_rmw_read_one() warn: signedness bug returning '(-12)'

vim +53 fs/netfs/direct_write.c

153a9961b55110 David Howells 2022-02-21  11  
13cee75c8b683f David Howells 2026-05-16  12  /*
13cee75c8b683f David Howells 2026-05-16  13   * Perform a read to a buffer from the server, slicing up the region to be read
13cee75c8b683f David Howells 2026-05-16  14   * according to the network rsize.
13cee75c8b683f David Howells 2026-05-16  15   */
13cee75c8b683f David Howells 2026-05-16  16  static bool netfs_rmw_read_one(struct netfs_io_request *rreq, struct bvecq *bq)
13cee75c8b683f David Howells 2026-05-16  17  {
13cee75c8b683f David Howells 2026-05-16  18  	struct netfs_io_stream *stream = &rreq->io_streams[0];
13cee75c8b683f David Howells 2026-05-16  19  	size_t len = 0;
13cee75c8b683f David Howells 2026-05-16  20  	int ret = 0;
13cee75c8b683f David Howells 2026-05-16  21  
13cee75c8b683f David Howells 2026-05-16  22  	for (int i = 0; i < bq->nr_slots; i++)
13cee75c8b683f David Howells 2026-05-16  23  		len += bq->bv[i].bv_len;
13cee75c8b683f David Howells 2026-05-16  24  
13cee75c8b683f David Howells 2026-05-16  25  	rreq->start		= bq->fpos;
13cee75c8b683f David Howells 2026-05-16  26  	rreq->len		= len;
13cee75c8b683f David Howells 2026-05-16  27  	stream->issue_from	= bq->fpos;
13cee75c8b683f David Howells 2026-05-16  28  	stream->buffered	= len;
13cee75c8b683f David Howells 2026-05-16  29  
13cee75c8b683f David Howells 2026-05-16  30  	do {
13cee75c8b683f David Howells 2026-05-16  31  		struct netfs_io_subrequest *subreq;
13cee75c8b683f David Howells 2026-05-16  32  
13cee75c8b683f David Howells 2026-05-16  33  		subreq = netfs_alloc_subrequest(rreq, NETFS_DOWNLOAD_FROM_SERVER);
13cee75c8b683f David Howells 2026-05-16  34  		if (!subreq) {
13cee75c8b683f David Howells 2026-05-16  35  			ret = -ENOMEM;
13cee75c8b683f David Howells 2026-05-16  36  			break;
13cee75c8b683f David Howells 2026-05-16  37  		}
13cee75c8b683f David Howells 2026-05-16  38  
13cee75c8b683f David Howells 2026-05-16  39  		subreq->start	= stream->issue_from;
13cee75c8b683f David Howells 2026-05-16  40  		subreq->len	= stream->buffered;
13cee75c8b683f David Howells 2026-05-16  41  
13cee75c8b683f David Howells 2026-05-16  42  		spin_lock(&rreq->lock);
13cee75c8b683f David Howells 2026-05-16  43  		list_add_tail(&subreq->rreq_link, &stream->subrequests);
13cee75c8b683f David Howells 2026-05-16  44  		trace_netfs_sreq(subreq, netfs_sreq_trace_added);
13cee75c8b683f David Howells 2026-05-16  45  		spin_unlock(&rreq->lock);
13cee75c8b683f David Howells 2026-05-16  46  
13cee75c8b683f David Howells 2026-05-16  47  		netfs_stat(&netfs_n_rh_download);
13cee75c8b683f David Howells 2026-05-16  48  		rreq->netfs_ops->issue_read(subreq);
13cee75c8b683f David Howells 2026-05-16  49  
13cee75c8b683f David Howells 2026-05-16  50  		cond_resched();
13cee75c8b683f David Howells 2026-05-16  51  	} while (stream->buffered > 0);
13cee75c8b683f David Howells 2026-05-16  52  
13cee75c8b683f David Howells 2026-05-16 @53  	return ret;
13cee75c8b683f David Howells 2026-05-16  54  }
13cee75c8b683f David Howells 2026-05-16  55  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dhowells-fs:netfs-crypt 34/34] fs/netfs/direct_write.c:53 netfs_rmw_read_one() warn: signedness bug returning '(-12)'
@ 2026-05-20  8:42 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-05-20  8:42 UTC (permalink / raw)
  To: oe-kbuild, David Howells; +Cc: lkp, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-crypt
head:   13cee75c8b683f7c4382573f8c27adfbd49ffc47
commit: 13cee75c8b683f7c4382573f8c27adfbd49ffc47 [34/34] netfs: Support encryption on Unbuffered/DIO write
config: microblaze-randconfig-r072-20260520 (https://download.01.org/0day-ci/archive/20260520/202605201613.76Hj6Ulj-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 10.5.0
smatch: v0.5.0-9185-gbcc58b9c

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202605201613.76Hj6Ulj-lkp@intel.com/

smatch warnings:
fs/netfs/direct_write.c:53 netfs_rmw_read_one() warn: signedness bug returning '(-12)'

vim +53 fs/netfs/direct_write.c

13cee75c8b683f David Howells 2026-05-16  16  static bool netfs_rmw_read_one(struct netfs_io_request *rreq, struct bvecq *bq)

This is a bool function.

13cee75c8b683f David Howells 2026-05-16  17  {
13cee75c8b683f David Howells 2026-05-16  18  	struct netfs_io_stream *stream = &rreq->io_streams[0];
13cee75c8b683f David Howells 2026-05-16  19  	size_t len = 0;
13cee75c8b683f David Howells 2026-05-16  20  	int ret = 0;
13cee75c8b683f David Howells 2026-05-16  21  
13cee75c8b683f David Howells 2026-05-16  22  	for (int i = 0; i < bq->nr_slots; i++)
13cee75c8b683f David Howells 2026-05-16  23  		len += bq->bv[i].bv_len;
13cee75c8b683f David Howells 2026-05-16  24  
13cee75c8b683f David Howells 2026-05-16  25  	rreq->start		= bq->fpos;
13cee75c8b683f David Howells 2026-05-16  26  	rreq->len		= len;
13cee75c8b683f David Howells 2026-05-16  27  	stream->issue_from	= bq->fpos;
13cee75c8b683f David Howells 2026-05-16  28  	stream->buffered	= len;
13cee75c8b683f David Howells 2026-05-16  29  
13cee75c8b683f David Howells 2026-05-16  30  	do {
13cee75c8b683f David Howells 2026-05-16  31  		struct netfs_io_subrequest *subreq;
13cee75c8b683f David Howells 2026-05-16  32  
13cee75c8b683f David Howells 2026-05-16  33  		subreq = netfs_alloc_subrequest(rreq, NETFS_DOWNLOAD_FROM_SERVER);
13cee75c8b683f David Howells 2026-05-16  34  		if (!subreq) {
13cee75c8b683f David Howells 2026-05-16  35  			ret = -ENOMEM;
                                                                ^^^^^^^^^^^^^
But it returns 0 on success and true on failue.

13cee75c8b683f David Howells 2026-05-16  36  			break;
13cee75c8b683f David Howells 2026-05-16  37  		}
13cee75c8b683f David Howells 2026-05-16  38  
13cee75c8b683f David Howells 2026-05-16  39  		subreq->start	= stream->issue_from;
13cee75c8b683f David Howells 2026-05-16  40  		subreq->len	= stream->buffered;
13cee75c8b683f David Howells 2026-05-16  41  
13cee75c8b683f David Howells 2026-05-16  42  		spin_lock(&rreq->lock);
13cee75c8b683f David Howells 2026-05-16  43  		list_add_tail(&subreq->rreq_link, &stream->subrequests);
13cee75c8b683f David Howells 2026-05-16  44  		trace_netfs_sreq(subreq, netfs_sreq_trace_added);
13cee75c8b683f David Howells 2026-05-16  45  		spin_unlock(&rreq->lock);
13cee75c8b683f David Howells 2026-05-16  46  
13cee75c8b683f David Howells 2026-05-16  47  		netfs_stat(&netfs_n_rh_download);
13cee75c8b683f David Howells 2026-05-16  48  		rreq->netfs_ops->issue_read(subreq);
13cee75c8b683f David Howells 2026-05-16  49  
13cee75c8b683f David Howells 2026-05-16  50  		cond_resched();
13cee75c8b683f David Howells 2026-05-16  51  	} while (stream->buffered > 0);
13cee75c8b683f David Howells 2026-05-16  52  
13cee75c8b683f David Howells 2026-05-16 @53  	return ret;
13cee75c8b683f David Howells 2026-05-16  54  }

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-20  8:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20  8:32 [dhowells-fs:netfs-crypt 34/34] fs/netfs/direct_write.c:53 netfs_rmw_read_one() warn: signedness bug returning '(-12)' kernel test robot
2026-05-20  8:42 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.