From owner-svn-src-head@FreeBSD.ORG Mon Nov 3 09:19:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA53674D; Mon, 3 Nov 2014 09:19:59 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3422019C; Mon, 3 Nov 2014 09:19:59 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA39Jsrp000200 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Nov 2014 11:19:54 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA39Jsrp000200 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA39JsRh000199; Mon, 3 Nov 2014 11:19:54 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Nov 2014 11:19:54 +0200 From: Konstantin Belousov To: Bruce Evans Subject: Re: svn commit: r273958 - head/sys/dev/random Message-ID: <20141103091954.GJ53947@kib.kiev.ua> References: <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> <545693B4.8030602@delphij.net> <1414961583.1200.27.camel@revolution.hippie.lan> <20141103113629.I3149@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141103113629.I3149@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "src-committers@freebsd.org" , d@delphij.net, Ian Lepore , "svn-src-all@freebsd.org" , Mark R V Murray , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 09:19:59 -0000 On Mon, Nov 03, 2014 at 11:53:26AM +1100, Bruce Evans wrote: > On Sun, 2 Nov 2014, Ian Lepore wrote: > > > On Sun, 2014-11-02 at 12:27 -0800, Xin Li wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- > >> Hash: SHA512 > >> > >> Hi, Mark, > >> > >> I'd like to propose the attached patch for review. It replaces > >> tsleep's with sx_sleep's, then checks the return value and quit the loop. > > > > It still doesn't handle the partial read/write case Kostik mentioned, > > but there are plenty of other drivers that don't get that right. > > Returning an error for a partial read is good enough for random devices, > since there is no problem with discarding the input. Upper layers are > still broken, so this (discarding the input is what happens automatically > except for ERESTART, EINTR and EWOULDBLOCK. But usermode buffer is already partially accessed and modified. Yes, I am picky about it after vn_io_fault() work. Also, it reminds me about the pipe EPIPE fix. I will commit it in a minute, finally.