public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: LKML <linux-kernel@vger.kernel.org>, Al Viro <viro@zeniv.linux.org.uk>
Subject: Regression in 4.6.0-git - bisected to commit dd254f5a382c
Date: Mon, 23 May 2016 16:30:43 -0500	[thread overview]
Message-ID: <57437683.30008@lwfinger.net> (raw)

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

The mainline kernels past 4.6.0 fail hang when logging in. There are no error 
messages, and the machine seems to be waiting for some event that never happens.

The problem has been bisected to commit dd254f5a382c ("fold checks into 
iterate_and_advance()"). The bisection has been verified.

The problem is the call from iov_iter_advance(). When I reinstated the old macro 
with a new name and used it in that routine, the system works. Obviously, the 
call that seems to be incorrect has some benefits. My quich-and-dirty patch is 
attached.

I will be willing to test any patch you prepare.

Thanks,

Larry

-- 
If I was stranded on an island and the only way to get off
the island was to make a pretty UI, I’d die there.

Linus Torvalds

[-- Attachment #2: fix_regression.patch --]
[-- Type: text/x-patch, Size: 1552 bytes --]

diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 28cb431..614911c 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -139,6 +139,43 @@
 	}							\
 }
 
+#define iterate_and_advance_nocheck(i, n, v, I, B, K) {		\
+	size_t skip = i->iov_offset;				\
+	if (unlikely(i->type & ITER_BVEC)) {			\
+		const struct bio_vec *bvec;			\
+		struct bio_vec v;				\
+		iterate_bvec(i, n, v, bvec, skip, (B))		\
+		if (skip == bvec->bv_len) {			\
+			bvec++;					\
+			skip = 0;				\
+		}						\
+		i->nr_segs -= bvec - i->bvec;			\
+		i->bvec = bvec;					\
+	} else if (unlikely(i->type & ITER_KVEC)) {		\
+		const struct kvec *kvec;			\
+		struct kvec v;					\
+		iterate_kvec(i, n, v, kvec, skip, (K))		\
+		if (skip == kvec->iov_len) {			\
+			kvec++;					\
+			skip = 0;				\
+		}						\
+		i->nr_segs -= kvec - i->kvec;			\
+		i->kvec = kvec;					\
+	} else {						\
+		const struct iovec *iov;			\
+		struct iovec v;					\
+		iterate_iovec(i, n, v, iov, skip, (I))		\
+		if (skip == iov->iov_len) {			\
+			iov++;					\
+			skip = 0;				\
+		}						\
+		i->nr_segs -= iov - i->iov;			\
+		i->iov = iov;					\
+	}							\
+	i->count -= n;						\
+	i->iov_offset = skip;					\
+}
+ 
 static size_t copy_page_to_iter_iovec(struct page *page, size_t offset, size_t bytes,
 			 struct iov_iter *i)
 {
@@ -488,7 +525,7 @@ EXPORT_SYMBOL(iov_iter_copy_from_user_atomic);
 
 void iov_iter_advance(struct iov_iter *i, size_t size)
 {
-	iterate_and_advance(i, size, v, 0, 0, 0)
+	iterate_and_advance_nocheck(i, size, v, 0, 0, 0)
 }
 EXPORT_SYMBOL(iov_iter_advance);
 

             reply	other threads:[~2016-05-23 21:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 21:30 Larry Finger [this message]
2016-05-24  0:18 ` Regression in 4.6.0-git - bisected to commit dd254f5a382c Al Viro
2016-05-24  2:55   ` Larry Finger
2016-05-24 16:10   ` Larry Finger
2016-05-24 16:28     ` Al Viro
2016-05-24 18:39       ` Larry Finger
2016-05-24 19:13     ` Matthew McClintock
2016-05-24 19:16       ` Larry Finger
2016-05-24 19:25         ` Matthew McClintock
2016-05-24 19:36           ` Larry Finger
2016-05-24 22:31             ` Matthew McClintock
2016-05-24 23:41               ` Al Viro
2016-05-25  0:58                 ` Matthew McClintock
2016-05-25  1:10                   ` Al Viro
2016-05-25  1:20                     ` Matthew McClintock
2016-05-25  1:28                       ` Al Viro
2016-05-25  2:06                         ` Matthew McClintock
2016-05-25  3:21                           ` Al Viro
2016-05-25  6:24                 ` Al Viro
2016-05-25 14:28                   ` Larry Finger
2016-05-25 15:27                   ` Matthew McClintock

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=57437683.30008@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=linux-kernel@vger.kernel.org \
    --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