From owner-freebsd-bugs@FreeBSD.ORG Tue Feb 10 18:40:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3D40106566B for ; Tue, 10 Feb 2009 18:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B1C2B8FC14 for ; Tue, 10 Feb 2009 18:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n1AIe2ec083949 for ; Tue, 10 Feb 2009 18:40:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n1AIe2cS083948; Tue, 10 Feb 2009 18:40:02 GMT (envelope-from gnats) Date: Tue, 10 Feb 2009 18:40:02 GMT Message-Id: <200902101840.n1AIe2cS083948@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Ed Schouten Cc: Subject: Re: kern/118287: [kernel] [patch] tty write is not always atomic for small lines X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ed Schouten List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 18:40:03 -0000 The following reply was made to PR kern/118287; it has been noted by GNATS. From: Ed Schouten To: bug-followup@FreeBSD.org, chardin@2wire.com Cc: rwatson@FreeBSD.org Subject: Re: kern/118287: [kernel] [patch] tty write is not always atomic for small lines Date: Tue, 10 Feb 2009 19:32:17 +0100 --RwGu8mu1E+uYXPWP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Charles, Robert Watson poked me to take a look at this PR. Unfortunately the new TTY layer still has the same `guarantees', so this problem still exists. The fix you proposed sounds pretty good in theory, but as you mentioned, it only solves a certain class of races. The problem is that output processing may cause data to grow 8 times, because of tab expansion. What's your opinion on this patch? http://80386.nl/pub/tty-sync.diff It adds synchronisation to the call to ttydisc_write(), which should be pretty solid. Because I want to keep non-blocking writes as they are now, they can still cause data to get mangled, but I guess this is already pretty good. --=20 Ed Schouten WWW: http://80386.nl/ --RwGu8mu1E+uYXPWP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmRyDEACgkQ52SDGA2eCwVscwCfSvYGx0aC4aVouf1frP3QaqHf GIIAn33vIUgCYz6twqtdnBq/GbiAKLbQ =nknL -----END PGP SIGNATURE----- --RwGu8mu1E+uYXPWP--