From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH v5 4/5] Initialize TPM and get durations and timeouts Date: Tue, 9 Feb 2016 12:36:21 -0700 Message-ID: <20160209193621.GA6531@obsidianresearch.com> References: <1454959628-30582-1-git-send-email-stefanb@linux.vnet.ibm.com> <1454959628-30582-5-git-send-email-stefanb@linux.vnet.ibm.com> <20160209053323.GD12657@obsidianresearch.com> <201602091626.u19GQpga021574@d01av02.pok.ibm.com> <20160209165228.GA14611@obsidianresearch.com> <201602091745.u19HjeEv001740@d03av02.boulder.ibm.com> <20160209180152.GA17475@obsidianresearch.com> <201602091812.u19ICTww018943@d03av01.boulder.ibm.com> <20160209182013.GA19018@obsidianresearch.com> <201602091922.u19JMQ6r025254@d03av05.boulder.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <201602091922.u19JMQ6r025254-3MP/CPU4Muo+UXBhvPuGgqsjOiXwFzmk@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Stefan Berger Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net On Tue, Feb 09, 2016 at 02:22:21PM -0500, Stefan Berger wrote: > It doesn't seem right to simply close the file descriptor on the > process if something goes wrong. The process couldn't close() on it > since another thread could have gotten the same fd number for something > else. I haven't seen a file descriptor that one must not close() in > user space. The kernel should never unilaterally close a fd, just make it permanently error, like a far-end closed socket. Read fails, write fails, and poll returns readable. User space will close it when it detects read failure. Jason ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140