public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Markus Trippelsdorf <markus@trippelsdorf.de>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: Peter Hurley <peter@hurleysoftware.com>,
	linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.cz>, David Howells <dhowells@redhat.com>
Subject: Re: Strange intermittent EIO error when writing to stdout since v3.8.0
Date: Thu, 13 Jun 2013 12:39:50 +0200	[thread overview]
Message-ID: <20130613103950.GB519@x4> (raw)
In-Reply-To: <20914.9444.867518.719403@pilspetsen.it.uu.se>

On 2013.06.07 at 20:22 +0200, Mikael Pettersson wrote:
> Peter Hurley writes:
>  > Based on the other reports from Mikael and David, I suspect this problem
>  > may have to do with my commit 699390354da6c258b65bf8fa79cfd5feaede50b6:
>  > 
>  >    pty: Ignore slave pty close() if never successfully opened
>  > 
>  > This commit poisons the pty under certain error conditions that may
>  > occur from parallel open()s (or parallel close() with pending write()).
>  > 
>  > It's unclear to me which error condition is triggered and how user-space
>  > got an open file descriptor but that seems the most likely. Is the problem
>  > reproducible enough that a debug patch would likely trigger?
> 
> In my case the problem occurred frequently enough that I've been forced
> to change my build procedures to avoid it.  I'd welcome a debug patch.

Since apparently no debugging patch is forthcoming, maybe it's time to
test the simple revert of commit 699390354da.

So can you guys please apply the following patch and see if the issue
goes away?

Thanks.

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 59bfaec..f5801a6 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -38,12 +38,9 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
 	if (tty->driver->subtype == PTY_TYPE_MASTER)
 		WARN_ON(tty->count > 1);
 	else {
-		if (test_bit(TTY_IO_ERROR, &tty->flags))
-			return;
 		if (tty->count > 2)
 			return;
 	}
-	set_bit(TTY_IO_ERROR, &tty->flags);
 	wake_up_interruptible(&tty->read_wait);
 	wake_up_interruptible(&tty->write_wait);
 	tty->packet = 0;
@@ -249,8 +246,6 @@ static int pty_open(struct tty_struct *tty, struct file *filp)
 	if (!tty || !tty->link)
 		goto out;
 
-	set_bit(TTY_IO_ERROR, &tty->flags);
-
 	retval = -EIO;
 	if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
 		goto out;
@@ -259,7 +254,6 @@ static int pty_open(struct tty_struct *tty, struct file *filp)
 	if (tty->driver->subtype == PTY_TYPE_SLAVE && tty->link->count != 1)
 		goto out;
 
-	clear_bit(TTY_IO_ERROR, &tty->flags);
 	clear_bit(TTY_OTHER_CLOSED, &tty->link->flags);
 	set_bit(TTY_THROTTLED, &tty->flags);
 	retval = 0;

-- 
Markus

  reply	other threads:[~2013-06-13 10:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06 11:54 Strange intermittent EIO error when writing to stdout since v3.8.0 Markus Trippelsdorf
2013-06-06 14:18 ` Peter Hurley
2013-06-06 14:37   ` Markus Trippelsdorf
2013-06-07 15:39     ` Peter Hurley
2013-06-07 16:07       ` Markus Trippelsdorf
2013-06-07 18:22       ` Mikael Pettersson
2013-06-13 10:39         ` Markus Trippelsdorf [this message]
2013-06-13 14:16           ` Peter Hurley
2013-06-13 14:51             ` Markus Trippelsdorf
2013-06-13 15:25               ` [PATCH] tty: Debug EIO from write() Peter Hurley
2013-06-13 16:16                 ` Markus Trippelsdorf
2013-06-13 16:29                   ` Peter Hurley
2013-06-13 19:56                     ` [PATCH] tty: Fix transient pty write() EIO Peter Hurley
2013-06-16 17:31                       ` Mikael Pettersson
2013-06-07 19:56       ` Strange intermittent EIO error when writing to stdout since v3.8.0 David Howells
2013-06-11 22:14       ` Orion Poplawski
2013-06-13 10:38         ` Markus Trippelsdorf
2013-06-06 14:41 ` Mikael Pettersson
2013-06-06 17:31 ` David Howells
2013-06-06 18:41   ` Markus Trippelsdorf
2013-06-08 18:56 ` Rob Landley

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=20130613103950.GB519@x4 \
    --to=markus@trippelsdorf.de \
    --cc=dhowells@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@it.uu.se \
    --cc=peter@hurleysoftware.com \
    /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