linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] iomap: track pending read bytes more optimally
@ 2025-10-31  5:34 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2025-10-31  5:34 UTC (permalink / raw)
  To: Joanne Koong; +Cc: linux-fsdevel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-10-31  5:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31  5:34 [bug report] iomap: track pending read bytes more optimally Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).