Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932213AbVIJTAO (ORCPT ); Sat, 10 Sep 2005 15:00:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932215AbVIJTAN (ORCPT ); Sat, 10 Sep 2005 15:00:13 -0400 Received: from smtp.osdl.org ([65.172.181.4]:30145 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S932213AbVIJTAM (ORCPT ); Sat, 10 Sep 2005 15:00:12 -0400 Date: Sat, 10 Sep 2005 12:00:01 -0700 (PDT) From: Linus Torvalds To: "Paolo 'Blaisorblade' Giarrusso" cc: Jeff Dike , LKML , user-mode-linux-devel@lists.sourceforge.net Subject: Re: [patch 7/7] uml: retry host close() on EINTR In-Reply-To: <20050910174630.063774000@zion.home.lan> Message-ID: References: <20050910174452.907256000@zion.home.lan> <20050910174630.063774000@zion.home.lan> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1091 Lines: 30 On Sat, 10 Sep 2005, Paolo 'Blaisorblade' Giarrusso wrote: > > When calling close() on the host, we must retry the operation when we get > EINTR. Actually, no. If close() return EINTR, the file descriptor _will_ have been closed. The error return just tells you that soem error happened on the file: for example, in the case of EINTR, the close() may not have flushed all the pending data synchronously. Re-doing the close() is the wrong thing to do, since in a threaded environment, something else might have opened another file, gotten the same file descriptor, and you now close _another_ file. (Normally, re-doing the close will just return EBADF, of course). I'm going to drop this patch, but in case you've ever seen a case where EINTR actually means that the fd didn't get closed, please holler, and we need to fix it. Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/