Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Christian Brauner <christian@brauner.io>
Cc: David Howells <dhowells@redhat.com>,
	Paulo Alcantara <pc@manguebit.org>,
	netfs@lists.linux.dev, linux-afs@lists.infradead.org,
	linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Matthew Wilcox <willy@infradead.org>,
	Christoph Hellwig <hch@infradead.org>,
	Jens Axboe <axboe@kernel.dk>, Mike Marshall <hubcap@omnibond.com>
Subject: [PATCH 08/11] scatterlist: Fix offset in folio calc in extract_xarray_to_sg()
Date: Fri, 19 Jun 2026 15:06:12 +0100	[thread overview]
Message-ID: <20260619140646.2633762-9-dhowells@redhat.com> (raw)
In-Reply-To: <20260619140646.2633762-1-dhowells@redhat.com>

Fix the calculation of the offset in the folio being extracted in
extract_xarray_to_sg().

Note that in the near future, ITER_XARRAY should be removed.

Fixes: f5f82cd18732 ("Move netfs_extract_iter_to_sg() to lib/scatterlist.c")
Link: https://sashiko.dev/#/patchset/20260608145432.681865-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Matthew Wilcox <willy@infradead.org>
cc: Christoph Hellwig <hch@infradead.org>
cc: Jens Axboe <axboe@kernel.dk>
cc: Mike Marshall <hubcap@omnibond.com>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
---
 lib/scatterlist.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index b7fe91ef35b8..6ea40d2e6247 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -1366,6 +1366,7 @@ static ssize_t extract_xarray_to_sg(struct iov_iter *iter,
 		sg_max--;
 
 		maxsize -= len;
+		start += len;
 		ret += len;
 		if (maxsize <= 0 || sg_max == 0)
 			break;


  parent reply	other threads:[~2026-06-19 14:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19 14:06 [PATCH 00/11] netfs: Miscellaneous fixes David Howells
2026-06-19 14:06 ` [PATCH 01/11] netfs: Fix decision whether to disallow write-streaming due to fscache use David Howells
2026-06-19 14:06 ` [PATCH 02/11] cachefiles: Fix double fput David Howells
2026-06-19 14:06 ` [PATCH 03/11] cachefiles: Fix file burial to take lock when unsetting S_KERNEL_FILE David Howells
2026-06-19 14:06 ` [PATCH 04/11] iov_iter: Fix potential underflow in iov_iter_extract_xarray_pages() David Howells
2026-06-19 14:06 ` [PATCH 05/11] iov_iter: Fix missing alloc fail check in iov_iter_extract_bvec_pages() David Howells
2026-06-19 14:06 ` [PATCH 06/11] iov_iter: Fix a memory leak in iov_iter_extract_user_pages() David Howells
2026-06-19 14:06 ` [PATCH 07/11] iov_iter: Remove unused variable in kunit_iov_iter.c David Howells
2026-06-19 14:06 ` David Howells [this message]
2026-06-19 14:06 ` [PATCH 09/11] netfs: Fix kdoc warning David Howells
2026-06-19 14:06 ` [PATCH 10/11] netfs: Replace wb_lock with a bit lock for asynchronicity David Howells
2026-06-19 14:06 ` [PATCH 11/11] netfs: Fix writethrough to use collection offload David Howells

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=20260619140646.2633762-9-dhowells@redhat.com \
    --to=dhowells@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=ceph-devel@vger.kernel.org \
    --cc=christian@brauner.io \
    --cc=hch@infradead.org \
    --cc=hubcap@omnibond.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netfs@lists.linux.dev \
    --cc=pc@manguebit.org \
    --cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox