All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,viro@zeniv.linux.org.uk,ryan@lahfa.xyz,maximilian@mbosch.me,dhowells@redhat.com,ct@flyingcircus.io,brauner@kernel.org,arnout@bzzt.net,asmadeus@codewreck.org,akpm@linux-foundation.org
Subject: + iov_iter-iov_folioq_get_pages-dont-leave-empty-slot-behind.patch added to mm-nonmm-unstable branch
Date: Mon, 11 Aug 2025 18:04:35 -0700	[thread overview]
Message-ID: <20250812010435.87685C4CEED@smtp.kernel.org> (raw)


The patch titled
     Subject: iov_iter: iov_folioq_get_pages: don't leave empty slot behind
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     iov_iter-iov_folioq_get_pages-dont-leave-empty-slot-behind.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/iov_iter-iov_folioq_get_pages-dont-leave-empty-slot-behind.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Dominique Martinet <asmadeus@codewreck.org>
Subject: iov_iter: iov_folioq_get_pages: don't leave empty slot behind
Date: Mon, 11 Aug 2025 16:39:06 +0900

After advancing into a folioq it makes more sense to point to the next
slot than at the end of the current slot.  This should not be needed for
correctness, but this also happens to "fix" the 9p bug with
iterate_folioq() not copying properly.

Link: https://lkml.kernel.org/r/20250811-iot_iter_folio-v1-2-d9c223adf93c@codewreck.org
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Arnout Engelen <arnout@bzzt.net>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Christian Theune <ct@flyingcircus.io>
Cc: David Howells <dhowells@redhat.com>
Cc: Maximilian Bosch <maximilian@mbosch.me>
Cc: Ryan Lahfa <ryan@lahfa.xyz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 lib/iov_iter.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/lib/iov_iter.c~iov_iter-iov_folioq_get_pages-dont-leave-empty-slot-behind
+++ a/lib/iov_iter.c
@@ -1032,9 +1032,6 @@ static ssize_t iter_folioq_get_pages(str
 			maxpages--;
 		}
 
-		if (maxpages == 0 || extracted >= maxsize)
-			break;
-
 		if (iov_offset >= fsize) {
 			iov_offset = 0;
 			slot++;
@@ -1043,6 +1040,9 @@ static ssize_t iter_folioq_get_pages(str
 				slot = 0;
 			}
 		}
+
+		if (maxpages == 0 || extracted >= maxsize)
+			break;
 	}
 
 	iter->count = count;
_

Patches currently in -mm which might be from asmadeus@codewreck.org are

iov_iter-iterate_folioq-fix-handling-of-offset-=-folio-size.patch
iov_iter-iov_folioq_get_pages-dont-leave-empty-slot-behind.patch


             reply	other threads:[~2025-08-12  1:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12  1:04 Andrew Morton [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-08-13 23:16 + iov_iter-iov_folioq_get_pages-dont-leave-empty-slot-behind.patch added to mm-nonmm-unstable branch Andrew Morton

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=20250812010435.87685C4CEED@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=arnout@bzzt.net \
    --cc=asmadeus@codewreck.org \
    --cc=brauner@kernel.org \
    --cc=ct@flyingcircus.io \
    --cc=dhowells@redhat.com \
    --cc=maximilian@mbosch.me \
    --cc=mm-commits@vger.kernel.org \
    --cc=ryan@lahfa.xyz \
    --cc=viro@zeniv.linux.org.uk \
    /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.