All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: [bug report] iomap: track pending read bytes more optimally
Date: Fri, 31 Oct 2025 08:34:23 +0300	[thread overview]
Message-ID: <aQRKX5q34Xug_Hly@stanley.mountain> (raw)

Hello Joanne Koong,

Commit 51311f045375 ("iomap: track pending read bytes more
optimally") from Sep 25, 2025 (linux-next), leads to the following
Smatch static checker warning:

	fs/iomap/buffered-io.c:547 iomap_readahead()
	error: uninitialized symbol 'cur_bytes_pending'.

fs/iomap/buffered-io.c
   526  void iomap_readahead(const struct iomap_ops *ops,
   527                  struct iomap_read_folio_ctx *ctx)
   528  {
   529          struct readahead_control *rac = ctx->rac;
   530          struct iomap_iter iter = {
   531                  .inode  = rac->mapping->host,
   532                  .pos    = readahead_pos(rac),
   533                  .len    = readahead_length(rac),
   534          };
   535          size_t cur_bytes_pending;
   536  
   537          trace_iomap_readahead(rac->mapping->host, readahead_count(rac));
   538  
   539          while (iomap_iter(&iter, ops) > 0)
   540                  iter.status = iomap_readahead_iter(&iter, ctx,
   541                                          &cur_bytes_pending);

Smatch worries that either iomap_iter() or iomap_length() might be
false on the first iteration.  I don't know the code so it could be a
false positive.

   542  
   543          if (ctx->ops->submit_read)
   544                  ctx->ops->submit_read(ctx);
   545  
   546          if (ctx->cur_folio)
   547                  iomap_read_end(ctx->cur_folio, cur_bytes_pending);
   548  }


regards,
dan carpenter

                 reply	other threads:[~2025-10-31  5:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=aQRKX5q34Xug_Hly@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=joannelkoong@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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.