linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Steven Whitehouse <swhiteho@redhat.com>,
	Bob Peterson <rpeterso@redhat.com>,
	Al Viro <viro@ZenIV.linux.org.uk>
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: linux-next: build failure after merge of the gfs2 tree
Date: Wed, 9 Jun 2021 13:07:51 +1000	[thread overview]
Message-ID: <20210609130751.38a409a8@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 1800 bytes --]

Hi all,

After merging the gfs2 tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:


Caused by commit

  f8524fce6a88 ("iov_iter: Add iov_iter_fault_in_writeable()")

interacting with commits

  e59c7577f5d6 ("iov_iter: separate direction from flavour")
  30da2b24a3ed ("iov_iter: make the amount already copied available to iterator callbacks")

from the vfs tree.

I have applied the following fix up patch (I think it is mostly right?)

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 9 Jun 2021 12:51:59 +1000
Subject: [PATCH] iov_iter: fix up for iov changes

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 lib/iov_iter.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index d225e827b22a..b2d7289dc729 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -462,17 +462,23 @@ EXPORT_SYMBOL(iov_iter_fault_in_readable);
 
 int iov_iter_fault_in_writeable(struct iov_iter *i, size_t bytes)
 {
-	size_t skip = i->iov_offset;
-	const struct iovec *iov;
-	int err;
-	struct iovec v;
+	if (iter_is_iovec(i)) {
+		const struct iovec *p;
+		size_t skip;
 
-	if (!(i->type & (ITER_BVEC|ITER_KVEC))) {
-		iterate_iovec(i, bytes, v, iov, skip, ({
-			err = fault_in_pages_writeable(v.iov_base, v.iov_len);
+		if (bytes > i->count)
+			bytes = i->count;
+		for (p = i->iov, skip = i->iov_offset; bytes; p++, skip = 0) {
+			size_t len = min(bytes, p->iov_len - skip);
+			int err;
+
+			if (unlikely(!len))
+				continue;
+			err = fault_in_pages_writeable(p->iov_base + skip, len);
 			if (unlikely(err))
 				return err;
-		0;}))
+			bytes -= len;
+		}
 	}
 	return 0;
 }
-- 
2.30.2


-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2021-06-09  3:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09  3:07 Stephen Rothwell [this message]
2021-06-10 12:35 ` linux-next: build failure after merge of the gfs2 tree Andreas Gruenbacher
2021-10-19 22:22 Stephen Rothwell
2021-10-19 23:21 ` Andreas Grünbacher

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=20210609130751.38a409a8@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=agruenba@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=rpeterso@redhat.com \
    --cc=swhiteho@redhat.com \
    --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 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).