From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [dhowells-fs:netfs-crypt 34/34] fs/netfs/direct_write.c:53 netfs_rmw_read_one() warn: signedness bug returning '(-12)'
Date: Wed, 20 May 2026 16:32:22 +0800 [thread overview]
Message-ID: <202605201613.76Hj6Ulj-lkp@intel.com> (raw)
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
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, David Howells <dhowells@redhat.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev
Subject: [dhowells-fs:netfs-crypt 34/34] fs/netfs/direct_write.c:53 netfs_rmw_read_one() warn: signedness bug returning '(-12)'
Date: Wed, 20 May 2026 11:42:23 +0300 [thread overview]
Message-ID: <202605201613.76Hj6Ulj-lkp@intel.com> (raw)
Message-ID: <20260520084223.0JhSGXI7rVDU6xsvDRhPB_kr-RdrkrsFZMaKcNIY9nU@z> (raw)
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
next reply other threads:[~2026-05-20 8:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 8:32 kernel test robot [this message]
2026-05-20 8:42 ` [dhowells-fs:netfs-crypt 34/34] fs/netfs/direct_write.c:53 netfs_rmw_read_one() warn: signedness bug returning '(-12)' Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202605201613.76Hj6Ulj-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.